[SM-Commit] PERFORCE change 76788 by Andrew Stitt for review

Perforce Review Daemon p4review at smee.org
Sat Mar 25 18:00:01 EST 2006


Change 76788 by andrew_stitt at afk-courier on 2006/03/25 22:55:38

	fix bug 10574

Affected files ...

... //sgl/sorcery/devel/ChangeLog#538 edit
... //sgl/sorcery/devel/var/lib/sorcery/modules/libunpack#23 edit

Differences ...

==== //sgl/sorcery/devel/ChangeLog#538 (text) ====

@@ -1,4 +1,8 @@
 2006-03-25 Andrew Stitt <astitt at sourcemage.org>
+	* libunpack: check for spell or actual command before assuming
+	  verification cannot be done.
+
+2006-03-25 Andrew Stitt <astitt at sourcemage.org>
 	* libunpack: move verification code out of unpack_file and into
 	  new verify_file function. Removed un-used inner loop.
 	* libapi: add entry point for verify_file. Fixes bug 10684.

==== //sgl/sorcery/devel/var/lib/sorcery/modules/libunpack#23 (xtext) ====

@@ -278,9 +278,10 @@
 function unpack_spell_required() {
   debug "libgrimoire" "Running unpack_spell_required -- $1"
 
-  if ! spell_ok "$1" ; then
+  local x
+  if ! spell_ok "$1" && ! smgl_which $2 x &> /dev/null; then
     query "This spell has an option to check its integrity via spell "\
-"${SPELL_COLOR}${1}${QUERY_COLOR} for $2, you might consider casting it. "\
+"${SPELL_COLOR}${1}${QUERY_COLOR} with the $2 command for $3, you might consider installing it. "\
 "Abort?" n && 
       return 1 ||
         return 200
@@ -390,7 +391,7 @@
 
   message "${MESSAGE_COLOR}GPG checking source file $1...${DEFAULT_COLOR}"
 
-  unpack_spell_required gnupg || return "$?"
+  unpack_spell_required gnupg gpg || return "$?"
 
   gpg_verify_signature "$( locate_spell_file "$SFNAME" )" \
                        "$FILENAME" \
@@ -446,10 +447,11 @@
   if [ "$MD5SUM_DL" != "off" ]; then
 
     if [[ "$ALGORITHM" == md5 ]] || [[ "$ALGORITHM" == sha1 ]] ; then
-      unpack_spell_required coreutils "$ALGORITHM" || return "$?" 
+      unpack_spell_required coreutils "${ALGORITHM}sum" "$ALGORITHM" ||
+        return "$?" 
       HASH="$(${ALGORITHM}sum "$FILENAME" | cut -d' ' -f1)"
     else
-      unpack_spell_required gnupg "$ALGORITHM" || return "$?"
+      unpack_spell_required gnupg gpg "$ALGORITHM" || return "$?"
       if list_find "$(gpg_get_hashes)" $ALGORITHM; then
         HASH="$(gpg_hashsum "${ALGORITHM}" "$FILENAME" | cut -d' ' -f1)"
       else 



More information about the SM-Commit mailing list