Check-in [58a1e67dd2]
Not logged in

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

Overview

SHA1 Hash:58a1e67dd2b29a74b53026a4c6c4fcf0d8495f89
Date: 2012-01-02 12:17:07
User: BarryK
Comment:ppm install pkg with symlink-to-directory fixed

Tags And Properties
Changes

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

@@ -21,10 +21,11 @@
 #110817 rcrsn51: fix find syntax, looking for icons. 110821 improve.
 #111013 shinobar: aufs direct-write to layer not working, bypass for now.
 #111013 revert above. it works for me, except if file already on top -- that is another problem, needs to be addressed.
 #111207 improve search for menu icon.
 #111229 /usr/local/petget/removepreview.sh when uninstalling a pkg, may have copied a file from sfs-layer to top, check.
+#120102 install may have overwritten a symlink-to-dir.
 
 #information from 'labrador', to expand a .pet directly to '/':
 #NAME="a52dec-0.7.4"
 #pet2tgz "${NAME}.pet"
 #tar -C / --transform 's/^\(\.\/\)\?'"$NAME"'//g' -zxf "${NAME}.tar.gz"
@@ -51,11 +52,11 @@
   [ -s "$FILELIST" ] || retuen 0
   grep -q '^/mnt' "$FILELIST" || return 0
   MNTDIRS=$(cat "$FILELIST" | grep '^/mnt/.*/$' | cut -d'/' -f1-3  | tail -n 1)
   LANG=$LANG_USER
   MSG1=$(gettext "This package will install files under")
-  MSG2=$(gettext "It can be dangerous to install files under '/mnt' because it depends on the profile of instalation.")
+  MSG2=$(gettext "It can be dangerous to install files under '/mnt' because it depends on the profile of installation.")
   MSG3=""
   if grep -q '^/mnt/home' "$FILELIST"; then
     if [ $PUPMODE -eq 5 ]; then
       MSG3=$(gettext "You are running Puppy without 'pupsave', and '/mnt/home' does not exists. In this case, you can use the RAM for this space, but strongly recommended to shutdown now to create 'pupsave' BEFORE installing these packages.")
       MSG3="$MSG3\\n$(gettext "NOTE: You can install this package for a tentative use, then do NOT make 'pupsave' with this package installed.")"
@@ -107,11 +108,11 @@
   #note that /sbin/pup_event_frontend_d will not run snapmergepuppy if installpkg.sh or downloadpkgs.sh are running.
   #if snapmergepuppy is running, wait until it has finished...
   while [ "`pidof snapmergepuppy`" != "" ];do
    sleep 1
   done
-  DIRECTSAVEPATH="/initrd${SAVE_LAYER}"
+  DIRECTSAVEPATH="/initrd${SAVE_LAYER}" #SAVE_LAYER is in /etc/rc.d/PUPSTATE.
   rm -f $DIRECTSAVEPATH/pet.specs $DIRECTSAVEPATH/pinstall.sh $DIRECTSAVEPATH/puninstall.sh $DIRECTSAVEPATH/install/doinst.sh
  fi
 fi
 #fi #111013
 
@@ -128,17 +129,17 @@
   if [ "`echo "$PETFILES" | grep '^\\./'`" != "" ];then
    #ttuuxx has created some pets with './' prefix...
    pPATTERN="s%^\\./${DLPKG_NAME}%%"
    echo "$PETFILES" | sed -e "$pPATTERN" > /root/.packages/${DLPKG_NAME}.files
    install_path_check
-   tar -z -x --strip=2 --directory=${DIRECTSAVEPATH}/ -f ${DLPKG_MAIN}.tar.gz
+   tar -z -x --unlink-first --strip=2 --directory=${DIRECTSAVEPATH}/ -f ${DLPKG_MAIN}.tar.gz #120102
   else
    #new2dir and tgz2pet creates them this way...
    pPATTERN="s%^${DLPKG_NAME}%%"
    echo "$PETFILES" | sed -e "$pPATTERN" > /root/.packages/${DLPKG_NAME}.files
    install_path_check
-   tar -z -x --strip=1 --directory=${DIRECTSAVEPATH}/ -f ${DLPKG_MAIN}.tar.gz
+   tar -z -x --unlink-first --strip=1 --directory=${DIRECTSAVEPATH}/ -f ${DLPKG_MAIN}.tar.gz #120102
   fi
  ;;
  *.deb)
   DLPKG_MAIN="`basename $DLPKG_BASE .deb`"
   PFILES="`dpkg-deb --contents $DLPKG_BASE | tr -s ' ' | cut -f 6 -d ' '`"
@@ -158,11 +159,11 @@
   PFILES="`tar --list -z -f $DLPKG_BASE`"
   #hmmm, got a case where passed the above test but failed here...
   [ $? -ne 0 ] && exit 1
   echo "$PFILES" > /root/.packages/${DLPKG_NAME}.files
   install_path_check
