[SM-Commit] GIT changes to test sorcery by Andrew Stitt

Andrew Stitt scm at mail.sourcemage.org
Fri May 19 13:39:00 EDT 2006


GIT changes to test sorcery by Andrew Stitt <astitt at sourcemage.org>:

 ChangeLog                                    |   44 +++++++++
 build                                        |    2 
 etc/sorcery/version                          |    2 
 usr/sbin/gaze                                |    7 +
 usr/sbin/scribe                              |    2 
 var/lib/sorcery/modules/dl_handlers/dl_git   |   80 +++++++++++++++++
 var/lib/sorcery/modules/libapi               |   81 +++++++++++++++++
 var/lib/sorcery/modules/libdepends           |   54 +++++++----
 var/lib/sorcery/modules/libdispel            |   49 ++++++++--
 var/lib/sorcery/modules/libmisc              |    2 
 var/lib/sorcery/modules/libsummon            |    9 -
 var/lib/sorcery/modules/libtablet            |    3 
 var/lib/sorcery/modules/libunpack            |   78 ++++++++++-------
 var/lib/sorcery/modules/url_handlers/url_git |  122 +++++++++++++++++++++++++++
 14 files changed, 463 insertions(+), 72 deletions(-)

New commits:
commit 495339567d464758cd095f4824739665600ecfea
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 20
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Fri 2006-05-12 10:15:47 -0700
    message:
      version++

commit d735f0759705112bcc39da21cf81e10cde7a2080
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 19
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Fri 2006-05-12 10:14:20 -0700
    message:
      fix bug 11413, untar permissions

commit a3ef86353e7961d2074b7ccdfb950e1f6a03cae4
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 18
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Mon 2006-05-01 22:42:10 -0700
    message:
      version++

commit 6252af4c2c98b22e42e7501d749b99895e6649ec
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 17
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Mon 2006-05-01 22:39:16 -0700
    message:
      merge fix for default provider searching

commit 166735865eafc9416aa390d5efa4742f3a99b946
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 16
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Fri 2006-04-21 08:59:24 -0700
    message:
      version++

commit 94a2474189f53c5fd5ca47e0bc3213e2e115a670
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 15
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Fri 2006-04-21 08:40:27 -0700
    message:
      fix bug 11372 and other summon issues

commit 863640b292de7cfa642a54efe91e64d3dc65236c
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 14
    committer: Andrew Stitt <astitt at sourcemage.org>
    branch nick: test
    timestamp: Wed 2006-04-12 09:37:03 -0700
    message:
      fix bug 10682

commit 7f4c21cb2aa89743e58923337c28a3c1353a34b2
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 13
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Wed 2006-04-12 09:27:56 -0700
    message:
      version++

commit fd8ca8f7c54b59a03cc0d1c7df6c594997a970ca
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 12
    committer: Andrew Stitt <astitt at sourcemage.org>
    branch nick: test
    timestamp: Wed 2006-04-12 09:25:46 -0700
    message:
      fix bug 10144

commit 1b81d2352aec4931bcf5e52e6b8e02774dba176d
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 11
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Mon 2006-04-10 12:37:30 -0700
    message:
      version++

commit 2cac71c8c84387a3f051a07cf673446201c70ad0
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 10
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Mon 2006-04-10 12:33:34 -0700
    message:
      pull git handlers into test

commit c155cb88e4a99fccffcb9c2aacd10aa67ea7094b
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 9
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Sat 2006-04-08 13:06:01 -0700
    message:
      fix bugs 10855 and 10900

commit b6d2780fd690138961bf1707903ca3224bec6472
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 8
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Thu 2006-04-06 17:14:22 -0700
    message:
      version++

commit 0af265cd027da106b9fe3379d09f2c371bd0adb3
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 7
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: testa
    timestamp: Thu 2006-04-06 17:00:41 -0700
    message:
      fix bug 10869

commit 30d18d6312c05ae83d741dca6318bf130e481141
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 6
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Tue 2006-04-04 20:50:46 -0700
    message:
      merge from diverged test
        ------------------------------------------------------------
        merged: astitt at sourcemage.org-20060405033026-93e3b17b0110af80
        committer: Andrew Stitt <astitt at sourcemage.org>
        branch nick: test
        timestamp: Tue 2006-04-04 20:30:26 -0700
        message:
          pull in fix for bug 10684

