Check-in [a94d3c19f4]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:a94d3c19f48c7af13f44d6348515861682ef9105
Date: 2012-01-03 06:56:29
User: BarryK
Comment:tweaks for removepreview.sh, snapmergepuppy, rc.shutdown -- shinobar, rerwin, karl godt

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/etc/rc.d/rc.shutdown

@@ -56,11 +56,11 @@
 #110923 L18L: i18n conversion. please see /usr/share/doc/nls/shutdownconfig
 #110928 fixed, reboots when choose shutdown. very old bug, dates back to 2009.
 #110928 modified i18n conversion, only for echo to /dev/console.
 #111106 do not execute fuser if network share mount.
 #111107 ldolse: unmount network shares before taking down the network
-#120103 karl godt: error unmounting stray partitions.
+#120103 karl godt: error unmounting stray partitions. 120103 karl godt: more tweaks.
 
 #110923
 . /usr/bin/gettext.sh # enables use of eval_gettext (several named variables) and ngettext (plurals)
 export TEXTDOMAIN=rc.shutdown
 export OUTPUT_CHARSET=UTF-8
@@ -117,11 +117,12 @@
 #for a full hd install, only setting PUPMODE (=2). no /initrd, no initrd.gz.
 
 . /etc/rc.d/functions4puppy #v3.01
 
 killzombies() {
- ZOMBIES="`ps -H -A | grep '<defunct>' | sed -e 's/  /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
+ #ZOMBIES="`ps -H -A | grep '<defunct>' | sed -e 's/  /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
+ ZOMBIES="`ps -H -A | grep '<defunct>' | sed 's/^[[:blank:]]*//g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`" #120103 karl godt: because i was getting a bunch of "killall no such process must be either pid or name" on the screen by the killzombies function.
  for ONEZOMBIE in $ZOMBIES
  do
   #echo "`eval_gettext \"Killing parentless zombie process \\\${ONEZOMBIE}\"`"
   echo "Killing parentless zombie process $ONEZOMBIE"
   kill $ONEZOMBIE
@@ -522,13 +523,13 @@
 for ONESTRAY in $STRAYPARTandMNT
 do
  FLAGCIFS="`echo -n ${ONESTRAY} | grep '^//'`"
  ONESTRAYMNT="`echo -n ${ONESTRAY} | cut -f 2 -d '|'`"
  #echo "`eval_gettext \"Unmounting \\\${ONESTRAY}...\"`"
- echo "Unmounting $ONESTRAY..."
+ echo "Unmounting $ONESTRAYMNT..."
  if [ "$FLAGCIFS" = "" ];then
-  xFUSER="`fuser -m $ONESTRAY 2>/dev/null`"
+  xFUSER="`fuser -m $ONESTRAYMNT 2>/dev/null`"
   [ "$xFUSER" != "" ] && fuser -k -m $ONESTRAYMNT 2>/dev/null
  fi
  killzombies #v3.99
  sync
  umount -r $ONESTRAYMNT #120103 karl godt.

Changes to woof-code/rootfs-skeleton/usr/local/petget/removepreview.sh

@@ -12,10 +12,11 @@
 #v424 need info box if user has clicked when no pkgs installed.
 #110211 shinobar: was the dependency logic inverted.
 #110706 update menu if .desktop file exists.
 #111228 if snapmergepuppy running, wait for it to complete.
 #120101 01micko: jwm >=547 has -reload, no screen flicker.
+#120103 shinobar, bk: improve file deletion when older file in lower layer.
 
 . /etc/rc.d/PUPSTATE  #111228 this has PUPMODE and SAVE_LAYER.
 . /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
 . /root/.packages/DISTRO_PKGS_SPECS
 
@@ -65,24 +66,39 @@
    sleep 1
   done
 fi
 
 if [ -f /root/.packages/${DB_pkgname}.files ];then
- cat /root/.packages/${DB_pkgname}.files |
- while read ONESPEC
- do
-  if [ ! -d "$ONESPEC" ];then
-   if [ -e "/initrd/pup_ro2$ONESPEC" ];then
-    #the problem is, deleting the file on the top layer places a ".wh" whiteout file,
-    #that hides the original file. what we want is to remove the installed file, and
-    #restore the original pristine file...
-    cp -a --remove-destination "/initrd/pup_ro2$ONESPEC" "$ONESPEC"
-   else
-    rm -f "$ONESPEC"
+ if [ "$PUP_LAYER" = '/pup_ro2' ]; then #120103 shinobar.
+  cat /root/.packages/${DB_pkgname}.files |
+  while read ONESPEC
+  do
+   if [ ! -d "$ONESPEC" ];then
+    #if [ -e "/initrd/pup_ro2$ONESPEC" ];then
+    #120103 shinobar: better way of doing this, look all lower layers...
+    S=$(ls /initrd/pup_ro{?,??}"$ONESPEC" 2>/dev/null| grep -v '^/initrd/pup_ro1/'| head -n 1)	# pup_ro2 - pup_ro99
+    if [ "$S" ]; then
+     #the problem is, deleting the file on the top layer places a ".wh" whiteout file,
+     #that hides the original file. what we want is to remove the installed file, and
+     #restore the original pristine file...
+     #cp -a --remove-destination "/initrd/pup_ro2$ONESPEC" "$ONESPEC"
+     cp -a --remove-destination "$S" "$ONESPEC" #120103 shinobar.
+     #120103 apparently for odd# PUPMODEs, save layer may have a lurking old file and/or whiteout...
+     if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then
+      [ -f "/initrd${SAVE_LAYER}${ONESPEC}" ] && rm -f "/initrd${SAVE_LAYER}${ONESPEC}" #normally /pup_ro1
+      BN="`basename "$ONESPEC"`"
+      DN="`dirname "$ONESPEC"`"
+      [ -f "/initrd${SAVE_LAYER}${DN}/.wh.${BN}" ] && rm -f "/initrd${SAVE_LAYER}${DN}/.wh.${BN}"
+     fi
+    else
+     rm -f "$ONESPEC"
+    fi
    fi
-  fi
- done
+  done
+ else #120103 shinobar: PUPMODE=2
+  cat /root/.packages/${DB_pkgname}.files | grep -v '/$' | xargs rm -f #/ on end, it is a directory entry.
+ fi
  #do it again, looking for empty directories...
  cat /root/.packages/${DB_pkgname}.files |
  while read ONESPEC
  do
   if [ -d "$ONESPEC" ];then

Changes to woof-code/rootfs-skeleton/usr/sbin/snapmergepuppy

@@ -25,10 +25,11 @@
 #110212 Jemimah: files may disappear, more efficient calc of free space, fix i/o err.
 #110222 shinobar: remove all /dev, allow 'pup_ro10-19', exit code for no space
 #110224 BK: revert remove all /dev, for now. 110503 added dev/snd
 #110505 support sudo for non-root user.
 #111229 rerwin: fix jemimah code (110212).
+#120103 rerwin: screen out /.XLOADED when save.
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
 
 export LANG=C #110206 Dougal: I **think** this should not cause problems with filenames
 
@@ -128,12 +129,12 @@
 touch /etc/rc.d/BOOTCONFIG
 FREEBASEK=`df -k | grep -w "$BASE"| head -n 1 | tr -s ' ' | cut -f 4 -d ' '` #110212 Jemimah #110222 shinobar
 rm -f /tmp/snapmergepuppy-nospace #110222 shinobar
 #Copy Files... v409 remove '^var'. w003 screen out some /dev files. 100222 shinobar: more exclusions. 100422 added ^root/ftpd. 100429 modify 'trash' exclusion. 100820 added var/tmp #110222 shinobar: remove all /dev
 #find . -mount -not \( -regex '.*/\.wh\.[^/]*' -type f \) -not -type d |  sed -e 's/\.\///' | grep -v -E '^mnt|^initrd|^proc|^sys|^tmp|^pup_|^zdrv_|^root/tmp|_zdrv_|^dev/|^\.wh\.|^var/run|^root/ftpd|^var/tmp' | grep -v -E -i '\.thumbnails|\.trash|trash/|\.part$'  |
-#110224 BK: revert, leave save of /dev in for now...
-find . -mount -not \( -regex '.*/\.wh\.[^/]*' -type f \) -not -type d |  sed -e 's/\.\///' | grep -v -E '^mnt|^initrd|^proc|^sys|^tmp|^pup_|^zdrv_|^root/tmp|_zdrv_|^dev/\.|^dev/fd|^dev/pts|^dev/shm|^\.wh\.|^var/run|^root/ftpd|^var/tmp' | grep -v -E -i '\.thumbnails|\.trash|trash/|\.part$'  |
+#110224 BK: revert, leave save of /dev in for now... 120103 rerwin: add .XLOADED
+find . -mount -not \( -regex '.*/\.wh\.[^/]*' -type f \) -not -type d |  sed -e 's/\.\///' | grep -v -E '^mnt|^initrd|^proc|^sys|^tmp|^pup_|^zdrv_|^root/tmp|_zdrv_|^dev/\.|^dev/fd|^dev/pts|^dev/shm|^\.wh\.|^var/run|^root/ftpd|^var/tmp|\.XLOADED$' | grep -v -E -i '\.thumbnails|\.trash|trash/|\.part$'  |
 while read N
 do
 
  #v4.01 graceful exit if shutdown X (see /usr/X11R7/bin/restartwm,wmreboot,wmpoweroff)...
  [ "$XRUNNING" = "yes" ] && [ -f /tmp/wmexitmode.txt ] && exit