-  tar -z -x --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE
+  tar -z -x --unlink-first --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE #120102
  ;;
  *.txz) #100616
   DLPKG_MAIN="`basename $DLPKG_BASE .txz`" #ex: scite-1.77-i686-2as
   xz --test $DLPKG_BASE > /dev/null 2>&1
   [ $? -ne 0 ] && exit 1
@@ -169,31 +170,31 @@
   PFILES="`tar --list -J -f $DLPKG_BASE`"
   #hmmm, got a case where passed the above test but failed here...
   [ $? -ne 0 ] && exit 1
   echo "$PFILES" > /root/.packages/${DLPKG_NAME}.files
   install_path_check
-  tar -J -x --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE
+  tar -J -x --unlink-first --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE #120102
  ;;
  *.tar.gz)
   DLPKG_MAIN="`basename $DLPKG_BASE .tar.gz`" #ex: acl-2.2.47-1-i686.pkg
   gzip --test $DLPKG_BASE > /dev/null 2>&1
   [ $? -ne 0 ] && exit 1
   PFILES="`tar --list -z -f $DLPKG_BASE`"
   [ $? -ne 0 ] && exit 1
   echo "$PFILES" > /root/.packages/${DLPKG_NAME}.files
   install_path_check
-  tar -z -x --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE
+  tar -z -x --unlink-first --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE #120102
  ;;
  *.tar.bz2) #100110
   DLPKG_MAIN="`basename $DLPKG_BASE .tar.bz2`"
   bzip2 --test $DLPKG_BASE > /dev/null 2>&1
   [ $? -ne 0 ] && exit 1
   PFILES="`tar --list -j -f $DLPKG_BASE`"
   [ $? -ne 0 ] && exit 1
   echo "$PFILES" > /root/.packages/${DLPKG_NAME}.files
   install_path_check
-  tar -j -x --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE
+  tar -j -x --unlink-first --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE #120102
  ;;
  *.rpm) #110523
   DLPKG_MAIN="`basename $DLPKG_BASE .rpm`"
   busybox rpm -qp $DLPKG_BASE > /dev/null 2>&1
   [ $? -ne 0 ] && exit 1
@@ -211,10 +212,49 @@
 rm -f $DLPKG_MAIN.tar.gz 2>/dev/null
 
 #pkgname.files may need to be fixed...
 FIXEDFILES="`cat /root/.packages/${DLPKG_NAME}.files | grep -v '^\\./$'| grep -v '^/$' | sed -e 's%^\\.%%' -e 's%^%/%' -e 's%^//%/%'`"
 echo "$FIXEDFILES" > /root/.packages/${DLPKG_NAME}.files