commit 58110c0fde291c431b29408da62dc12fb950e19d
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 5
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Tue 2006-04-04 20:46:48 -0700
    message:
      pull over change for building in bzr

commit 05ace5f5acd951ad5e8a1f1e5e80a83287e9a982
Author: Andrew Stitt <afrayedknot at thefrayedknot>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 4
    committer: Andrew Stitt <afrayedknot at thefrayedknot>
    branch nick: test
    timestamp: Tue 2006-04-04 20:42:31 -0700
    message:
      version++

commit 195bc770c84010f2725a277d96b0475ddc7b4714
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    ------------------------------------------------------------
    revno: 3
    committer: Andrew Stitt <astitt at sourcemage.org>
    branch nick: test
    timestamp: Tue 2006-04-04 20:20:49 -0700
    message:
      fix bug 10357

diff --git a/ChangeLog b/ChangeLog
index 2c69433..5781aea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,50 @@
 2006-03-26 Andrew Stitt <astitt at sourcemage.org>
 	* libsorcery: default to no fuzzy extension matching, bug 10761
 
+2006-05-12 Andrew Stitt <astitt at sourcemage.org>
+	* libunpack: change parameters passed to tar, bug 11413, pull 
+        * libunpack: pull change from David Brown: added
+          --no-same-permissions to tar to fix permissions problems when
+          untaring files with og+w
+
+2006-05-01 Andrew Stitt <astitt at sourcemage.org>
+	* libdepends: fix search for default provider
+
+2006-04-21 Andrew Stitt <astitt at sourcemage.org>
+	* libsummon: fix bug 11372, bad spells can make us unlock the wrong
+	  resource, causing subsequent summons to hang. Also fix return code
+	  propagation.
+
+2006-04-12 Andrew Stitt <astitt at sourcemage.org>
+	* gaze: fix bug 10144, fix viewing of install queue, patch from
+	  Jaka Kranjc
+	* libdispel: print message if dispel fails, bug 10682
+
+2006-04-08 Andrew Stitt <astitt at sourcemage.org>
+	* libdepends: add default_* functions for dependency resolution
+	  phase, bug 10900.
+	* libdispel: add default_* function for dispel phase
+	* libdispel: add persistent_load/persistent_save calls around
+	  *_REMOVE functions, bug 10855.
+	* libapi: add entry points for default_* for depends resolution
+	  and dispel
+
+2006-04-07 Andrew Stitt <astitt at sourcemage.org>
+	* libtablet: allow special keyword 'all' to unconditionally
+	  update a file in the tablet, bug 10869
+
+2006-04-04 Andrew Stitt <astitt at sourcemage.org>
+	* build: exclude .bzr metadata
+
+2006-04-04 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.
+
+2006-04-04 Andrew Stitt <astitt at sourcemage.org>
+	* libmisc: fix bug 10357, add extra check for a file incase theres
+	  a directory named make.
+
 2006-03-25 Andrew Stitt <astitt at sourcemage.org>
 	* libunpack: check for spell or actual command before assuming
 	  verification cannot be done.
diff --git a/build b/build
index 8f737c6..279da2f 100755
--- a/build
+++ b/build
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 function build__find_non_volatile() {
-  find "$@" -follow -not -type d -and -not -path '*CVS*' -and -not -name '.#*' -and -not -name '*~' -and -not -path '*.svn*' -and -not -path '*.arch-id*' -and -not -path '*{arch}*'
+  find "$@" -follow -not -type d -and -not -path '*CVS*' -and -not -name '.#*' -and -not -name '*~' -and -not -path '*.svn*' -and -not -path '*.arch-id*' -and -not -path '*{arch}*' -and -not -path '*.bzr*'
 }
 
 branch_dir=$(basename $(pwd))
