Check-in [2a4a298b7e]
Not logged in

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

Overview

SHA1 Hash:2a4a298b7eb95b9d1a0b89879b6a6541f9366bac
Date: 2012-05-04 11:13:57
User: BarryK
Comment:ppm: implemented searching of multiple repositories

Tags And Properties
Changes

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

@@ -1,10 +1,10 @@
 #!/bin/sh
 #called from /usr/local/petget/installpreview.sh
 #/tmp/petget_installpreview_pkgname (writen in installpreview.sh) has name of package being
 #  previewed prior to installation. ex: abiword-1.2.3
-#/tmp/petget_filterversion has the repository that installing from (written in pkgchooser.sh).
+#/tmp/petget/current-repo-triad has the repository that installing from (written in pkgchooser.sh).
 #  ex: slackware-12.2-slacky
 #  ...full package database file is /root/.packages/Packages-slackware-12.2-slacky
 #/tmp/petget_missingpkgs_patterns (written in findmissingpkgs.sh) has a list of missing dependencies, format ex:
 #  |kdebase|
 #  |kdelibs|
@@ -54,11 +54,11 @@
 ALLINSTALLEDPKGS="`cat /tmp/petget_installed_patterns_all`"
 TREE1="`cat /tmp/petget_installpreview_pkgname`"
 
 
 #this is the db of the main pkg...
-DB_MAIN="${PREPATH}Packages-`cat /tmp/petget_filterversion`" #ex: Packages-slackware-12.2-official 110723
+DB_MAIN="${PREPATH}Packages-`cat /tmp/petget/current-repo-triad`" #ex: Packages-slackware-12.2-official 110723
 if [ "$RUNNINGWOOF" = "no" ];then
  #...should have first preference when looking for dependencies...
  DB_OTHERS="`ls -1 ${PREPATH}Packages-* | grep -v "$DB_MAIN"`"
  #if DB_MAIN is puppy-4, puppy-3 or puppy-2, then only look in those...
  if [ "`echo "$DB_MAIN" | grep '\\-puppy\\-2'`" != "" ];then

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

@@ -1,9 +1,9 @@
 #!/bin/sh
 #called from installpreview.sh.
 #passed param (also variable TREE1) is name of pkg, ex: abiword-1.2.3.
-#/tmp/petget_filterversion has the repository that installing from.
+#/tmp/petget/current-repo-triad has the repository that installing from.
 #w019 now have /root/.packages/PKGS_HOMEPAGES
 #101221 yaf-splash fix.
 #110523 Scientific Linux docs.
 #120203 BK: internationalized.
 
@@ -12,11 +12,11 @@
 
 . /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
 . /root/.packages/DISTRO_PKGS_SPECS
 
 #ex: TREE1=abiword-1.2.4 (first field in database entry).
-DB_FILE=Packages-`cat /tmp/petget_filterversion` #ex: Packages-slackware-12.2-official
+DB_FILE=Packages-`cat /tmp/petget/current-repo-triad` #ex: Packages-slackware-12.2-official
 
 tPATTERN='^'"$TREE1"'|'
 DB_ENTRY="`grep "$tPATTERN" /root/.packages/$DB_FILE | head -n 1`"
 #line format: pkgname|nameonly|version|pkgrelease|category|size|path|fullfilename|dependencies|description|
 #optionally on the end: compileddistro|compiledrelease|repo| (fields 11,12,13)

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

@@ -3,19 +3,20 @@
 #2009 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html).
 #called from pkg_chooser.sh, provides filtered formatted list of uninstalled pkgs.
 # ...this has written to /tmp/petget_pkg_first_char, ex: 'mn'
 #filter category may be passed param to this script, ex: 'Document'
 # or, /tmp/petget_filtercategory was written by pkg_chooser.sh.
-#repo may be written to /tmp/petget_filterversion by pkg_chooser.sh, ex: slackware-12.2-official
+#repo may be written to /tmp/petget/current-repo-triad by pkg_chooser.sh, ex: slackware-12.2-official
 #/tmp/petget_pkg_name_aliases_patterns setup in pkg_chooser.sh, name aliases.
 #written for Woof, standardised package database format.
 #v425 'ALL' may take awhile, put up please wait msg.
 #100716 PKGS_MANAGEMENT file has new variable PKG_PET_THEN_BLACKLIST_COMPAT_KIDS.
 #101129 checkboxes for show EXE DEV DOC NLS.
 #101221 yaf-splash fix.
 #110530 ignore packages with different kernel version number, format -k2.6.32.28- in pkg name (also findnames.sh)...
 #120203 BK: internationalized.
+#120504 some files moved into /tmp/petget
 
 export TEXTDOMAIN=petget___filterpkgs.sh
 export OUTPUT_CHARSET=UTF-8
 
 #export LANG=C
@@ -35,15 +36,15 @@
  X1PID=$!
 fi
 
 #which repo...
 FIRST_DB="`ls -1 /root/.packages/Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}* | head -n 1 | rev | cut -f 1 -d '/' | rev | cut -f 2-4 -d '-'`"
-fltrVERSION="$FIRST_DB" #ex: slackware-12.2-official
+fltrREPO_TRIAD="$FIRST_DB" #ex: slackware-12.2-official
 #or, a selection was made in the main gui (pkg_chooser.sh)...