+
+#120102 install may have overwritten a symlink-to-dir...
+#tar defaults to not following symlinks, for both dirs and files, but i want to follow symlinks
+#for dirs but not for files. so, fix here... (note, dir entries in .files have / on end)
+cat /root/.packages/${DLPKG_NAME}.files | grep '[a-zA-Z0-9]/$' | sed -e 's%/$%%' | grep -v '^/mnt' |
+while read ONESPEC
+do
+ if [ -d "${DIRECTSAVEPATH}${ONESPEC}" ];then
+  if [ ! -h "${DIRECTSAVEPATH}${ONESPEC}" ];then
+   DIRLINK=""
+   if [ -h /initrd${PUP_LAYER}${ONESPEC} ];then
+    DIRLINK="`readlink -m /initrd${PUP_LAYER}${ONESPEC} | sed -e "s%/initrd${PUP_LAYER}%%"`" #PUP_LAYER: see /etc/rc.d/PUPSTATE
+    xDIRLINK="`readlink /initrd${PUP_LAYER}${ONESPEC}`"
+   fi
+   if [ ! "$DIRLINK" ];then
+    if [ -h /initrd${SAVE_LAYER}${ONESPEC} ];then
+     DIRLINK="`readlink -m /initrd${SAVE_LAYER}${ONESPEC} | sed -e "s%/initrd${SAVE_LAYER}%%"`" #SAVE_LAYER: see /etc/rc.d/PUPSTATE
+     xDIRLINK="`readlink /initrd${SAVE_LAYER}${ONESPEC}`"
+    fi
+   fi
+   if [ "$DIRLINK" ];then
+    if [ -d "$DIRLINK"  ];then
+     if [ "$DIRLINK" != "${ONESPEC}" ];then #precaution.
+      mkdir -p ${DIRECTSAVEPATH}${DIRLINK}
+      cp -a -f --remove-destination ${DIRECTSAVEPATH}"${ONESPEC}"/* "${DIRECTSAVEPATH}${DIRLINK}/" #ha! fails if put double-quotes around entire expression.
+      rm -rf "${DIRECTSAVEPATH}${ONESPEC}"
+      if [ "$DIRECTSAVEPATH" = "" ];then
+       ln -s "$xDIRLINK" "${ONESPEC}"
+      else
+       DSOPATH="`dirname "${DIRECTSAVEPATH}${ONESPEC}"`"
+       DSOBASE="`basename "${DIRECTSAVEPATH}${ONESPEC}"`"
+       rm -f "${DSOPATH}/.wh.${DSOBASE}" #allow underlying symlink to become visible on top.
+      fi
+     fi
+    fi
+   fi
+  fi
+ fi
+done
 
 #flush unionfs cache, so files in pup_save layer will appear "on top"...
 if [ "$DIRECTSAVEPATH" != "" ];then
  #but first, clean out any bad whiteout files...
  # 22sep10 shinobar: bugfix was not working clean out whiteout files
@@ -297,12 +337,12 @@
 echo DB_ENTRY=$DB_ENTRY
 ##+++2011-12-27 KRG check if $DLPKG_BASE matches DB_ENTRY 1 so uninstallation works :Ooops:
 db_pkg_name=`echo "$DB_ENTRY" |cut -f 1 -d '|'`
 echo db_pkg_name=$db_pkg_name
 if [ "$db_pkg_name" != "$DLPKG_NAME" ];then
-echo not equal sed ing now
-DB_ENTRY=`echo "$DB_ENTRY" |sed "s#$db_pkg_name#$DLPKG_NAME#"`
+ echo not equal sed ing now
+ DB_ENTRY=`echo "$DB_ENTRY" |sed "s#$db_pkg_name#$DLPKG_NAME#"`
 fi
 ##+++2011-12-27 KRG
 
 #see if a .desktop file was installed, fix category...
 ONEDOT=""

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

@@ -88,21 +88,21 @@
   if [ -d "$ONESPEC" ];then
    [ "`ls -1 $ONESPEC`" = "" ] && rmdir $ONESPEC 2>/dev/null
   fi
  done
  ###+++2011-12-27 KRG
- else
+else
  firstchar=`echo ${DB_pkgname} | cut -c 1`
  possiblePKGS=`find /root/.packages -type f -iname "$firstchar*.files"`
  possible5=`echo "$possiblePKGS" | head -n5`
  count=`echo "$possiblePKGS" | wc -l`
  [ ! "$count" ] && count=0
  [ ! "$possiblePKGS" ] && possiblePKGS="No pkgs beginning with $firstchar found"
  if [ "$count" -le '5' ];then
- WARNMSG="$possiblePKGS"
+  WARNMSG="$possiblePKGS"
  else
- WARNMSG="Found more than 5 pkgs starting with $firstchar .
+  WARNMSG="Found more than 5 pkgs starting with $firstchar .
 The first 5 are
 $possible5"
  fi
  xmessage -bg red "WARNING :
 No file named ${DB_pkgname}.files found in

Changes to woof-distro/x86/Packages-puppy-common-official

@@ -160,11 +160,11 @@
 inkscapelite-0.36.3-no_gnomeprint-q1|inkscapelite|0.36.3-no_gnomeprint-q1||Graphic|1776K||inkscapelite-0.36.3-no_gnomeprint-q1.pet|+gtk+|InkLite vector editor|t2|8.0rc||
 inotail-0.5|inotail|0.5||BuildingBlock|16K||inotail-0.5.pet||tail utility uses inotify, essential|puppy|4||
 installwatch-0.6.3|installwatch|0.6.3||BuildingBlock|14K||installwatch-0.6.3.pet||essential, used by petget|puppy|4||
 isomaster-1.3.6-q1|isomaster|1.3.6-q1||Multimedia|224K||isomaster-1.3.6-q1.pet|+gtk+|ISOMaster iso file editor|t2|8.0rc||
 jimtcl-0.70|jimtcl|0.70||BuildingBlock|152K||jimtcl-0.70.pet||tiny Tcl interpreter, compiled in wary should work all puppies. note, used by usb-modeswitch||||
-jwm2-505-1-w5c|jwm2|505-1-w5c||Desktop|220K||jwm2-505-1-w5c.pet|+fribidi|joes window manager and tray, compiled in wary 5.2 but should run anywhere|puppy|wary5||
+jwm2-562-w5c|jwm2|562-w5c||Desktop|224K||jwm2-562-w5c.pet|+fribidi|joes window manager and tray, compiled in wary 5.2 but should run anywhere|puppy|wary5||
 jwmconfig2-20111110|jwmconfig2|20111110||Desktop|256K||jwmconfig2-20111110.pet|+jwm2,+gtkdialog3|JWM configuration. note, theme font spec different from shinobars pet. note, designed to work with jwm 500+||||
 jwm_theme_bluevariety-1|jwm_theme_bluevariety|1||Desktop|32K||jwm_theme_bluevariety-1.pet|+jwm2|jwm window manager theme, many shades and gradients of blue||||
 jwm_theme_deepbluebold-1|jwm_theme_deepbluebold|1||Desktop|36K||jwm_theme_deepbluebold-1.pet|+jwm2|Theme for JWM window manager, deep blue, white bold text||||
 jwmthememaker-1.5|jwmthememaker|1.5||Desktop|36K||jwmthememaker-1.5.pet||JWM Theme Maker|ubuntu|lucid||
 jwm_theme_stark-1|jwm_theme_stark|1||Desktop|36K||jwm_theme_stark-1.pet|+jwm2|stark black-white with bits of colour theme for jwm window manager||||