Check-in [625e796717]
Not logged in

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

Overview

SHA1 Hash:625e796717186ffad3971a3ac339310a677d86d4
Date: 2012-03-09 23:11:05
User: BarryK
Comment:npierce: some grep operations were wrong in puppyinstaller, if have more than 9 partitions

Tags And Properties
Changes

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

@@ -42,10 +42,11 @@
 #110505 support sudo for non-root user.
 #110814 convert script from gtkdialog2 to gtkdialog3+.
 #111011 bump to gtkdialog4. small fixes.
 #120126 jemimah: clear SELECTIONS variable, add ntfs exclusion.
 #120202 rodin.s: internationalized
+#120310 npierce: fix some grep operations.
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
 
 export TEXTDOMAIN=puppyinstaller
 export OUTPUT_CHARSET=UTF-8
@@ -700,18 +701,18 @@
   #exit
 
  fi
 else
   DESTPART="`echo "$RETTXT" | grep '^EXIT' | cut -f 2 -d '"'`" #'geany
- DESTFS="`echo "$DRVMSG" | grep "$DESTPART" | cut -f 1 -d ',' | tr -s " " | cut -f 2 -d " "`"
- DESTSIZE="`echo "$DRVMSG" | grep "$DESTPART" | tr -s " " | cut -f 4-5 -d " "`"
+ DESTFS="`echo "$DRVMSG" | grep "${DESTPART}:" | cut -f 1 -d ',' | tr -s " " | cut -f 2 -d " "`" #120310
+ DESTSIZE="`echo "$DRVMSG" | grep "${DESTPART}:" | tr -s " " | cut -f 4-5 -d " "`" #120310
  DESTSIZM="`echo -n "$DESTSIZE" | cut -f 1 -d " "`"
  if [ ! "`echo "$DESTSIZE" | grep "GiB"`" = "" ];then
   DESTSIZM="`LANG=C; dc $DESTSIZM 1000 \* p`" #LANG=C; rodin.s for i18n
  fi
  IDESTSIZM="`echo -n "$DESTSIZM" | cut -f 1 -d '.'`" #truncate to integer.
- DESTVER="`echo "$DRVMSG" | grep "$DESTPART" | tr -s " " | grep "installed" | cut -f 8 -d " "`"
+ DESTVER="`echo "$DRVMSG" | grep "${DESTPART}:" | tr -s " " | grep "installed" | cut -f 8 -d " "`" #120310
 fi
 
 break
 done #BIG LOOP
 ###########END BIG LOOP###############
@@ -1140,15 +1141,16 @@
  scsihd|atahd|idehd|satahd) #internal media, boot with boot-disk or grub. #v3.98
   #arrive here with DESTPART & DESTFS where installing to, PMEDIA boot param FINALPMEDIA,
   #SRCPATH where to get vmlinuz, initrd, ${DISTRO_PUPPYSFS}, PUPVEROLD is old puppy version in
   #format 200 (without dots) =0 if no prior installed puppy,
   #NEWVER is new puppy version, DESTSIZM is size of dest partition in Mb (real number),
-  DESTMNTPT="`mount | grep "/dev/$DESTPART" | tr -s " " | cut -f 3 -d " "`"
+  DESTMNTPT="`mount | grep "/dev/${DESTPART} " | tr -s " " | cut -f 3 -d " "`" #120310
   #v2.02 ntfs-3g needs this...
   #[ "$DESTMNTPT" = "" ] && DESTMNTPT="`ps -e | grep -o ntfs\-3g.* | grep "/dev/$DESTPART" | sed -e 's/[^a-zA-Z0-9/._\-]/ /g' | tr -s ' ' | tr ' ' "\n" | grep '^/mnt/'`"
 
-   [ "$DESTMNTPT" = "" ] && DESTMNTPT="`ps -e | grep -o 'ntfs\-3g.*' | grep "/dev/$DESTPART" | tr '\t' ' ' | tr -s ' ' | tr ' ' "\n" | grep '^/mnt/'`"
+  #120310 er, i think this only needed for older version of ntfs-3g. harmless with latest ntfs-3g...
+  [ "$DESTMNTPT" = "" ] && DESTMNTPT="`ps -e | grep -o 'ntfs\-3g.*' | grep "/dev/${DESTPART} " | tr '\t' ' ' | tr -s ' ' | tr ' ' "\n" | grep '^/mnt/'`" #120310
 
   if [ "$DESTMNTPT" = "" ];then
    mkdir /mnt/$DESTPART 2> /dev/null
    mount -t $DESTFS /dev/$DESTPART /mnt/$DESTPART
    DESTMNTPT="/mnt/$DESTPART"