-[ -f /tmp/petget_filterversion ] && fltrVERSION="`cat /tmp/petget_filterversion`"
-
-REPO_FILE="`find /root/.packages -type f -name Packages-${fltrVERSION}* | head -n 1`"
+[ -f /tmp/petget/current-repo-triad ] && fltrREPO_TRIAD="`cat /tmp/petget/current-repo-triad`"
+
+REPO_FILE="`find /root/.packages -type f -name "Packages-${fltrREPO_TRIAD}*" | head -n 1`"
 
 #choose a category in the repo...
 #$1 exs: Document, Internet, Graphic, Setup, Desktop
 fltrCATEGORY="Desktop" #show Desktop category pkgs.
 if [ $1 ];then
@@ -60,22 +61,22 @@
 #each line: pkgname|nameonly|version|pkgrelease|category|size|path|fullfilename|dependencies|description|
 #optionally on the end: compileddistro|compiledrelease|repo| (fields 11,12,13)
 #filter the repo pkgs by first char and category, also extract certain fields...
 #w017 filter out all 'lib' pkgs, too many for gtkdialog (ubuntu/debian only)...
 #w460 filter out all 'language-' pkgs, too many (ubuntu/debian)...
-if [ ! -f /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrVERSION} ];then
+if [ ! -f /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrREPO_TRIAD} ];then
  if [ "$DISTRO_BINARY_COMPAT" = "ubuntu" -o "$DISTRO_BINARY_COMPAT" = "debian" ];then
   FLTRD_REPO="`printcols $REPO_FILE 1 2 3 5 10 6 9 | grep -v -E '^lib|^language\\-' | grep -i "^[${PKG_FIRST_CHAR}]" | grep "$categoryPATTERN" | sed -e 's%||$%|unknown|%'`"
  else
   FLTRD_REPO="`printcols $REPO_FILE 1 2 3 5 10 6 9 | grep -i "^[${PKG_FIRST_CHAR}]" | grep "$categoryPATTERN" | sed -e 's%||$%|unknown|%'`"
  fi
- echo "$FLTRD_REPO" > /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrVERSION}
+ echo "$FLTRD_REPO" > /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrREPO_TRIAD}
  #...file ex: /tmp/petget_fltrd_repo_a_Document_Packages-slackware-12.2-official
 fi
 
 #w480 extract names of packages that are already installed...
-shortPATTERN="`cut -f 2 -d '|' /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrVERSION} | sed -e 's%^%|%' -e 's%$%|%'`"
+shortPATTERN="`cut -f 2 -d '|' /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrREPO_TRIAD} | sed -e 's%^%|%' -e 's%$%|%'`"
 echo "$shortPATTERN" > /tmp/petget_shortlist_patterns
 INSTALLED_CHAR_CAT="`cat /root/.packages/woof-installed-packages /root/.packages/user-installed-packages | grep --file=/tmp/petget_shortlist_patterns`"
 #make up a list of filter patterns, so will be able to filter pkg db...
 if [ "$INSTALLED_CHAR_CAT" ];then #100711
  INSTALLED_PATTERNS="`echo "$INSTALLED_CHAR_CAT" | cut -f 2 -d '|' | sed -e 's%^%|%' -e 's%$%|%'`"
@@ -91,15 +92,15 @@
 #w480 pkg_chooser has created this, pkg names that need to be ignored (for whatever reason)...
 cat /tmp/petget_pkg_name_ignore_patterns >> /tmp/petget_installed_patterns
 
 #110530 ignore packages with different kernel version number, format -k2.6.32.28- in pkg name...
 GOODKERNPTN="`uname -r | sed -e 's%\.%\\\.%g' -e 's%^%\\\-k%' -e 's%$%$%'`" #ex: \-k2.6.32$
-BADKERNPTNS="`grep -o '\-k2\.6\.[^-|a-zA-Z]*' /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrVERSION} | cut -f 1 -d '|' | grep -v "$GOODKERNPTN" | sed -e 's%$%-%' -e 's%\.%\\\.%g' -e 's%\-%\\\-%g'`" #ex: \-k2\.6\.32\.28\-
+BADKERNPTNS="`grep -o '\-k2\.6\.[^-|a-zA-Z]*' /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrREPO_TRIAD} | cut -f 1 -d '|' | grep -v "$GOODKERNPTN" | sed -e 's%$%-%' -e 's%\.%\\\.%g' -e 's%\-%\\\-%g'`" #ex: \-k2\.6\.32\.28\-
 [ "$BADKERNPTNS" ] && echo "$BADKERNPTNS" >> /tmp/petget_installed_patterns
 
 #100716 PKGS_MANAGEMENT file has new variable PKG_PET_THEN_BLACKLIST_COMPAT_KIDS...
-xDBC="`echo -n "${fltrVERSION}" | cut -f 1 -d '-'`" #ex: slackware-12.2-official 1st-param is $DISTRO_BINARY_COMPAT
+xDBC="`echo -n "${fltrREPO_TRIAD}" | cut -f 1 -d '-'`" #ex: slackware-12.2-official 1st-param is $DISTRO_BINARY_COMPAT
 if [ "$xDBC" != "puppy" ];then #not PET pkgs.
  for ONEPTBCK in $PKG_PET_THEN_BLACKLIST_COMPAT_KIDS
  do
   pONEPTBCK='|'"$ONEPTBCK"'|' #ex: |ffmpeg|
   fONEPTBCK="`grep "$pONEPTBCK" /root/.packages/woof-installed-packages /root/.packages/user-installed-packages | grep '\.pet|'`"
@@ -113,12 +114,18 @@
 mv -f /tmp/petget_installed_patterns-tmp /tmp/petget_installed_patterns
 
 #filter out installed pkgs from the repo pkg list...
 #ALIASES_PATTERNS="`echo -n "$PKG_ALIASES_INSTALLED" | tr -s ' ' | sed -e 's%^ %%' -e 's% $%%' | tr ' ' '\n' | sed -e 's%^%|%' -e 's%$%|%'`"
 #echo "$ALIASES_PATTERNS" >> /tmp/petget_installed_patterns
