[SM-Commit] PERFORCE change 76806 by David Michael Leo Brown Jr. for review

Perforce Review Daemon p4review at smee.org
Sun Mar 26 00:30:01 EST 2006


Change 76806 by david_brown at dmlb2000-dmlb2004 on 2006/03/26 06:25:02

	part of it integrated from devel... didn't know how to get around it
	since the files that got integrated were also edited... :\
	
	But Any who...
	
	ChangeLog version and gaze were integrated without change from devel
	
	config had additions for unstaged directory trees and part was an
	integrate from devel also added the config stage directory
	
	api2 removed calls to invoke stage root and install root from the
	run post install and run install functions also changed passing vars
	to delve on the commandline to just exporting them
	
	libresurrect changed install_config_file to just install the config if
	we are staging the spell anyway.
	
	libstage moved configs from staging to the system with hidden files to
	staging to CONFIG_STAGE_DIRECTORY
	
	libtrack changed to export the var from config rather than a fixed list

Affected files ...

... //sgl/sorcery/proj/proj1/ChangeLog#67 integrate
... //sgl/sorcery/proj/proj1/etc/sorcery/config#32 edit
... //sgl/sorcery/proj/proj1/etc/sorcery/version#49 integrate
... //sgl/sorcery/proj/proj1/usr/sbin/gaze#24 integrate
... //sgl/sorcery/proj/proj1/var/lib/sorcery/modules/build_api/api2#31 edit
... //sgl/sorcery/proj/proj1/var/lib/sorcery/modules/libresurrect#8 edit
... //sgl/sorcery/proj/proj1/var/lib/sorcery/modules/libstage#17 edit
... //sgl/sorcery/proj/proj1/var/lib/sorcery/modules/libtrack#28 edit

Differences ...

==== //sgl/sorcery/proj/proj1/ChangeLog#67 (text) ====

@@ -1,3 +1,8 @@
+2006-03-25 David Brown <dmlb2000 at gmail.com>
+	* config: changed name TRACKED to GAZE_ALIEN_PATHS so it's a little
+	  less ambiguous
+	* gaze: only other place the TRACKED var was used...
+
 2006-03-25 Andrew Stitt <astitt at sourcemage.org>
 	* libunpack: check for spell or actual command before assuming
 	  verification cannot be done.

==== //sgl/sorcery/proj/proj1/etc/sorcery/config#32 (xtext) ====

@@ -149,7 +149,7 @@
 
                SCREEN={SCREEN:-off}
 
-              TRACKED="/bin /boot /etc /lib /sbin /usr /var"
+              GAZE_ALIEN_PATHS="/bin /boot /etc /lib /sbin /usr /var"
                  DOCS="README* FAQ* CHAN* doc* DOC* conf SETUP LICENSE COPYING NEWS"
 PROGRESS_SPINNER_CHARS='-\|/'
 
@@ -172,6 +172,25 @@
 
       BUILD_DIRECTORY=${INSTALL_ROOT}/usr/src
    DOCUMENT_DIRECTORY=${INSTALL_ROOT}/usr/share/doc
