Check-in [cd600f92a8]
Not logged in

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

Overview

SHA1 Hash:cd600f92a8de3783fd38bdd52b3a58fcc490a2ac
Date: 2012-08-14 13:20:41
User: BarryK
Comment:/usr/bin/petspec, called from dir2pet, now allows choice of sub-category

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/bin/petspec

@@ -8,18 +8,15 @@
 #100303 small bugfix.
 #100320 prevent crash if $5 only has name, no version number.
 #100508 bugfix empty field.
 #120517 update the compileddistro items.
 #120719 support raspbian.
+#120814 support sub-category.
 
 #old ex: "abiword-2.6.3" "abiword 2.6.3: wordprocessor" ONOFF "Document +fribidi,+gtk+,+goffice,+wv,+enchant 7556K"
-#new: pkgname|nameonly|version|pkgrelease|category|size|path|fullfilename|dependencies|description|
-#ex: abiword-1.2.4|abiword|1.2.4|5|Document|999K|slackware/ab|abiword-1.2.4-5-i486.tgz|+aiksausus,+gtk2|a nice wordprocessor|
-#optionally on the end: compileddistro|compiledrelease|repo| (fields 11,12,13)
-#ex: slackware|12.2|official|
-#this is not normally needed, as the name of the file holding the database info, for ex
-#'Packages-slackware-12.2-official' identifies this extra information.
+#new: pkgname|nameonly|version|pkgrelease|category[;subcategory]|size|path|fullfilename|dependencies|description|compileddistro|compiledrelease|repo|
+#ex: abiword-1.2.4|abiword|1.2.4|5|Document|999K|slackware/ab|abiword-1.2.4-5-i486.tgz|+aiksausus,+gtk2|a nice wordprocessor|slackware|12.2|official|
 
 . /etc/DISTRO_SPECS
 . /root/.packages/DISTRO_PKGS_SPECS
 . /root/.packages/DISTRO_PET_REPOS
 
@@ -26,10 +23,11 @@
 mkdir -p /var/local/petspec #100201
 
 DEF_nameonly="abiword"
 DEF_version="1.2.3-1"
 DEF_category="BuildingBlock"
+#DEF_subcategory="" #120814
 DEF_size_val="UNKNOWN"
 #DEF_path="pet_packages-4"
 DEF_fullfilename="abiword-1.2.3-1.pet"
 DEF_dependencies="+aiksaurus,+gtk2"
 DEF_description="A powerful wordprocessor"
@@ -41,10 +39,14 @@
 
 
 if [ $5 ];then
  DEF_nameonly="$1"
  [ "$2" != "EMPTY" ] && DEF_category="$2"
+ #if [ "$2" != "EMPTY" ];then
+ # DEF_category="$(echo -n "$2" | cut -f 1 -d ';')"
+ # [ "$(echo -n "$2" | grep ';')" != "" ] && DEF_subcategory="$(echo -n "$2" | cut -f 2 -d ';')" #120814
+ #fi
  [ "$3" != "EMPTY" ] && DEF_dependencies="$3"
  [ "$3" = "EMPTY" ] && DEF_dependencies=""
  [ "$4" != "EMPTY" ] && DEF_description="$4"
  [ "$4" = "EMPTY" ] && DEF_description="no description provided"
  DEF_pkgname="$5"
@@ -77,16 +79,24 @@
 DEF_repo=""
 [ ! $9 ] && [ -f /var/local/petspec/DEF_repo ] && DEF_repo="`cat /var/local/petspec/DEF_repo`"
 [ $9 ] && [ "$9" != "EMPTY" ] && DEF_repo="${9}"
 
 #sort category items...
+#ITEMSCAT="<item>${DEF_category}</item>"
+#for ONECAT in 'NO CATEGORY' Desktop System Setup Utility Filesystem Graphic Document Calculate Personal Network Internet Multimedia Fun Help BuildingBlock Develop
+#do
+# [ "$ONECAT" = "$DEF_category" ] && continue
+# ITEMSCAT="${ITEMSCAT}<item>${ONECAT}</item>"
+#done
+#120814 add sub-categories (note, icons for all categories and sub-cat are in /usr/local/lib/X11/mini-icons) ...
 ITEMSCAT="<item>${DEF_category}</item>"