-grep --file=/tmp/petget_installed_patterns -v /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrVERSION} | cut -f 1,5 -d '|' > /tmp/filterpkgs.results
-#...'pkgname|description' has been written to /tmp/filterpkgs.results for main gui.
+fprPTN="s%$%|${fltrREPO_TRIAD}%" #120504 append repo-triad on end of each line.
+FPR="`grep --file=/tmp/petget_installed_patterns -v /tmp/petget_fltrd_repo_${PKG_FIRST_CHAR}_${fltrCATEGORY}_Packages-${fltrREPO_TRIAD} | cut -f 1,5 -d '|' | sed -e "$fprPTN"`"
+if  [ "$FPR" = "|${fltrREPO_TRIAD}" ];then
+ echo -n "" > /tmp/petget/filterpkgs.results #nothing.
+else
+ echo "$FPR" > /tmp/petget/filterpkgs.results
+fi
+#...'pkgname|description|repo-triad' has been written to /tmp/petget/filterpkgs.results for main gui.
 
 #101129 postprocess, show EXE, DEV, DOC, NLS...
 DEF_CHK_EXE='true'
 DEF_CHK_DEV='false'
 DEF_CHK_DOC='false'
@@ -125,16 +132,16 @@
 DEF_CHK_NLS='false'
 [ -e /var/local/petget/postfilter_EXE ] && DEF_CHK_EXE="`cat /var/local/petget/postfilter_EXE`"
 [ -e /var/local/petget/postfilter_DEV ] && DEF_CHK_DEV="`cat /var/local/petget/postfilter_DEV`"
 [ -e /var/local/petget/postfilter_DOC ] && DEF_CHK_DOC="`cat /var/local/petget/postfilter_DOC`"
 [ -e /var/local/petget/postfilter_NLS ] && DEF_CHK_NLS="`cat /var/local/petget/postfilter_NLS`"
-cp -f /tmp/filterpkgs.results /tmp/filterpkgs.results.post
-[ "$DEF_CHK_EXE" = "false" ] && sed -i -e '/_EXE/d' /tmp/filterpkgs.results.post
-[ "$DEF_CHK_DEV" = "false" ] && sed -i -e '/_DEV/d' /tmp/filterpkgs.results.post
-[ "$DEF_CHK_DOC" = "false" ] && sed -i -e '/_DOC/d' /tmp/filterpkgs.results.post
-[ "$DEF_CHK_NLS" = "false" ] && sed -i -e '/_NLS/d' /tmp/filterpkgs.results.post
-#...main gui will read /tmp/filterpkgs.results.post
+cp -f /tmp/petget/filterpkgs.results /tmp/petget/filterpkgs.results.post
+[ "$DEF_CHK_EXE" = "false" ] && sed -i -e '/_EXE/d' /tmp/petget/filterpkgs.results.post
+[ "$DEF_CHK_DEV" = "false" ] && sed -i -e '/_DEV/d' /tmp/petget/filterpkgs.results.post
+[ "$DEF_CHK_DOC" = "false" ] && sed -i -e '/_DOC/d' /tmp/petget/filterpkgs.results.post
+[ "$DEF_CHK_NLS" = "false" ] && sed -i -e '/_NLS/d' /tmp/petget/filterpkgs.results.post
+#...main gui will read /tmp/petget/filterpkgs.results.post (actually that happens in ui_Classic or ui_Ziggy, which is included in pkg_chooser.sh).
 
 [ $X1PID -ne 0 ] && kill $X1PID
 
 ###END###
 

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

@@ -8,10 +8,11 @@
 #110530 ignore packages with different kernel version number, format -k2.6.32.28- in pkg name (also filterpkgs.sh)...
 #120203 BK: internationalized.
 #120323 replace 'xmessage' with 'pupmessage'.
 #120410 Mavrothal: fix "getext" typo.
 #120504 Mavrothal: search with multiple keywords, both pkg name and description.
+#120504 some files moved into /tmp/petget
 
 export TEXTDOMAIN=petget___findnames.sh
 export OUTPUT_CHARSET=UTF-8
 
 . /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
@@ -26,14 +27,50 @@
 entryPATTERN1="`echo -n "$ENTRY1" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g' -e 's%\\*%.*%g' | awk '{print $1}'`"
 entryPATTERN2="`echo -n "$ENTRY1" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g' -e 's%\\*%.*%g' | awk '{print $2}'`"
 entryPATTERN3="`echo -n "$ENTRY1" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g' -e 's%\\*%.*%g' | awk '{print $3}'`"
 entryPATTERN4="`echo -n "$ENTRY1" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g' -e 's%\\*%.*%g' | awk '{print $4}'`"
 