diff --git a/etc/sorcery/version b/etc/sorcery/version
index 7803689..c0b9e7a 100644
--- a/etc/sorcery/version
+++ b/etc/sorcery/version
@@ -1 +1 @@
-1.13.5-rc5
+1.13.6-rc2
diff --git a/usr/sbin/gaze b/usr/sbin/gaze
index 51cb797..e74426b 100755
--- a/usr/sbin/gaze
+++ b/usr/sbin/gaze
@@ -1735,7 +1735,12 @@ parse()  {
 
       pam)  find_pam_aware  ;;
 
- install-queue)  display  $INSTALL_QUEUE  "Install queue does not exist"  ;;
+ install-queue)  if [[ -s $INSTALL_QUEUE ]]; then
+                   $PAGER $INSTALL_QUEUE
+                 else
+                   message "Install queue does not exist or is empty"
+                 fi
+                 ;;
 
   remove-queue)  display  $REMOVE_QUEUE   "Remove queue does not exist"   ;;
 
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index 76be418..a4c4d46 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -210,7 +210,7 @@ function scribe_add_update_worker() {
   if  [ -z "$from" ];  then
     #from is empty - use the default
     prefix=$(url_get_prefix $CODEX_URL)
-    if list_find "rsync svn cvs smgl_tla dir" $prefix ; then
+    if list_find "rsync svn cvs smgl_tla dir git" $prefix ; then
       grim_target=$grim_name
     else
       grim_target="$grim_name.tar.bz2"
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_git b/var/lib/sorcery/modules/dl_handlers/dl_git
new file mode 100755
index 0000000..26e8fff
--- /dev/null
+++ b/var/lib/sorcery/modules/dl_handlers/dl_git
@@ -0,0 +1,80 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+##
+##=head1 FUNCTIONS
+##
+##=over 4
+##
+#---------------------------------------------------------------------
+
+
+#---------------------------------------------------------------------
+##=item dl_get_git <url>
+## 
+## Fetch the specified git url.
+##
+## This handler only supports tree downloads.
+##
+#---------------------------------------------------------------------
+function dl_git_get () { 
+  dl_command_check git || return 254
+
+  local target=$1
+  local url_list=$2
+  local hints=$3
+  local dl_target=$4
+  local dl_type=$5
+  local url rc=0
+
+  [[ $target ]] &&
+  dl_connect || return 255
+
+  for url in $url_list; do
+    local URL GIT_ROOT GIT_DIRECTORY GIT_TAG
+    url_crack "$url" "$hints"
+    if test -d $GIT_DIRECTORY; then
+      message "${MESSAGE_COLOR}Running git pull...${DEFAULT_COLOR}"
+      echo git pull $GIT_ROOT 
+      ( cd $GIT_DIRECTORY &&
+      git pull $GIT_ROOT )
+      rc=$?
+      eval "$dl_target=\"$GIT_DIRECTORY\""
+    else
+      message "${MESSAGE_COLOR}Running git clone...${DEFAULT_COLOR}"
+      echo git clone $GIT_ROOT $GIT_DIRECTORY
+      git clone $GIT_ROOT $GIT_DIRECTORY
+      rc=$?
+      eval "$dl_target=\"$GIT_DIRECTORY\""
+    fi
+    [[ $rc == 0 ]] && break
+  done
+  dl_disconnect
+
+  eval "$dl_type=\"tree\""
+  return $rc
+}
+
+#---------------------------------------------------------------------
+##=back
+##
+##=head1 LICENSE
+##
+## This software is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This software is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this software; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##
+#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libapi b/var/lib/sorcery/modules/libapi
index 9cfde4a..4b9e903 100755
--- a/var/lib/sorcery/modules/libapi
+++ b/var/lib/sorcery/modules/libapi
@@ -25,12 +25,17 @@ #    config_query_option    (libmisc)
 #    config_query_string    (libmisc)
 #    conflicts              (libgrimoire)  
 #    default_build          (build_api/...)   
+#    default_configure      (libdepends)
+#    default_depends        (libdepends)
 #    default_download       (libsummon)
 #    default_install        (build_api/api2)   (BUILD_API==2 only)
 #    default_post_build     (build_api/api1)   (BUILD_API==1 only)
 #    default_post_install   (build_api/api2)   (BUILD_API==2 only)
+#    default_post_remove    (libdispel)
 #    default_pre_build      (build_api/common)   
 #    default_pre_install    (build_api/api2)   (BUILD_API==2 only)
+#    default_pre_remove     (libdispel)
+#    default_prepare        (libdepends)
 #    depends                (libdepends)
 #    devoke_installwatch    (libtrack)
 #    download_src           (libsummon)
@@ -74,6 +79,7 @@ #    uncompress             (libunpack)
 #    unpack                 (libunpack) (deprecated)
 #    unpack_file            (libunpack)
 #    unpack_file_simple     (libunpack)
+#    verify_file            (libunpack)
 #
 # Read-only variable that might be of use to a spell:
 # SOURCE_CACHE, OPTS, BUILD HOST, INSTALL_ROOT
@@ -277,6 +283,30 @@ function default_build () {
 
 #---------------------------------------------------------------------
 ## @Type API
+## @See <@function var.lib.sorcery.modules.libdepends.html,real_default_configure> for more details.
+##
+## Default configure code, just no-op for now.
+##
+#---------------------------------------------------------------------
+function default_configure() {
+    debug "libapi" "$FUNCNAME - $*"
+    real_default_configure "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
+## @See <@function var.lib.sorcery.modules.libdepends.html,real_default_depends> for more details.
+##
+## Default depends code, just no-op for now.
+##
+#---------------------------------------------------------------------
+function default_depends() {
+    debug "libapi" "$FUNCNAME - $*"
+    real_default_depends "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
 ## @See <@function var.lib.sorcery.modules.libsummon.html,real_default_download> for more details.
 ##
 ## Default download code, downloads each SOURCE[[:digit:]]*
@@ -333,6 +363,18 @@ function default_post_install () {
 
 #---------------------------------------------------------------------
 ## @Type API
+## @See <@function var.lib.sorcery.modules.libdispel.html,real_default_post_remove> for more details.
+##
+## Default post_remove code, just no-op for now.
+##
+#---------------------------------------------------------------------
+function default_post_remove() {
+    debug "libapi" "$FUNCNAME - $*"
+    real_default_post_remove "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
 ## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_pre_build> for more details.
 ## Creates the source directory and unpacks the source package into it.
 ## Used if no PRE_BUILD script is found for a spell.
@@ -360,6 +402,30 @@ function default_pre_install () {
 
 #---------------------------------------------------------------------
 ## @Type API
+## @See <@function var.lib.sorcery.modules.libdispel.html,real_default_pre_remove> for more details.
+##
+## Default pre_remove code, just no-op for now.
+##
+#---------------------------------------------------------------------
+function default_pre_remove() {
+    debug "libapi" "$FUNCNAME - $*"
+    real_default_pre_remove "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
+## @See <@function var.lib.sorcery.modules.libdepends.html,real_default_prepare> for more details.
+##
+## Default prepare code, just no-op for now.
+##
+#---------------------------------------------------------------------
+function default_prepare() {
+    debug "libapi" "$FUNCNAME - $*"
+    real_default_prepare "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
 ## @param spell/service
 ## @param enabled options (optional)
 ## @param description (optional)
@@ -1016,6 +1082,21 @@ function unpack_file_simple() {
 
 #---------------------------------------------------------------------
 ## @Type API
+## @param SOURCE suffix
+## @See <@function var.lib.sorcery.modules.libunpack.html,real_verify_file> for more details.
+##
+## verify_file takes the SOURCE suffix and verifies the file without
+## unpacking it. It does not work with the old 'MD5[0]=...' style.
+## Only with the "new" SOURCEn_(GPG|HASH|IGNORE) style.
+##
+#---------------------------------------------------------------------
+function verify_file () {
+    debug "libapi" "verify_file - $*"
+    real_verify_file "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
 ## @param Target of the trigger
 ## @param Action to execute
 ## @See <@function var.lib.sorcery.modules.libdepends.html,real_up_triggers> for more details.
diff --git a/var/lib/sorcery/modules/libdepends b/var/lib/sorcery/modules/libdepends
index a9c7094..5be17ab 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -93,13 +93,19 @@ function run_prepare() 
   local GRIMOIRE=${SECTION_DIRECTORY%/*}
 
   local PROTECT_SORCERY=yes
+  persistent_load &&
   if  [  -x  $SCRIPT_DIRECTORY/PREPARE  ];  then
-    # we need &&'s to preserve the proper return code (persistant_save
-    # will probably succeed even if PREPARE fails)
-    persistent_load &&
-    . $SCRIPT_DIRECTORY/PREPARE &&
-    persistent_save
+    . $SCRIPT_DIRECTORY/PREPARE
+  else
+    default_prepare
   fi
+  rc=$?
+  persistent_save
+  return $rc
+}
+
+function real_default_prepare() {
+  :
 }
 
 #---------------------------------------------------------------------
@@ -129,17 +135,22 @@ function run_configure() 
   local SPELL=$1
   debug "cast" "run_configure() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"
 
- 
   local PROTECT_SORCERY=yes
+  persistent_load &&
   if  [  -x  $SCRIPT_DIRECTORY/CONFIGURE  ];  then
     message  "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
              "${CHECK_COLOR}running configuration...${DEFAULT_COLOR}"
-    # we need &&'s to preserve the proper return code (persistant_save
-    # will probably succeed even if PREPARE fails)
-    persistent_load &&
-    . $SCRIPT_DIRECTORY/CONFIGURE &&
-    persistent_save
+    . $SCRIPT_DIRECTORY/CONFIGURE
+  else
+    default_configure
   fi
+  rc=$?
+  persistent_save
+  return $rc
+}
+
+function real_default_configure() {
+  :
 }
 
 #---------------------------------------------------------------------
@@ -152,16 +163,21 @@ function run_depends() 
   debug "cast" "run_depends() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"
  
   local PROTECT_SORCERY=yes
+  persistent_load &&
   if  [  -x  $SCRIPT_DIRECTORY/DEPENDS  ];  then
     message  "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
              "${CHECK_COLOR}checking dependencies...${DEFAULT_COLOR}"
-
-    # we need &&'s to preserve the proper return code (persistant_save
-    # will probably succeed even if PREPARE fails)
-    persistent_load &&
-    .  $SCRIPT_DIRECTORY/DEPENDS &&
-    persistent_save
+    .  $SCRIPT_DIRECTORY/DEPENDS
+  else
+    default_depends
   fi
+  rc=$?
+  persistent_save
+  return $rc
+}
+
+function real_default_depends() {
+  :
 }
 
 #---------------------------------------------------------------------
@@ -667,7 +683,7 @@ function work_depends_provider()
 
   # check if theres a default provider
   if [[ ! $default ]]; then
-    explode "$(search_default_provider $DEFAULT_PROVIDERS "" "$1")" ":" "status"
+    explode "$(search_default_provider $DEFAULT_PROVIDERS ".*" "$1")" ":" "status"
     tmp=${status[0]}
     [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" && default=$tmp
   fi
@@ -760,7 +776,7 @@ function work_optional_depends_provider(
 
   # check if theres a default provider
   if [[ ! $default ]]; then
-    tmp=$(search_default_provider $DEFAULT_PROVIDERS "" "$1")
+    tmp=$(search_default_provider $DEFAULT_PROVIDERS ".*" "$1")
 
     # make sure we found /something/ before trying to analyze it
     # otherwise we'll fall into the else case and use 'none' as the
diff --git a/var/lib/sorcery/modules/libdispel b/var/lib/sorcery/modules/libdispel
index a7039db..6f4c4c1 100755
--- a/var/lib/sorcery/modules/libdispel
+++ b/var/lib/sorcery/modules/libdispel
@@ -268,28 +268,45 @@ #-----
 ## Run the PRE_REMOVE script if it exists
 #-----
 function pre_remove() {
-  if [[ $SCRIPT_DIRECTORY ]] && [ -x $SCRIPT_DIRECTORY/PRE_REMOVE ]; then
-    unset  LD_PRELOAD
-    . $SCRIPT_DIRECTORY/PRE_REMOVE
+  local rc=0
+  if  [[ $SCRIPT_DIRECTORY ]] ; then
+    persistent_load &&
+    if test  -x  $SCRIPT_DIRECTORY/PRE_REMOVE ; then
+      . $SCRIPT_DIRECTORY/PRE_REMOVE
+    else
+      default_pre_remove
+    fi
+    rc=$?
+    persistent_save
   fi
+  return $rc
+}
+
+function real_default_pre_remove() {
+  :
 }
 
 #-----
 ## Run the POST_REMOVE script if it exists.
 #-----
 function post_remove() {
-  # what is the point of this?
-  LD_PRELOAD_OLD="$LD_PRELOAD"
-  unset LD_PRELOAD
-
-  export  LD_PRELOAD="$LD_PRELOAD_OLD"
-
-  if  [[ $SCRIPT_DIRECTORY ]] && [  -x  $SCRIPT_DIRECTORY/POST_REMOVE  ]
-  then     . $SCRIPT_DIRECTORY/POST_REMOVE
+  local rc=0
+  if  [[ $SCRIPT_DIRECTORY ]] ; then
+    persistent_load &&
+    if test  -x  $SCRIPT_DIRECTORY/POST_REMOVE ; then
+      . $SCRIPT_DIRECTORY/POST_REMOVE
+    else
+      default_post_remove
+    fi
+    rc=$?
+    persistent_save
   fi
-
+  return $rc
 }
 
+function real_default_post_remove() {
+  :
+}
 
 
 
@@ -333,6 +350,14 @@ function dispel_spell() {
       activity_log  "dispel"  "$SPELL"  "$VERSION"  "success"
     ) &&
     reap_depends
+    local rc=$?
+    if [[ "$rc" != 0 ]] ; then
+        message "${PROBLEM_COLOR}Dispel of${DEFAULT_COLOR}" \
+                "${SPELL_COLOR}$SPELL${DEFAULT_COLOR}" \
+                "${PROBLEM_COLOR}failed!${DEFAULT_COLOR}"
+        return $rc
+    fi
+    return 0
 }
 
 #---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index 8a8c503..613cd66 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -1128,7 +1128,7 @@ function smgl_which() {
   local target=$1 location
   local BREAK
   function smgl_which_sub() {
-    if test -x "$1/$target" ; then
+    if test -f "$1/$target" -a -x "$1/$target" ; then
       echo "$1/$target"
       BREAK=yes
     fi
diff --git a/var/lib/sorcery/modules/libsummon b/var/lib/sorcery/modules/libsummon
index e6d5125..123d0b7 100755
--- a/var/lib/sorcery/modules/libsummon
+++ b/var/lib/sorcery/modules/libsummon
@@ -49,7 +49,6 @@ function summon_spell() {
       persistent_save
       # save the rc, then unlock
       rc=$?
-      unlock_resources "summon" "${SPELL}"
 
       if [[ $rc == 0 ]]; then
         activity_log "summon" "$SPELL"  "$VERSION" "success"
@@ -59,10 +58,10 @@ function summon_spell() {
 
       # this actually only returns from the subshell, not the function
       return $rc
-    ) &&
-    popd &>/dev/null
-    rm -rf $dl_dir
+    ) && popd &>/dev/null
     rc=$?
+    rm -rf $dl_dir
+    unlock_resources "summon" "${SPELL}"
   fi
   return $rc
 }
@@ -382,7 +381,7 @@ function unpack_for_update() {
   local _guess_type
 
   # hard-coded list of url prefixes that generally download trees
-  local tree_prefixes="cvs dir rsync smgl_tla svn"
+  local tree_prefixes="cvs dir rsync smgl_tla svn git"
   local prefix=$(url_get_prefix $url_list)
   if ! list_find "$hints" file &&
      list_find "$hints" tree || list_find "$tree_prefixes" "$prefix" ; then
diff --git a/var/lib/sorcery/modules/libtablet b/var/lib/sorcery/modules/libtablet
index 6976957..be64882 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -595,7 +595,8 @@ function tablet_check_repair_file() {
   else
     codex_md5=$(md5sum $repair_file|cut -f1 -d' ')
     tablet_md5=$(md5sum $tablet_file|cut -f1 -d' ')
-    if [[ $spell_version == $key ]] ||
+    if [[ $key == "all" ]] ||
+       [[ $spell_version == $key ]] ||
        [[ $spell_updated == $key ]] ||
        [[ $spell_patchlevel == $key ]] ||
        [[ $tablet_md5 == $key ]] ; then
diff --git a/var/lib/sorcery/modules/libunpack b/var/lib/sorcery/modules/libunpack
index 2fca0ed..0aa8584 100755
--- a/var/lib/sorcery/modules/libunpack
+++ b/var/lib/sorcery/modules/libunpack
@@ -122,34 +122,17 @@ #---------------------------------------
 function real_unpack_file() {
   debug "libgrimoire" "real_unpack_file - $*"
 
-  local GPGNUM="$1"
-  local SVAR="SOURCE${GPGNUM}"
-
-  local crypto_func
-  for crypto_func in GPG HASH IGNORE; do
-    debug "libgrimoire" "checking $crypto_func verification"
-    local AVAR="SOURCE${GPGNUM}_${crypto_func}"
-    local AVARN="$AVAR"
-    local iter=0
-    local rc=""
-    # NOTE ## date: 2005-08-25
-    # This while loop runs through the SOURCEn_{GPG|HASH|IGNORE}m not the
-    # SOURCEn_*[m] set of vars this is kinda confusing we might rip it out
-    while [ -n "${!AVARN}" ]; do
-      local lcase_crypto_func="$(echo $crypto_func | tr 'A-Z' 'a-z')"
-      unpack_$lcase_crypto_func "${!SVAR}" "${!AVARN}"
-      rc="$?"
-      case "$rc" in
-        200) debug "libgrimoire" "falling back from $AVARN"; rc="" ;;
-          1)                               return "$rc"            ;;
-          0) uncompress_unpack "${!SVAR}"; return "$?"             ;;
-      esac
-      (( iter++ ))
-      AVARN="$AVAR[$iter]"
-    done
-    [ -n "$rc" ] && return "$rc"
-  done
+  local FILENUM="$1"
+  local SVAR="SOURCE${FILENUM}"
 
+  real_verify_file "$@"
+  rc=$?
+  case "$rc" in
+    200) debug "libunpack" "unable to verify $SVAR ${!SVAR}" ;;
+      1) return 1 ;; # verification failed
+      0) uncompress_unpack ${!SVAR}; return $? ;;
+  esac
+  
   if false; then # <------ here's the switch to disable oldworld -------
     debug "libgrimoire" "falling back to missing verification"
     unpack_missing "${!SVAR}"
@@ -160,13 +143,48 @@ function real_unpack_file() {
     esac
   else
     debug "libgrimoire" "falling back to regular MD5[]"
-    local MD5NUM="$([ -z "$GPGNUM" ] && echo 0 || echo "$(($GPGNUM - 1))")"
+    local MD5NUM="$([ -z "$FILENUM" ] && echo 0 || echo "$(($FILENUM - 1))")"
     real_unpack "${!SVAR}" "${MD5[$MD5NUM]}"
   fi
 }
 
 
 #---------------------------------------------------------------------
+## @Type API
+## @param SOURCE suffix
+##
+## Does the work of verifying a file with the new-world verification
+## system.
+#---------------------------------------------------------------------
+function real_verify_file() {
+  debug "libunpack" "real_verify_file - $*"
+
+  local FILENUM="$1"
+  local SVAR="SOURCE${FILENUM}"
+
+  local crypto_func
+  for crypto_func in GPG HASH IGNORE; do
+    debug "libgrimoire" "checking $crypto_func verification"
+
+    local AVAR="SOURCE${FILENUM}_${crypto_func}"
+    [[ -n ${!AVAR} ]] || continue
+
+    local rc=""
+    local lcase_crypto_func="$(echo $crypto_func | tr 'A-Z' 'a-z')"
+    unpack_$lcase_crypto_func "${!SVAR}" "${!AVAR}"
+    rc="$?"
+
+    case "$rc" in
+      200) debug "libgrimoire" "unable to verify $AVAR with $crypto_func" ;;
+        *) return $rc ;;
+    esac
+
+  done
+  return 200
+}
+
+
+#---------------------------------------------------------------------
 ## @param filename 
 ## @param compressor 
 ## @Stdout uncompressed
@@ -207,8 +225,8 @@ function unpack_core() {
 
   case  "$2"  in
             bzip2|gzip|compress*|tar)
-                    tar   --owner=root  --group=root  -xf  /dev/stdin \
-                          2> /dev/null  ||  cat > /dev/null            ;;
+                    tar   --no-same-owner --no-same-permissions -xf \
+		          /dev/stdin 2> /dev/null  ||  cat > /dev/null ;;
               Zip)  cat /dev/stdin >/dev/null   #get rid of unused output
                     unzip  -q  "$1"                                    ;;
               RPM)  cpio  -idm < /dev/stdin                            ;;
diff --git a/var/lib/sorcery/modules/url_handlers/url_git b/var/lib/sorcery/modules/url_handlers/url_git
new file mode 100755
index 0000000..ae61565
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_git
@@ -0,0 +1,122 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+## 
+## Url handler functions for downloading git urls
+##
+##=head1 DESCRIPTION
+##
+## This file contains functions for downloading and verifying 
+## git urls.  This file uses the "git" program.
+## 
+##=head1 COPYRIGHT
+##
+## Copyright 2002 by the Source Mage Team
+##
+##=head1 FUNCTIONS
+##
+##=over 4
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_git_crack <url>
+## 
+## Parse the specified git url.
+##
+## @Global URL
+## @Global GIT_ROOT
+## @Global GIT_DIRECTORY
+## @Global GIT_TAG
+##
+#---------------------------------------------------------------------
+function url_git_crack() {
+
+  URL=`url_strip_prefix "$1" git`
+  GIT_ROOT=`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+  GIT_ROOT=git://$GIT_ROOT
+  local GIT_DIRECTORY_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+  GIT_DIRECTORY=`echo $GIT_DIRECTORY_TAG | cut -d : -f2`
+  local GIT_TAGNAME=`echo $GIT_DIRECTORY_TAG | cut -d : -f3`
+  GIT_TAG=${SVN_TAGNAME:=master}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_git_bucketize <url>
+## 
+## Verifies the specified git url.  Returns true if the url exists
+## OR if the url is an empty string.
+##
+#---------------------------------------------------------------------
+function url_git_bucketize() {
+  echo git
+}
+
+#---------------------------------------------------------------------
+##=item url_git_verify <url>
+## 
+## Verifies the specified git url.  Returns true if the url exists
+## OR if the url is an empty string.
+##
+#---------------------------------------------------------------------
+function url_git_verify() {
+  local  URL GIT_ROOT GIT_DIRECTORY GIT_TAG item
+  url_git_crack $1
+  for item in URL GIT_ROOT GIT_DIRECTORY GIT_TAG ; do
+    if ! [[ ${!item} ]] ; then
+      return 1
+    fi
+  done
+}
+
+#---------------------------------------------------------------------
+##=item url_<prefix>_hostname <url>
+##
+## Gets the hostname out of the url
+#---------------------------------------------------------------------
+function url_git_hostname() {
+  echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
+}
+
+#---------------------------------------------------------------------
+##=item url_git_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_git_netselect() {
+  local tmp_hostname url_speed each
+
+  for each in "$@" ; do
+    tmp_hostname=$(url_git_hostname $each)
+    # since we had to pull the url apart to give netselect
+    # something it can understand we'll just pretend like
+    # multiple A records wont exist for this host...
+    url_speed=$(netselect -s 1 $tmp_hostname 2>/dev/null|awk '{print $1}')
+    [[ -n $url_speed ]] && echo "$url_speed $each"
+  done
+}
+
+
+#---------------------------------------------------------------------
+##=back
+##
+##=head1 LICENSE
+##
+## This software is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This software is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this software; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##
+#---------------------------------------------------------------------



More information about the SM-Commit mailing list