-for ONECAT in 'NO CATEGORY' Desktop System Setup Utility Filesystem Graphic Document Calculate Personal Network Internet Multimedia Fun Help BuildingBlock Develop
+for ONECAT in 'NO CATEGORY' Desktop 'Desktop;appearance' 'Desktop;applet' 'Desktop;settings' 'Desktop;sleep' 'Desktop;windows' System 'System;memory' 'System;print' 'System;process' 'System;storage' Setup 'Setup;installation' 'Setup;puppy' 'Setup;wizard' Utility 'Utility;development' 'Utility;package' 'Utility;shell' Filesystem 'Filesystem;filemanager' 'Filesystem;find' 'Filesystem;storage' Graphic 'Graphic;camera' 'Graphic;draw' 'Graphic;flow' 'Graphic;graphicutil' 'Graphic;paint' 'Graphic;print' 'Graphic;scanner' 'Graphic;viewer' Document 'Document;catalog' 'Document;doclayout' 'Document;edit' 'Document;viewer' Business 'Business;calc' 'Business;finance' 'Business;planner' 'Business;spreadsheet' Personal 'Personal;clock' 'Personal;database' 'Personal;date' 'Personal;lock' 'Personal;organizer' Network 'Network;connect' 'Network;firewall' 'Network;phone' 'Internet;transfer' 'Internet;block' 'Internet;chat' 'Internet;mailnews' 'Internet;remotelogin' 'Internet;transfer' Multimedia 'Multimedia;optical' 'Multimedia;sound' 'Multimedia;video' Fun 'Fun;adventure' 'Fun;arcade' 'Fun;boardgame' 'Fun;cardgame' 'Fun;puzzle' 'Fun;shooter' Help BuildingBlock
 do
- [ "$ONECAT" = "$DEF_category" ] && continue
+ #[ "$ONECAT" = "$DEF_category" ] && continue
  ITEMSCAT="${ITEMSCAT}<item>${ONECAT}</item>"
 done
+
 
 #sort compileddistro items...
 ITEMSCOMP="<item>${DEF_compileddistro}</item>"
 for ONECHOICE in 'DISTRO INDEPENDENT' arch debian gentoo mageia puppy raspbian scientific slackware t2 ubuntu
 do
@@ -162,10 +172,35 @@
       <action type="closewindow">VAR_DEPS</action>
     </button>
   </vbox>
  </window>'
 
+export DLG_CAT='
+ <window title="Categories" icon-name="gtk-index" window_position="1">
+  <vbox>
+    <text use-markup="true">
+     <label>"These are the top-level categories:
+
+<i>Desktop System Setup Utility Filesystem Graphic Document Business Personal Network Internet Multimedia Fun Help BuildingBlock</i>
+
+You will also find these in the top-level menu (see bottom-left of screen). You may also optionally select a sub-category, but if none seem to apply, just choose the top-level only -- for example, <b>Fun</b> has sub-categories <b>adventure</b>, <b>arcade</b>, <b>boardgame</b>, <b>cardgame</b>, <b>puzzle</b> and <b>shooter</b>, but if none of those seem to apply, just choose <b>Fun</b>.
+
+<b>BuildingBlock</b> packages are those that are system-level utilities, data and libraries, that you would not normally choose to install via the Puppy Package Manager. Thus, they are by default filtered out by the PPM. For example, <i>libsdl</i> is a library, however some applications will have it as a dependency so if you choose to install one of those, then libsdl will also get installed -- <i>libsdl</i> is not something that you would want to install on its own, thus it qualifies as a <b>BuildingBlock</b>.
+
+<b>Technical notes:</b>
+Note that the Puppy Package Manager will recognize category and subcategory, and filters packages based on category, to display a smaller selection to choose from. Packages are listed in the PPM with icons alongside, that are obtained from /usr/local/lib/X11/mini-icons -- there is a generic icon for every category and sub-category.
+
+A category, with optional subcategory, does not mean that the application has a menu entry. A menu entry will only exist if an appropriate .desktop file exists in /usr/share/applications -- this is provided in the package. The .desktop file specifies whereabouts in the menu the entry is located, and ideally we would expect it to correspond to the category;subcategory field described above, however in theory the .desktop file can place it anywhere else."</label>
+      <variable>VAR_C</variable>
+    </text>
+    <button>
+      <label>Close</label>
+      <action type="closewindow">VAR_C</action>
+    </button>
+  </vbox>
+ </window>'
+
 
 
 export MAIN_DIALOG="
 <window title=\"Package database-entry creator\" icon-name=\"gtk-index\">
  <vbox>
@@ -191,10 +226,14 @@
     </text>
 	<combobox>
       <variable>DB_category</variable>
 	  ${ITEMSCAT}
     </combobox>
+    <button>
+      <input file>/usr/local/lib/X11/mini-icons/mini-question.xpm</input>
+      <action type=\"launch\">DLG_CAT</action>
+    </button>
   </hbox>
   <hbox>
    <text><label>\"                  \"</label></text><text><label>Size of installed package:</label></text>
    <entry>
     <default>${DEF_size_val}</default><variable>DB_size_val</variable>
@@ -280,11 +319,11 @@
    </hbox>
  </vbox>
 </window>
 "
 
-RETVALS="`gtkdialog3 --program=MAIN_DIALOG`"
+RETVALS="`gtkdialog4 --program=MAIN_DIALOG`"
 #ex:
 #DB_category="BuildingBlock"
 #DB_compileddistro="ubuntu"
 #DB_compiledrelease="jaunty"
 #DB_dependencies="+aiksaurus,+gtk2"