-CURRENTREPO="`cat /tmp/petget_filterversion`" #search here first.
-REPOLIST="${CURRENTREPO} `cat /tmp/petget_active_repo_list | grep -v "$CURRENTREPO" | tr '\n' ' '`"
+CURRENTREPO="`cat /tmp/petget/current-repo-triad`" #search here first.
+ALLACTIVEREPOS="`cat /tmp/petget_active_repo_list`"
+
+#120504 ask which repos...
+export ASKREPO_DIALOG="<window title=\"$(gettext 'PPM: search')\" icon-name=\"gtk-about\">
+<vbox>
+ <frame $(gettext 'Search only current repository')>
+  <hbox>
+   <text><label>\"${CURRENTREPO}\"</label></text>
+   <vbox>
+    <button><label>$(gettext 'Search')</label><action type=\"exit\">BUTTON_SEARCH_CURRENT</action></button>
+   </vbox>
+  </hbox>
+ </frame>
+ <frame $(gettext 'Search all repositories')>
+  <hbox>
+   <text><label>\"${ALLACTIVEREPOS}\"</label></text>
+   <vbox>
+    <button><label>$(gettext 'Search')</label><action type=\"exit\">BUTTON_SEARCH_ALL</action></button>
+   </vbox>
+  </hbox>
+ </frame>
+</vbox>
+</window>
+"
+RETPARAMS="`gtkdialog4 --center --program=ASKREPO_DIALOG`"
+eval "$RETPARAMS"
+[ "$EXIT" != "BUTTON_SEARCH_CURRENT" -a "$EXIT" != "BUTTON_SEARCH_ALL" ] && exit
+SEARCH_REPOS_FLAG="current"
+[ "$EXIT" = "BUTTON_SEARCH_ALL" ] && SEARCH_REPOS_FLAG="all"
+
+if [ "$SEARCH_REPOS_FLAG" = "current" ];then #120504
+ REPOLIST="$CURRENTREPO"
+else
+ #REPOLIST="${CURRENTREPO} `cat /tmp/petget_active_repo_list | grep -v "$CURRENTREPO" | tr '\n' ' '`" #repo-triads list.
+ REPOLIST="`echo "$ALLACTIVEREPOS"  | tr '\n' ' '`"
+fi
 
 FNDIT=no
+echo -n "" > /tmp/petget/filterpkgs.results
 for ONEREPO in $REPOLIST
 do
  #120504 Mavrothal:
  #FNDENTRIES="`cat /root/.packages/Packages-${ONEREPO} | grep -i "$entryPATTERN"`"
  if [ "$entryPATTERN4" != "" ]; then
@@ -52,27 +89,33 @@
   ALPHAPRE="`cat /tmp/petget_pkg_first_char`"
   #if [ "$ALPHAPRE" != "ALL" ];then
   # echo "$FIRSTCHAR" > /tmp/petget_pkg_first_char
   #fi
   #echo "ALL" > /tmp/petget_filtercategory
-  echo "$ONEREPO" > /tmp/petget_filterversion #ex: slackware-12.2-official
+  #echo "$ONEREPO" > /tmp/petget/current-repo-triad #ex: slackware-12.2-official. 120504 BK remove.
   #this is read when update TREE1 in pkg_chooser.sh...
-  #echo "$FNDENTRIES" | cut -f 1,10 -d '|' > /tmp/filterpkgs.results
-  echo "$FNDENTRIES" > /tmp/filterpkgs.results #120504
+  #echo "$FNDENTRIES" | cut -f 1,10 -d '|' > /tmp/petget/filterpkgs.results
+  repoPTN="s%$%|${ONEREPO}|%" #note, '|' on the end also, needed below by printcols.
+  FPR="`echo "$FNDENTRIES" | sed "$repoPTN"`"
+  if  [ "$FPR" = "|${ONEREPO}" ];then
+   echo -n "" > /tmp/petget/filterpkgs.results #nothing.
+  else
+   echo "$FPR" >> /tmp/petget/filterpkgs.results #120504 append repo-triad each line.
+  fi
   FNDIT=yes
-  break
+#120504  break
  fi
 done
 
 #110530 ignore packages with different kernel version number, format -k2.6.32.28- in pkg name...
 if [ "$FNDIT" = "yes" ];then
  GOODKERNPTN="`uname -r | sed -e 's%\.%\\\.%g' -e 's%^%\\\-k%' -e 's%$%$%'`" #ex: \-k2.6.32$
- BADKERNPTNS="`grep -o '\-k2\.6\.[^-|a-zA-Z]*' /tmp/filterpkgs.results | cut -f 1 -d '|' | grep -v "$GOODKERNPTN" | sed -e 's%$%-%' -e 's%\.%\\\.%g' -e 's%\-%\\\-%g'`" #ex: \-k2\.6\.32\.28\-
+ BADKERNPTNS="`grep -o '\-k2\.6\.[^-|a-zA-Z]*' /tmp/petget/filterpkgs.results | cut -f 1 -d '|' | grep -v "$GOODKERNPTN" | sed -e 's%$%-%' -e 's%\.%\\\.%g' -e 's%\-%\\\-%g'`" #ex: \-k2\.6\.32\.28\-
  if [ "$BADKERNPTNS" ];then
   echo "$BADKERNPTNS" >> /tmp/petget_badkernptns
-  grep -v -f /tmp/petget_badkernptns /tmp/filterpkgs.results > /tmp/filterpkgs.resultsxxx
-  mv -f /tmp/filterpkgs.resultsxxx /tmp/filterpkgs.results
+  grep -v -f /tmp/petget_badkernptns /tmp/petget/filterpkgs.results > /tmp/petget/filterpkgs.resultsxxx
+  mv -f /tmp/petget/filterpkgs.resultsxxx /tmp/petget/filterpkgs.results
  fi
 fi
 
 if [ "$FNDIT" = "no" ];then
  pupmessage -bg red -center -title "$(gettext 'PPM find')" "$(gettext 'Sorry, no matching package name')" & #110223 run as separate process.
@@ -84,13 +127,25 @@
  DEF_CHK_NLS='false'
  [ -e /var/local/petget/postfilter_EXE ] && DEF_CHK_EXE="`cat /var/local/petget/postfilter_EXE`"
  [ -e /var/local/petget/postfilter_DEV ] && DEF_CHK_DEV="`cat /var/local/petget/postfilter_DEV`"
  [ -e /var/local/petget/postfilter_DOC ] && DEF_CHK_DOC="`cat /var/local/petget/postfilter_DOC`"
  [ -e /var/local/petget/postfilter_NLS ] && DEF_CHK_NLS="`cat /var/local/petget/postfilter_NLS`"
