Check-in [ca4552d46d]
Not logged in

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

Overview

SHA1 Hash:ca4552d46da1f4f10eb48d88a3a2ff450d13407d
Date: 2011-12-31 10:22:19
User: BarryK
Comment:karl godt fix if pet pkg name wrong, see murga-linux.com/puppy/viewtopic.php?t=74647

Tags And Properties
Changes

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

@@ -290,10 +290,21 @@
 else
  [ -f /pet.specs ] && rm -f /pet.specs #w482 remove zero-byte file.
  dlPATTERN='|'"`echo -n "$DLPKG_BASE" | sed -e 's%\\-%\\\\-%'`"'|'
  DB_ENTRY="`cat /tmp/petget_missing_dbentries-Packages-* | grep "$dlPATTERN" | head -n 1`"
 fi
+echo DLPKG_BASE=$DLPKG_BASE
+echo DLPKG_NAME=$DLPKG_NAME
+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#"`
+fi
+##+++2011-12-27 KRG
 
 #see if a .desktop file was installed, fix category...
 ONEDOT=""
 DEFICON='Executable.xpm'
 CATEGORY="`echo -n "$DB_ENTRY" | cut -f 5 -d '|'`"

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

@@ -19,11 +19,12 @@
 . /root/.packages/DISTRO_PKGS_SPECS
 
 DB_pkgname="$TREE2"
 
 #v424 info box, nothing yet installed...
-if [ "$DB_pkgname" = "" ];then
+#if [ "$DB_pkgname" = "" ];then
+if [ "$DB_pkgname" = "" -a "`cat /root/.packages/user-installed-packages`" = "" ];then #fix for ziggi
  export REM_DIALOG="<window title=\"Puppy Package Manager\" icon-name=\"gtk-about\">
   <vbox>
    <pixmap><input file>/usr/local/lib/X11/pixmaps/error.xpm</input></pixmap>
    <text><label>There are no user-installed packages yet, so nothing to uninstall!</label></text>
    <hbox>
@@ -31,12 +32,15 @@
    </hbox>
   </vbox>
  </window>
 "
  [ "$DISPLAY" != "" ] && gtkdialog3 --program=REM_DIALOG
- exit
+ exit 0
 fi
+if [ "$DB_pkgname" = "" ];then #fix for ziggi moved here problem is  #2011-12-27 KRG
+exit 0                         #clicking an empty line in the gui would have
+fi                             #thrown the above REM_DIALOG even if pkgs are installed
 
 export REM_DIALOG="<window title=\"Puppy Package Manager\" icon-name=\"gtk-about\">
   <vbox>
    <pixmap><input file>/usr/local/lib/X11/pixmaps/question.xpm</input></pixmap>
    <text><label>Click 'OK' button to confirm that you wish to uninstall package '$DB_pkgname'</label></text>
@@ -48,11 +52,11 @@
  </window>
 "
 if [ "$DISPLAY" != "" ];then
  RETPARAMS="`gtkdialog3 --program=REM_DIALOG`"
  eval "$RETPARAMS"
- [ "$EXIT" != "OK" ] && exit
+ [ "$EXIT" != "OK" ] && exit 0
 fi
 
 #111228 if snapmergepuppy running, wait for it to complete (see also /usr/local/petget/installpkg.sh)...
 #note, inverse true, /sbin/pup_event_frontend_d will not run snapmergepuppy if removepreview.sh running.
 if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then
@@ -82,10 +86,43 @@
  do
   if [ -d "$ONESPEC" ];then
    [ "`ls -1 $ONESPEC`" = "" ] && rmdir $ONESPEC 2>/dev/null
   fi
  done
+ ###+++2011-12-27 KRG
+ 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"
+ else
+ 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
+/root/.packages/ folder .
+
+$0
+refusing cowardly to remove the package .
+
+Possible suggestions are
+$WARNMSG
+
+Possible solution :
+Edit /root/.packages/user-installed-packages to match the pkgname
+and start again .
+"
+ rox /root/.packages
+ geany /root/.packages/user-installed-packages
+ exit 101
+ ###+++2011-12-27 KRG
 fi
 
 #fix menu...
 #master help index has to be updated...
 ##to speed things up, find the help files in the new pkg only...
@@ -158,7 +195,12 @@
  </window>
 "
 if [ "$DISPLAY" != "" ];then
  gtkdialog3 --program=REM_DIALOG
 fi
-
+###+++2011-12-27 KRG
+#emitting exitcode for some windowmanager depending on dbus
+#popup a message window saying the program stopped unexpectedly
+#ie (old) enlightenment
+exit 0
+###+++2011-12-27 KRG
 ###END###