+CONFIG_STAGE_DIRECTORY=${STATE_ROOT}/var/state/sorcery/staged_configs
+
+	      # this is passed directly to installwatch so it can't contain
+	      # shell expansions or regex's
+for dir in /dev \
+           /proc \
+	   /tmp  \
+	   /var/tmp \
+	   /sys \
+	   ${BUILD_DIRECTORY} \
+	   ${SGL_LIBRARY} \
+	   ${INSTALL_ROOT}/${SGL_LIBRARY} \
+	   ${SOURCE_CACHE} \
+	   ${CONFIG_CACHE} \
+	   ${STATE_DIRECTORY} \
+	   ${LOG_DIRECTORY} ; do
+  INSTALLWATCH_UNSTAGED_PATHS="${INSTALLWATCH_UNSTAGED_PATHS}${dir},"
+done
+INSTALLWATCH_UNSTAGED_PATHS=${INSTALLWATCH_UNSTAGED_PATHS%,}
 
 # this makes appending the sorcery path idempotent
 [ -z ${PATH##*$SORCERY_PATH*} ] || export PATH="$PATH:$SORCERY_PATH"

==== //sgl/sorcery/proj/proj1/etc/sorcery/version#49 (text) ====

@@ -1,1 +1,1 @@
-20060324
+20060325

==== //sgl/sorcery/proj/proj1/usr/sbin/gaze#24 (xtext) ====

@@ -243,7 +243,7 @@
 
   [[ $GAZE_VERBOSE != 0 ]] && 
   message  "Discovering ambient files..."
-  find  $TRACKED  |  files  |  filter  "$EXCLUDED"  |  sort  >$TMP_DIR/gaze.found
+  find  $GAZE_ALIEN_PATHS |  files  |  filter  "$EXCLUDED"  |  sort  >$TMP_DIR/gaze.found
  
   diff  -B  -a  -d  $TMP_DIR/gaze.found  $TMP_DIR/gaze.known  |
   grep  -v  "^> "                                     |

==== //sgl/sorcery/proj/proj1/var/lib/sorcery/modules/build_api/api2#31 (xtext) ====

@@ -58,28 +58,22 @@
       run_pre_install                     &&
       prepare_stage_root                  &&
       invoke_installwatch                 &&
-      if [[ "$STAGED_INSTALL" == "off" ]]
+      if [[ "$STAGED_INSTALL" != "off" ]]
       then
         invoke_stage_root
       fi &&
-      ( 
-        C_LOG=$C_LOG \
-        C_FIFO=$C_FIFO \
-        IW_LOG=$IW_LOG \
-        VOYEUR_STDOUT=$VOYEUR_STDOUT \
-        VOYEUR_STDERR=$VOYEUR_STDERR \
-	S_PWD=$TMP_DIR/build.saved.pwd \
-        delve $SPELL INSTALL              && 
-        C_LOG=$C_LOG \
-        C_FIFO=$C_FIFO \
-        IW_LOG=$IW_LOG \
-        VOYEUR_STDOUT=$VOYEUR_STDOUT \
-        VOYEUR_STDERR=$VOYEUR_STDERR \
-        delve $SPELL POST_INSTALL           
-      )                                     || return 2
-      if [[ "$STAGED_INSTALL" == "off" ]]
+      export C_LOG=$C_LOG
+      export C_FIFO=$C_FIFO 
+      export IW_LOG=$IW_LOG 
+      export VOYEUR_STDOUT=$VOYEUR_STDOUT 
+      export VOYEUR_STDERR=$VOYEUR_STDERR 
+      export S_PWD=$TMP_DIR/build.saved.pwd 
+      delve $SPELL INSTALL                &&
+      delve $SPELL POST_INSTALL           || return 2
+      if [[ "$STAGED_INSTALL" != "off" ]]
       then
-        devoke_stage_root
+        devoke_stage_root &&
+	install_staged_spell
       fi                                  &&
       devoke_installwatch                 &&
       destroy_stage_root                  &&
@@ -196,19 +190,15 @@
 
 
 #---------------------------------------------------------------------
-## Turns all the various logs back on that were turned off from after
-## run_pre_install finished, then runs INSTALL or default_install
+## load persistent vars, then runs INSTALL or default_install
 ## Along with other stuff that needs to be transplanted elsewhere.
+## NOTE: this function is run from delve so installwatch can be invoked
+## around an execed bash shell, this is needed for installwatch to
+## stage root properly
 #---------------------------------------------------------------------
 function run_install() {
   debug "build_api/api2" "Starting run_install()"
   
-  invoke_installwatch &&
-  rm -f $IW_LOG &&
-  if [[ "$STAGED_INSTALL" != "off" ]]
-  then
-    invoke_stage_root
-  fi &&
   persistent_load &&
   if  [  -x  $SCRIPT_DIRECTORY/INSTALL  ];  then
     .  $SCRIPT_DIRECTORY/INSTALL 
@@ -226,25 +216,19 @@
              "${DEFAULT_COLOR}"
     false
   fi
-  if [[ "$STAGED_INSTALL" != "off" ]]
-  then
-    devoke_stage_root
-  fi &&
-  devoke_installwatch 
 }
 
 #---------------------------------------------------------------------
 ## Checks for a POST_BUILD file in SCRIPT_DIRECTORY, and if it is
 ## executable, runs it. This file is run after INSTALL and before
-## FINAL. Its purpose is to bookend INSTALL and shutoff installwatch.
+## FINAL. Its purpose is to manipulate the installed files in the stage
+## root and install other tracked files.
+## NOTE: this function is run from delve so installwatch can be invoked
+## around an execed bash shell, this is needed for installwatch to
+## stage root properly
 #---------------------------------------------------------------------
 function run_post_install() {
   debug "build_api/api2" "Starting run_post_install()"
-  invoke_installwatch &&
-  if [[ "$STAGED_INSTALL" != "off" ]]
-  then
-    invoke_stage_root
-  fi &&
   persistent_load &&
   if    [  -x  $SCRIPT_DIRECTORY/POST_INSTALL  ]; then
     cd $STAGE_DIRECTORY/TRANSL &&
@@ -256,12 +240,6 @@
     default_post_install
   fi &&
   persistent_save &&
-  if [[ "$STAGED_INSTALL" != "off" ]]
-  then
-    devoke_stage_root &&
-    install_staged_spell 
-  fi && 
-  devoke_installwatch                 &&
   unlock_resources "libgrimoire" "install"
 }
 

==== //sgl/sorcery/proj/proj1/var/lib/sorcery/modules/libresurrect#8 (xtext) ====

@@ -451,8 +451,8 @@
     return $?
   fi
 
-  # if the file does not exist, 
-  if ! test -e "$to"; then
+  # if the file does not exist, or stage root is invoked 
+  if ! test -e "$to" || [[ "$STAGED_INSTALL" != "off" ]] ; then
     # copy the new one in (plus leading directories)
     mkdir -p "$(dirname "$to")" &&
     cp -pv "$from" "$to"

==== //sgl/sorcery/proj/proj1/var/lib/sorcery/modules/libstage#17 (xtext) ====

@@ -89,23 +89,23 @@
 {
   local FILE=$1
   local PERMISSION=$(stat -c %a "${STAGE_DIRECTORY}/TRANSL/${FILE}")
-  local SAVE=$(dirname $FILE)/.$(basename $FILE).$(date +%Y%m%d%H%M%S)
+  local SAVE=$CONFIG_STAGE_DIRECTORY/$FILE.$(date +%Y%m%d%H%M%S)
   message "${FILE_COLOR}$PERMISSION $FILE${DEFAULT_COLOR}"
   case $2 in
     config)
       if [[ -e ${INSTALL_ROOT}/$FILE ]]
       then
-        cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$SAVE
-	message "${MESSAGE_COLOR}Staging config file removing executable permissions${DEFAULT_COLOR}"
-	chmod -x ${INSTALL_ROOT}/$SAVE
+        touch ${INSTALL_ROOT}/$FILE &&
+        mkdir -p $(dirname $SAVE) &&
+        cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$SAVE &&
 	rm $STAGE_DIRECTORY/TRANSL/$FILE
       else
-        cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$FILE
+        cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$FILE &&
 	rm $STAGE_DIRECTORY/TRANSL/$FILE
       fi
       ;;
     *)
-      cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$FILE
+      cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$FILE &&
       rm $STAGE_DIRECTORY/TRANSL/$FILE
       ;;
   esac

==== //sgl/sorcery/proj/proj1/var/lib/sorcery/modules/libtrack#28 (xtext) ====

@@ -99,7 +99,7 @@
     export  INSTW_TRANSL=0
     export  INSTW_BACKUP=0
     export  INSTW_DBGLVL=0
-    export  INSTW_EXCLUDE="/dev,/proc,/tmp,/var/tmp,/sys,${BUILD_DIRECTORY},${INSTALL_ROOT}/${BUILD_DIRECTORY}"    
+    export  INSTW_EXCLUDE="$INSTALLWATCH_UNSTAGED_PATHS"
     export  LD_PRELOAD=/usr/lib/installwatch.so
   fi
 }



More information about the SM-Commit mailing list