- cp -f /tmp/filterpkgs.results /tmp/filterpkgs.results.post
- [ "$DEF_CHK_EXE" = "false" ] && sed -i -e '/_EXE/d' /tmp/filterpkgs.results.post
- [ "$DEF_CHK_DEV" = "false" ] && sed -i -e '/_DEV/d' /tmp/filterpkgs.results.post
- [ "$DEF_CHK_DOC" = "false" ] && sed -i -e '/_DOC/d' /tmp/filterpkgs.results.post
- [ "$DEF_CHK_NLS" = "false" ] && sed -i -e '/_NLS/d' /tmp/filterpkgs.results.post
- #...main gui will read /tmp/filterpkgs.results.post
+ cp -f /tmp/petget/filterpkgs.results /tmp/petget/filterpkgs.results.post
+ [ "$DEF_CHK_EXE" = "false" ] && sed -i -e '/_EXE/d' /tmp/petget/filterpkgs.results.post
+ [ "$DEF_CHK_DEV" = "false" ] && sed -i -e '/_DEV/d' /tmp/petget/filterpkgs.results.post
+ [ "$DEF_CHK_DOC" = "false" ] && sed -i -e '/_DOC/d' /tmp/petget/filterpkgs.results.post
+ [ "$DEF_CHK_NLS" = "false" ] && sed -i -e '/_NLS/d' /tmp/petget/filterpkgs.results.post
+ #...main gui will read /tmp/petget/filterpkgs.results.post
+
+ #120504 post-process presentation to show which repo...
+ #filterpkgs.results.post each line has package-name|description|repo-triad
+ #when we have searched multiple repos, move repo-triad into description field, so that it will show up on main window...
+ if [ "$SEARCH_REPOS_FLAG" = "all" ];then
+  #creates descript field like: "[puppy-4-official] Abiword word processor"
+  #note, printcols (see support/printcols.c in Woof) needs a '|' on the end to work.
+  POSTPROCLIST="`printcols /tmp/petget/filterpkgs.results.post 1 3 2 3 | sed -e 's%|%FIRSTBARCHAR[%' -e 's%|%] %' -e 's%FIRSTBARCHAR%|%'`"
+  echo "$POSTPROCLIST" > /tmp/petget/filterpkgs.results.post
+  #ex line: abiword-1.2.3|[puppy-4-official] Abiword word processor|puppy-4-official|
+ fi
+
 fi
 

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

@@ -1,33 +1,50 @@
 #!/bin/sh
 #(c) Copyright Barry Kauler 2009, puppylinux.com
 #2009 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html).
 #called from pkg_chooser.sh
 #package to be previewed prior to installation is TREE1 -- inherited from parent.
-#/tmp/petget_filterversion has the repository that installing from.
+#/tmp/petget/current-repo-triad has the repository that installing from.
 #100821 bug in Lucid 5.1, /tmp/pup_event_sizefreem had two identical lines.
 #101221 yaf-splash fix.
 #120101 01micko: jwm >=547 has -reload, no screen flicker.
 #120116 rev. 514 introduced icon rendering method which broke -reload at 547. fixed at rev. 574.
 #120203 BK: internationalized.
+#120504 if no pkgs in category, then when click in window in main dlg, comes here with TREE1="".
+#120504 select correct repo when have chosen a pkg from multiple-repo list.
 
 export TEXTDOMAIN=petget___installpreview.sh
 export OUTPUT_CHARSET=UTF-8
+
+[ "$TREE1" = "" ] && exit #120504 nothing to install.
 
 . /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
 . /root/.packages/DISTRO_PKGS_SPECS
 
 #/usr/X11R7/bin/yaf-splash -font "8x16" -outline 0 -margin 4 -bg orange -text "Please wait, processing package database files..." &
 yaf-splash -close never -bg orange -text "$(gettext 'Please wait, processing package database files...')" &
 X1PID=$!
 
 #ex: TREE1=abiword-1.2.4 (first field in database entry).
-DB_FILE=Packages-`cat /tmp/petget_filterversion` #ex: Packages-slackware-12.2-official
+DB_FILE=Packages-`cat /tmp/petget/current-repo-triad` #ex: Packages-slackware-12.2-official
+tPATTERN='^'"$TREE1"'|'
+
+#120504 if findnames.sh searched multiple repos, /tmp/petget/current-repo-triad (set in pkg_chooser.sh) might be wrong...
+[ -f /tmp/petget/current-repo-triad.previous ] && rm -f /tmp/petget/current-repo-triad.previous
+if [ -f /tmp/petget/filterpkgs.results.post ];then
+ #file ex line: abiword-1.2.3|[puppy-4-official] Abiword word processor|puppy-4-official|
+ ALTSEARCHREPO="$(grep "$tPATTERN" /tmp/petget/filterpkgs.results.post | grep '|\[' | cut -f 2 -d '[' | cut -f 1 -d ']')"
+ [ "$ALTSEARCHREPO" ] && DB_FILE="Packages-${ALTSEARCHREPO}"
+ #hmmm, other scripts, ex dependencies.sh, will need to have this correct...
+ if [ "$ALTSEARCHREPO" ];then
+  mv -f /tmp/petget/current-repo-triad /tmp/petget/current-repo-triad.previous #need to restore old one before exit this script.
+  echo -n "$ALTSEARCHREPO" > /tmp/petget/current-repo-triad
+ fi
+fi
 
 rm -f /tmp/petget_missing_dbentries-* 2>/dev/null
 
