Check-in [afe5f65a84]
Not logged in

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

Overview

SHA1 Hash:afe5f65a842ec11fc31b49cc1da94c00f49f3c28
Date: 2012-05-04 02:03:53
User: BarryK
Comment:Mavrothal: ppm: multiple keyword search, both pkg name and description

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/sbin/pup_event_frontend_d

@@ -32,10 +32,11 @@
 #111228 added removepreview.sh test (in /usr/local/petget) but probably test for "petget" is already enough.
 #120129 karl godt: fix ZOMBIES, see http://murga-linux.com/puppy/viewtopic.php?t=71767&start=420. see also rc.shutdown, pmount, drive_all.
 #120131 rodin.s: internationalized. BK: note, rodin.s's script different from that in Woof, applied changes line-by-line.
 #120201 more gettext added.
 #120215 rodin.s: gettext fixes on a couple of lines.
+#120503 the label "mmcblk0p1" (SD memory cards via mmc interface) is too long, reduce to "mm0p1".
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110513
 
 export TEXTDOMAIN=pup_event_frontend_d
 export OUTPUT_CHARSET=UTF-8
@@ -312,18 +313,20 @@
  #ppPATTERN=' label="'"$ONEDRVNAME"'"'
  #v411 rerwin: avoid icon getting duplicated if it is renamed...
  ppPATTERN="/root/.pup_event/drive_${ONEDRVNAME}<"
  [ "`grep "$ppPATTERN" /root/Choices/ROX-Filer/PuppyPin`" != "" ] && return #precaution.
  free_coord
+ #120503 the label "mmcblk0p1" (SD memory cards via mmc interface) is too long...
+ cutONEDRVNAME="`echo -n "${ONEDRVNAME}" | sed -e 's%cblk%%'`"
  echo "<?xml version=\"1.0\"?>
 <env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
  <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
   <PinboardAdd>
    <Path>/root/.pup_event/drive_${ONEDRVNAME}</Path>
    <X>${COORD_X}</X>
    <Y>${COORD_Y}</Y>
-   <Label>${ONEDRVNAME}</Label>
+   <Label>${cutONEDRVNAME}</Label>
    <Args>${DRV_CATEGORY} ${FSTYPE}</Args>
   </PinboardAdd>
  </env:Body>
 </env:Envelope>"  | rox -R
 }

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

@@ -7,27 +7,47 @@
 #110223 run message as separate process.
 #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.
 
 export TEXTDOMAIN=petget___findnames.sh
 export OUTPUT_CHARSET=UTF-8
 
 . /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
 . /root/.packages/DISTRO_PKGS_SPECS #has PKGS_SPECS_TABLE.
 . /root/.packages/DISTRO_PET_REPOS #has PET_REPOS, PACKAGELISTS_PET_ORDER
 
-entryPATTERN='^'"`echo -n "$ENTRY1" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g' -e 's%\\*%.*%g'`"
+#120504 Mavrothal:
+#entryPATTERN='^'"`echo -n "$ENTRY1" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g' -e 's%\\*%.*%g'`"
+if [ "$ENTRY1" = "" ] ; then
+ exit 0
+fi
+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' ' '`"
 
 FNDIT=no
 for ONEREPO in $REPOLIST
 do
- FNDENTRIES="`cat /root/.packages/Packages-${ONEREPO} | grep -i "$entryPATTERN"`"
+ #120504 Mavrothal:
+ #FNDENTRIES="`cat /root/.packages/Packages-${ONEREPO} | grep -i "$entryPATTERN"`"
+ if [ "$entryPATTERN4" != "" ]; then
+  FNDENTRIES="`cat /root/.packages/Packages-${ONEREPO} | cut -f1,10 -d \| | grep -i "$entryPATTERN1" | grep -i "$entryPATTERN2" | grep -i "$entryPATTERN3" | grep -i "$entryPATTERN4"`"
+ elif [ "$entryPATTERN3" != "" ]; then
+  FNDENTRIES="`cat /root/.packages/Packages-${ONEREPO} | cut -f1,10 -d \| | grep -i "$entryPATTERN1" | grep -i "$entryPATTERN2" | grep -i "$entryPATTERN3"`"
+ elif [ "$entryPATTERN2" != "" ]; then
+  FNDENTRIES="`cat /root/.packages/Packages-${ONEREPO} | cut -f1,10 -d \| | grep -i "$entryPATTERN1" | grep -i "$entryPATTERN2"`"
+ else
+  FNDENTRIES="`cat /root/.packages/Packages-${ONEREPO} | cut -f1,10 -d \| | grep -i "$entryPATTERN1"`"
+ fi
+
  if [ "$FNDENTRIES" != "" ];then
   FIRSTCHAR="`echo "$FNDENTRIES" | cut -c 1 | tr '\n' ' ' | sed -e 's% %%g'`"
   #write these just in case needed...
   ALPHAPRE="`cat /tmp/petget_pkg_first_char`"
   #if [ "$ALPHAPRE" != "ALL" ];then
@@ -34,11 +54,12 @@
   # echo "$FIRSTCHAR" > /tmp/petget_pkg_first_char
   #fi
   #echo "ALL" > /tmp/petget_filtercategory
   echo "$ONEREPO" > /tmp/petget_filterversion #ex: slackware-12.2-official
   #this is read when update TREE1 in pkg_chooser.sh...
-  echo "$FNDENTRIES" | cut -f 1,10 -d '|' > /tmp/filterpkgs.results
+  #echo "$FNDENTRIES" | cut -f 1,10 -d '|' > /tmp/filterpkgs.results
+  echo "$FNDENTRIES" > /tmp/filterpkgs.results #120504
   FNDIT=yes
   break
  fi
 done
 

Changes to woof-code/rootfs-skeleton/usr/local/petget/help.htm

@@ -1,6 +1,6 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html><head>
 
 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
 
 
@@ -154,10 +154,17 @@
 their names.<br>
       <br>
 You can even have multiple wildcards, for example "p*mix*to", which will find the 'panoramixproto' package.<br>
       <br>
 The search is case-insensitive, so a search for "PAN" will give the same results as shown above.<br>
+      <br>
+As from May 2012, PPM also supports searching for multiple keywords. Also,
+the Description field is searched as well as the package name. For
+example, it you type into the search-box, "abiword plugins", it
+will find packages with these two words, either in the package name or
+the description.<br>
+
       <br>
 One thing to note about the search is that it searches the entire
 repository, and ignores the vertical Category radiobuttons on the left
 side.<br>
       <h2>Installing without the PPM GUI</h2>