Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master guru-tools by Bor Kraljič (405707ad042e81454884801016b914216083cea0)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Bor Kraljič <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master guru-tools by Bor Kraljič (405707ad042e81454884801016b914216083cea0)
  • Date: Mon, 18 Oct 2010 10:54:33 -0500

GIT changes to master guru-tools by Bor Kraljič <pyrobor AT ver.si>:

hashcheck.sh | 27 ++++++++++++++++++++++++---
smgl-keyring-diff | 5 +++--
2 files changed, 27 insertions(+), 5 deletions(-)

New commits:
commit 405707ad042e81454884801016b914216083cea0
Author: Bor Kraljič <pyrobor AT ver.si>
Commit: Bor Kraljič <pyrobor AT ver.si>

hashcheck.sh: added option to ignore spells with SCM sources and skip them

+ minor usage change

commit 75e3b9fbfa920a49207b0ccaa58ab04bbba71d85
Author: Bor Kraljič <pyrobor AT ver.si>
Commit: Bor Kraljič <pyrobor AT ver.si>

smgl-keyring-diff: don't force branch change to master

We can work on a branch. And we souldn't change the branch to master
after we
are done. We can remember the previous branch and checkout to that one.

diff --git a/hashcheck.sh b/hashcheck.sh
index d51a486..0a81d5a 100755
--- a/hashcheck.sh
+++ b/hashcheck.sh
@@ -13,6 +13,9 @@
# we don't need any input...
PROMPT_DELAY=0

+# all the scm VERSIONs that I could find (using regex "or"/"|" )
+scm_versions="git|GIT|scm|SCM|cvs|CVS|svn|SVN|hg|HG|mercurial|HEAD|head|$(date
+%Y%m%d)"
+
# paste data even if we interupt withc ctrl-c :)
trap 'message "${PROBLEM_COLOR}control-c${DEFAULT_COLOR}"; end_hashcheck 1'
INT

@@ -22,15 +25,16 @@ ${MESSAGE_COLOR}\t-s|--section <section>\t to check whole
section
\t-g|--grimoire <grimoire> to check whole grimoire
\t-v|--verbose\t\t show output from summon and verify_file
\t-d|--download\t\t force download of sources
+\t-i|--ignore-scm\t\t don't bother with spells that have SCM source(s)
\t-f|--remove-failed\t remove sources that are unverified
-\t-a|--remove-all\t remove all sources after check
+\t-a|--remove-all\t\t remove all sources after check
\t-h|--help\t\t show this help"
message "$usage"
}

## Parse the command line parameters and arguments via getopt
-TEMP_OPTS=$(getopt -o 's:g:vdfah' -l 'section:,grimoire:,verbose,download,\
-remove-failed,remove-all,help' \
+TEMP_OPTS=$(getopt -o 's:g:vdfahi' -l 'section:,grimoire:,verbose,download,\
+remove-failed,remove-all,help,ignore-scm' \
-n "$(basename $0)" -- "$@")
if [[ $? != 0 ]]; then show_usage; exit 3; fi
# Note the quotes around `$TEMP': they are essential!
@@ -45,6 +49,7 @@ while true; do
"-d"|"--download") re_download="-d"; shift ;;
"-f"|"--remove-failed") remove_sources="failed"; shift ;;
"-a"|"--remove-all") remove_sources="all"; shift ;;
+ "-i"|"--ignore-scm") ignore_scm="yes"; shift ;;
"-h"|"--help") show_usage; exit 2 ;;
--) shift ; break ;;
*) show_usage; exit 3 ;;
@@ -56,6 +61,18 @@ if [[ $wanted_spells == "" ]]; then
fi


+#---
+## Get spell version
+## @param spell
+## @return version
+#---
+function get_spell_version() {
+ local spell=$1
+ (
+ codex_set_current_spell_by_name $spell
+ echo $VERSION
+ )
+}

function end_hashcheck() {
local exit_status=$1
@@ -99,6 +116,10 @@ for spell in $wanted_spells; do
true
elif [[ $(sources $spell) == "" ]]; then
message "${MESSAGE_COLOR}spell doesn't have sources... SKIPING"
+ elif [[ $ignore_scm == "yes" ]] &&
+ [[ $(get_spell_version $spell) =~ ($scm_versions) ]]; then
+ message "${MESSAGE_COLOR}source is SCM... we are not checking those..." \
+ "SKIPING"
else
ver_message "Getting sources${MESSAGE_COLOR} ... "
if [[ $verbose_mode == on ]]; then
diff --git a/smgl-keyring-diff b/smgl-keyring-diff
index 207bf05..433d9c9 100755
--- a/smgl-keyring-diff
+++ b/smgl-keyring-diff
@@ -17,6 +17,7 @@ if [ -z $1 ]; then
exit 1
fi

+working_branch=$(git branch |grep \* |cut -d" " -f2)
# lets do all the git work in a branch
git checkout -q -b $(basename $0)-temp

@@ -63,8 +64,8 @@ else
fi
echo

-# now lets return to master
-git checkout -q master
+# now lets return to branch we were before
+git checkout -q $working_branch

# we don't need that branch anymore (discard it quietly)
git branch -D $(basename $0)-temp > /dev/null 2>&1



  • [SM-Commit] GIT changes to master guru-tools by Bor Kraljič (405707ad042e81454884801016b914216083cea0), Bor Kraljič, 10/18/2010

Archive powered by MHonArc 2.6.24.

Top of Page