-tPATTERN='^'"$TREE1"'|'
 DB_ENTRY="`grep "$tPATTERN" /root/.packages/$DB_FILE | head -n 1`"
 #line format: pkgname|nameonly|version|pkgrelease|category|size|path|fullfilename|dependencies|description|
 #optionally on the end: compileddistro|compiledrelease|repo| (fields 11,12,13)
 
 DB_pkgname="`echo -n "$DB_ENTRY" | cut -f 1 -d '|'`"
@@ -134,11 +151,14 @@
 "
 
 RETPARAMS="`gtkdialog3 --center --program=PREVIEW_DIALOG`"
 
 eval "$RETPARAMS"
-[ "$EXIT" != "BUTTON_INSTALL" -a "$EXIT" != "BUTTON_EXAMINE_DEPS" ] && exit
+if [ "$EXIT" != "BUTTON_INSTALL" -a "$EXIT" != "BUTTON_EXAMINE_DEPS" ];then
+ [ -f /tmp/petget/current-repo-triad.previous ] && mv -f /tmp/petget/current-repo-triad.previous /tmp/petget/current-repo-triad
+ exit
+fi
 
 #DB_ENTRY has the database entry of the main package that we want to install.
 #DB_FILE has the name of the database file that has the main entry, ex: Packages-slackware-12.2-slacky
 
 if [ "$EXIT" = "BUTTON_EXAMINE_DEPS" ];then
@@ -293,10 +313,11 @@
    opPATTERN='^'"$ONEPKG"'|'
    grep -v "$opPATTERN" /tmp/petget_missing_dbentries-Packages-${ONEREPO} > /tmp/petget_tmp
    mv -f /tmp/petget_tmp /tmp/petget_missing_dbentries-Packages-${ONEREPO}
   done
  else
+  [ -f /tmp/petget/current-repo-triad.previous ] && mv -f /tmp/petget/current-repo-triad.previous /tmp/petget/current-repo-triad #120504
   exit
  fi
 fi
 
 #come here, want to install pkg(s)...
@@ -314,11 +335,14 @@
 
 #now do the actual install...
 PASSEDPRM=""
 [ "`echo "$RETPARAMS" | grep '^EXIT' | grep 'BUTTON_PKGS_DOWNLOADONLY'`" != "" ] && PASSEDPRM="DOWNLOADONLY"
 /usr/local/petget/downloadpkgs.sh $PASSEDPRM
-[ $? -ne 0 ] && exit 1
+if [ $? -ne 0 ];then
+ [ -f /tmp/petget/current-repo-triad.previous ] && mv -f /tmp/petget/current-repo-triad.previous /tmp/petget/current-repo-triad #120504
+ exit 1
+fi
 [ "$PASSEDPRM" = "DOWNLOADONLY" ] && exit
 
 #w482 adjust msg as appropriate, restart jwm and update menu if required...
 INSTALLEDCAT="menu" #any string.
 [ "`cat /tmp/petget-installed-pkgs-log | grep -o 'CATEGORY' | grep -v 'none'`" = "" ] && INSTALLEDCAT="none"
@@ -361,7 +385,9 @@
 kill $X3PID
 
 #check any missing shared libraries...
 PKGS="`cat /tmp/petget_missing_dbentries-* | cut -f 1 -d '|' | tr '\n' '|'`"
 /usr/local/petget/check_deps.sh $PKGS
+
+[ -f /tmp/petget/current-repo-triad.previous ] && mv -f /tmp/petget/current-repo-triad.previous /tmp/petget/current-repo-triad #120504
 
 ###END###

Changes to woof-code/rootfs-skeleton/usr/local/petget/petget

@@ -20,10 +20,11 @@
 #110523 support for rpm pkgs.
 #120101 01micko: jwm >=547 has -reload, no screen flicker.
 #120116 rev. 514 introduced icon rendering method which broke -reload at 547. fixed at rev. 574.
 #120203 BK: internationalized.
 #120323 replace 'xmessage' with 'pupmessage'.
+#120504 now have /tmp/petget folder.
 
 export TEXTDOMAIN=petget___petget
 export OUTPUT_CHARSET=UTF-8
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
@@ -32,10 +33,11 @@
 
 #export LANG=C
 . /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
 
 PASSEDPARAM="$1"
+mkdir -p /tmp/petget #120504
 
 if [ "`echo -n "$PASSEDPARAM" | grep '^\\-'`" != "" ];then
  #remove a package...
  PKGNAME="`echo -n "$PASSEDPARAM" | cut -c 2-99`"
  TREE2="$PKGNAME"

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

@@ -14,17 +14,20 @@
 #110118 alternate User Interfaces. see also configure.sh.
 #110505 support sudo for non-root user.
 #110706 fix for deps checking.
 #120203 BK: internationalized.
 #120327 sometimes the selected repo radiobutton did not match listed packages at startup.
+#120504 /tmp/petget_filterversion renamed to /tmp/petget/current-repo-triad
+#120504 some files moved into /tmp/petget
 
 export TEXTDOMAIN=petget___pkg_chooser.sh
 export OUTPUT_CHARSET=UTF-8
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
 
 #export LANG=C
+mkdir -p /tmp/petget #120504
 
 . /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
 . /root/.packages/DISTRO_PKGS_SPECS
 . /root/.packages/PKGS_MANAGEMENT #has PKG_REPOS_ENABLED, PKG_NAME_ALIASES
 
