[SM-Commit] BZR Change 16 to devel sorcery by Andrew Stitt <afrayedknot at thefrayedknot>

bzr at fawkes.sourcemage.org bzr at fawkes.sourcemage.org
Mon Apr 10 11:45:32 EDT 2006


------------------------------------------------------------
revno: 16
committer: Andrew Stitt <afrayedknot at thefrayedknot>
branch nick: devel
timestamp: Sat 2006-04-08 11:28:17 -0700
message:
  fix bug 10855 and 10900
=== modified file 'ChangeLog'
--- ChangeLog	
+++ ChangeLog	
@@ -1,3 +1,12 @@
+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

=== modified file 'var/lib/sorcery/modules/libapi'
--- var/lib/sorcery/modules/libapi	
+++ var/lib/sorcery/modules/libapi	
@@ -26,12 +26,17 @@
 #    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)
@@ -294,6 +299,30 @@
 
 #---------------------------------------------------------------------
 ## @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:]]*
@@ -350,6 +379,18 @@
 
 #---------------------------------------------------------------------
 ## @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.
@@ -373,6 +414,30 @@
 function default_pre_install () {
     debug "libapi" "default_pre_install - $*"
     real_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 "$@"
 }
 
 #---------------------------------------------------------------------

=== modified file 'var/lib/sorcery/modules/libdepends'
--- var/lib/sorcery/modules/libdepends	
+++ var/lib/sorcery/modules/libdepends	
@@ -93,13 +93,19 @@
   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
-  fi
+    . $SCRIPT_DIRECTORY/PREPARE
+  else
+    default_prepare
+  fi
+  rc=$?
+  persistent_save
+  return $rc
+}
+
+function real_default_prepare() {
+  :
 }
 
 #---------------------------------------------------------------------
@@ -130,17 +136,22 @@
   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
-  fi
+    . $SCRIPT_DIRECTORY/CONFIGURE
+  else
+    default_configure
+  fi
+  rc=$?
+  persistent_save
+  return $rc
+}
+
+function real_default_configure() {
+  :
 }
 
 #---------------------------------------------------------------------
@@ -153,16 +164,21 @@
   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
-  fi
+    .  $SCRIPT_DIRECTORY/DEPENDS
+  else
+    default_depends
+  fi
+  rc=$?
+  persistent_save
+  return $rc
+}
+
+function real_default_depends() {
+  :
 }
 
 #---------------------------------------------------------------------

=== modified file 'var/lib/sorcery/modules/libdispel'
--- var/lib/sorcery/modules/libdispel	
+++ var/lib/sorcery/modules/libdispel	
@@ -271,28 +271,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
-  fi
+  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
-  fi
-
-}
-
+  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() {
+  :
+}
 
 
 




More information about the SM-Commit mailing list