@@ -40,25 +43,25 @@
 [ -e /var/local/petget/postfilter_NLS ] && DEF_CHK_NLS="`cat /var/local/petget/postfilter_NLS`"
 #pass in variable and state... ex: EXE false (see also filterpkgs.sh)
 #this script handles checkbox actions...
 echo "#!/bin/ash
 echo -n \"\$2\" > /var/local/petget/postfilter_\${1}
-cp -f /tmp/filterpkgs.results /tmp/filterpkgs.results.post
+cp -f /tmp/petget/filterpkgs.results /tmp/petget/filterpkgs.results.post
 DEF_CHK_EXE='true'
 DEF_CHK_DEV='false'
 DEF_CHK_DOC='false'
 DEF_CHK_NLS='false'
 [ -e /var/local/petget/postfilter_EXE ] && DEF_CHK_EXE=\"\`cat /var/local/petget/postfilter_EXE\`\"
 [ -e /var/local/petget/postfilter_DEV ] && DEF_CHK_DEV=\"\`cat /var/local/petget/postfilter_DEV\`\"
 [ -e /var/local/petget/postfilter_DOC ] && DEF_CHK_DOC=\"\`cat /var/local/petget/postfilter_DOC\`\"
 [ -e /var/local/petget/postfilter_NLS ] && DEF_CHK_NLS=\"\`cat /var/local/petget/postfilter_NLS\`\"
-[ \"\$DEF_CHK_EXE\" = \"false\" ] && sed -i -e '/_EXE/d' /tmp/filterpkgs.results.post
-[ \"\$DEF_CHK_DEV\" = \"false\" ] && sed -i -e '/_DEV/d' /tmp/filterpkgs.results.post
-[ \"\$DEF_CHK_DOC\" = \"false\" ] && sed -i -e '/_DOC/d' /tmp/filterpkgs.results.post
-[ \"\$DEF_CHK_NLS\" = \"false\" ] && sed -i -e '/_NLS/d' /tmp/filterpkgs.results.post
-" > /tmp/filterpkgs.results.postfilter.sh
-chmod 777 /tmp/filterpkgs.results.postfilter.sh
+[ \"\$DEF_CHK_EXE\" = \"false\" ] && sed -i -e '/_EXE/d' /tmp/petget/filterpkgs.results.post
+[ \"\$DEF_CHK_DEV\" = \"false\" ] && sed -i -e '/_DEV/d' /tmp/petget/filterpkgs.results.post
+[ \"\$DEF_CHK_DOC\" = \"false\" ] && sed -i -e '/_DOC/d' /tmp/petget/filterpkgs.results.post
+[ \"\$DEF_CHK_NLS\" = \"false\" ] && sed -i -e '/_NLS/d' /tmp/petget/filterpkgs.results.post
+" > /tmp/petget/filterpkgs.results.postfilter.sh
+chmod 777 /tmp/petget/filterpkgs.results.postfilter.sh
 
 
 #finds all user-installed pkgs and formats ready for display...
 /usr/local/petget/finduserinstalledpkgs.sh #writes to /tmp/installedpkgs.results
 
@@ -189,11 +192,11 @@
 done
 
 FILTER_CATEG="Desktop"
 #note, cannot initialise radio buttons in gtkdialog...
 echo "Desktop" > /tmp/petget_filtercategory #must start with Desktop.
-echo "$FIRST_DB" > /tmp/petget_filterversion #ex: slackware-12.2-official
+echo "$FIRST_DB" > /tmp/petget/current-repo-triad #ex: slackware-12.2-official
 
 #if [ "$DISTRO_BINARY_COMPAT" = "ubuntu" -o "$DISTRO_BINARY_COMPAT" = "debian" ];then
 if [ 0 -eq 1 ];then #w020 disable this choice.
  #filter pkgs by first letter, for more speed. must start with ab...
  echo "ab" > /tmp/petget_pkg_first_char
@@ -223,14 +226,14 @@
  FIRSTCHARS=""
  xFIRSTCHARS=""
 fi
 
 #finds pkgs in repository based on filter category and version and formats ready for display...
-/usr/local/petget/filterpkgs.sh $FILTER_CATEG #writes to /tmp/filterpkgs.results
+/usr/local/petget/filterpkgs.sh $FILTER_CATEG #writes to /tmp/petget/filterpkgs.results
 
 echo '#!/bin/sh
-echo $1 > /tmp/petget_filterversion
+echo $1 > /tmp/petget/current-repo-triad
 ' > /tmp/filterversion.sh
 chmod 777 /tmp/filterversion.sh
 
 #  <text use-markup=\"true\"><label>\"<b>To install or uninstall,</b>\"</label></text>
 

Changes to woof-code/rootfs-skeleton/usr/local/petget/ui_Classic

@@ -1,8 +1,9 @@
 #default user interface.
 #120203 rodin.s: internationalized.
 #120224 handle translated help.htm
+#120504 some files moved into /tmp/petget
 
 export TEXTDOMAIN=petget___ui_Classic
 export OUTPUT_CHARSET=UTF-8
 
 #120224 handle translated help.htm
@@ -38,11 +39,11 @@
   <vbox>
   <tree>
     <label>$(gettext 'Package|Description')</label>
     <height>280</height><width>668</width>
     <variable>TREE1</variable>
-    <input>cat /tmp/filterpkgs.results.post</input>
+    <input>cat /tmp/petget/filterpkgs.results.post</input>
     <action signal=\"button-release-event\">/usr/local/petget/installpreview.sh</action>
     <action signal=\"button-release-event\">/usr/local/petget/finduserinstalledpkgs.sh</action>
     <action signal=\"button-release-event\">refresh:TREE2</action>
   </tree>
   </vbox>
@@ -50,14 +51,14 @@
 <hbox>
  <vbox>
 
   <hbox>
    <text><label>$(gettext 'Show:')</label></text>
-   <checkbox><default>${DEF_CHK_EXE}</default><label>EXE</label><variable>CHK_EXE</variable><action>/tmp/filterpkgs.results.postfilter.sh EXE \$CHK_EXE</action><action>refresh:TREE1</action></checkbox>
-   <checkbox><default>${DEF_CHK_DEV}</default><label>DEV</label><variable>CHK_DEV</variable><action>/tmp/filterpkgs.results.postfilter.sh DEV \$CHK_DEV</action><action>refresh:TREE1</action></checkbox>
-   <checkbox><default>${DEF_CHK_DOC}</default><label>DOC</label><variable>CHK_DOC</variable><action>/tmp/filterpkgs.results.postfilter.sh DOC \$CHK_DOC</action><action>refresh:TREE1</action></checkbox>
-   <checkbox><default>${DEF_CHK_NLS}</default><label>NLS</label><variable>CHK_NLS</variable><action>/tmp/filterpkgs.results.postfilter.sh NLS \$CHK_NLS</action><action>refresh:TREE1</action></checkbox>
+   <checkbox><default>${DEF_CHK_EXE}</default><label>EXE</label><variable>CHK_EXE</variable><action>/tmp/petget/filterpkgs.results.postfilter.sh EXE \$CHK_EXE</action><action>refresh:TREE1</action></checkbox>
+   <checkbox><default>${DEF_CHK_DEV}</default><label>DEV</label><variable>CHK_DEV</variable><action>/tmp/petget/filterpkgs.results.postfilter.sh DEV \$CHK_DEV</action><action>refresh:TREE1</action></checkbox>
+   <checkbox><default>${DEF_CHK_DOC}</default><label>DOC</label><variable>CHK_DOC</variable><action>/tmp/petget/filterpkgs.results.postfilter.sh DOC \$CHK_DOC</action><action>refresh:TREE1</action></checkbox>
+   <checkbox><default>${DEF_CHK_NLS}</default><label>NLS</label><variable>CHK_NLS</variable><action>/tmp/petget/filterpkgs.results.postfilter.sh NLS \$CHK_NLS</action><action>refresh:TREE1</action></checkbox>
   </hbox>
 
   <hbox>
    <text><label>$(gettext 'Help:')</label></text>
    <button><input file>/usr/local/lib/X11/mini-icons/mini-question.xpm</input><action>defaulthtmlviewer file://${HELPFILE} & </action></button>

Changes to woof-code/rootfs-skeleton/usr/local/petget/ui_Ziggy

@@ -1,10 +1,11 @@
 #alternate user interface designed by zigbert.
 #120203 rodin.s: internationalized.
 #120224 more gettext's required. icons were missing.
 #120224 handle translated help.htm
 #120225 fix for translated categories.
+#120504 some files moved into /tmp/petget
 
 export TEXTDOMAIN=petget___ui_Ziggy
 export OUTPUT_CHARSET=UTF-8
 
 ALLITEM='' ; ALLSTOCK='' ; CATHEIGHT='100' ; WINHEIGHT='380'
@@ -79,32 +80,32 @@
   <vbox>
    <checkbox>
     <default>${DEF_CHK_EXE}</default>
     <label>EXE</label>
     <variable>CHK_EXE</variable>
-    <action>/tmp/filterpkgs.results.postfilter.sh EXE $CHK_EXE</action>
+    <action>/tmp/petget/filterpkgs.results.postfilter.sh EXE $CHK_EXE</action>
     <action>refresh:TREE1</action>
    </checkbox>
    <checkbox>
     <default>${DEF_CHK_DEV}</default>
     <label>DEV</label>
     <variable>CHK_DEV</variable>
-    <action>/tmp/filterpkgs.results.postfilter.sh DEV $CHK_DEV</action>
+    <action>/tmp/petget/filterpkgs.results.postfilter.sh DEV $CHK_DEV</action>
     <action>refresh:TREE1</action>
    </checkbox>
    <checkbox>
     <default>${DEF_CHK_DOC}</default>
     <label>DOC</label>
     <variable>CHK_DOC</variable>
-    <action>/tmp/filterpkgs.results.postfilter.sh DOC $CHK_DOC</action>
+    <action>/tmp/petget/filterpkgs.results.postfilter.sh DOC $CHK_DOC</action>
     <action>refresh:TREE1</action>
    </checkbox>
    <checkbox>
     <default>${DEF_CHK_NLS}</default>
     <label>NLS</label>
     <variable>CHK_NLS</variable>
-    <action>/tmp/filterpkgs.results.postfilter.sh NLS $CHK_NLS</action>
+    <action>/tmp/petget/filterpkgs.results.postfilter.sh NLS $CHK_NLS</action>
     <action>refresh:TREE1</action>
    </checkbox>
   </vbox>
   </frame>
 
@@ -145,11 +146,11 @@
   </tree>
 </vbox>
   <tree>
     <label>$(gettext 'Package|Description')</label>
     <variable>TREE1</variable>
-    <input>cat /tmp/filterpkgs.results.post</input>
+    <input>cat /tmp/petget/filterpkgs.results.post</input>
     <action signal=\"button-release-event\">/usr/local/petget/installpreview.sh</action>
     <action signal=\"button-release-event\">/usr/local/petget/finduserinstalledpkgs.sh</action>
     <action signal=\"button-release-event\">refresh:TREE2</action>
   </tree>