Check-in [a9cddfa2f6]
Not logged in

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

Overview

SHA1 Hash:a9cddfa2f63a415dcd4bf2c87747643bef517f75
Date: 2012-08-31 10:43:49
User: BarryK
Comment:ppm: fixed ancient bug, choose repos in setup, correct repo radiobuttons in main window

Tags And Properties
Changes

Changes to woof-code/3builddistro

@@ -130,10 +130,11 @@
 #120720 raspbian wheezy has files in /lib/arm-linux-gnueabihf and /usr/lib/arm-linux-gnueabihf
 #120721 support ubuntu and debian arm multiarch.
 #120723 BOOT_DISABLEXORGWIZARD variable.
 #120724 'alsaconf' does not work on arm boards, BOOT_DISABLEALSACONF variable. refer /usr/sbin/alsawizard.
 #120830 my hunspell-en-us pet has pinstall.sh that creates symlinks of en_US.aff and en_US.dic from seamonkey and firefox. however, need to do this thoroughly.
+#120831 simplify repo-list radiobuttons for ppm.
 
 #v431 accepts passed params, from woof_gui_tabs:
 #$1=$CHOICE_KERNELPKG $2=$CHOICE_SCSI $3=$CHOICE_BIGMODEM $4=$CHK_FB_STATE $5=$CHK_EXOTIC_STATE $6=$CHK_RADICAL_STATE
 #100912 add $7=CHK_SIMPLE_FILENAMES
 
@@ -1512,10 +1513,19 @@
    enabledrepos="${enabledrepos}${BASEREPO} "
    repocnt=`expr $repocnt + 1`
   done
  fi
 #fi
+
+#120831 above code ok, but really just want these...
+case $DISTRO_BINARY_COMPAT in
+ ubuntu)
+  xPUPPYREPOS="Packages-puppy-${DISTRO_COMPAT_VERSION}-official Packages-puppy-common-official Packages-puppy-noarch-official"
+  xCOMPATREPOS="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-main$|\-universe$|\-multiverse$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
+  enabledrepos=" ${xCOMPATREPOS} ${xPUPPYREPOS} "
+ ;;
+esac
 
 echo "PKG_REPOS_ENABLED='${enabledrepos}'" >> rootfs-complete/root/.packages/PKGS_MANAGEMENT
 
 if [ -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then #w478
  cp -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} rootfs-complete/root/.packages/DISTRO_PKGS_SPECS

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

@@ -24,10 +24,11 @@
 #120529 ui may show app thumbnail icons.
 #120603 /root/.packages/user-installed-packages missing at first boot.
 #120515 gentoo build.
 #120811 category field now supports sub-category |category;subcategory|, use as icon in ppm main window.
 #120822 in precise puppy have a pet 'cups' instead of the ubuntu debs. the latter are various pkgs, including 'libcups2'. we don't want libcups2 showing up as a missing dependency, so have to screen these alternative names out. see also findmissingpkgs.sh.
+#120831 simplify repos radiobuttons. fixes a bug, when make selection in setup wasn't same in main window.
 
 export TEXTDOMAIN=petget___pkg_chooser.sh
 export OUTPUT_CHARSET=UTF-8
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
@@ -162,88 +163,109 @@
 repocnt=0
 COMPAT_REPO=""
 COMPAT_DBS=""
 echo -n "" > /tmp/petget_active_repo_list
 
-#100116 quirky...
-QUIRKY_DB=''
-if [ "$DISTRO_COMPAT_VERSION" != "wary5" ];then #101126
- if [ "`echo "$DISTRO_NAME" | grep -i 'quirky'`" != "" ];then
-  if [ "`echo -n "$PKG_REPOS_ENABLED" | grep 'puppy\-quirky'`" != "" ];then
-   echo 'puppy-quirky-official' >> /tmp/petget_active_repo_list
-   QUIRKY_DB='<radiobutton><label>puppy-quirky</label><action>/tmp/filterversion.sh puppy-quirky-official</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>'
-   FIRST_DB='puppy-quirky-official'
-   repocnt=1
-  fi
- fi
+#120831 simplify...
+REPOS_RADIO=""
+repocnt=0
+#sort with -puppy-* repos last...
+if [ "$DISTRO_BINARY_COMPAT" = "puppy" ];then
+ aPRE="`echo -n "$PKG_REPOS_ENABLED" | tr ' ' '\n' | grep '\-puppy\-' | tr -s '\n' | tr '\n' ' '`"
+ bPRE="`echo -n "$PKG_REPOS_ENABLED" | tr ' ' '\n' | grep -v '\-puppy\-' | tr -s '\n' | tr '\n' ' '`"
+else
+ aPRE="`echo -n "$PKG_REPOS_ENABLED" | tr ' ' '\n' | grep -v '\-puppy\-' | tr -s '\n' | tr '\n' ' '`"
+ bPRE="`echo -n "$PKG_REPOS_ENABLED" | tr ' ' '\n' | grep '\-puppy\-' | tr -s '\n' | tr '\n' ' '`"
 fi
-
-if [ "$DISTRO_BINARY_COMPAT" != "puppy" ];then #w477 if compat-distro is puppy, bypass.
- for ONE_DB in `ls -1 /root/.packages/Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}* | tr '\n' ' '`
- do
-  BASEREPO="`basename $ONE_DB`"
-  bPATTERN=' '"$BASEREPO"' '
-  [ "`echo -n "$PKG_REPOS_ENABLED" | grep "$bPATTERN"`" = "" ] && continue
-  repocnt=`expr $repocnt + 1`
-  COMPAT_REPO="`echo -n "$ONE_DB" | rev | cut -f 1 -d '/' | rev | cut -f 2-4 -d '-'`"
-  if [ "$COMPAT_DBS" = "" ];then #101205
-   COMPAT_DBS="<radiobutton><label>${COMPAT_REPO}</label><action>/tmp/filterversion.sh ${COMPAT_REPO}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
-  else
-   COMPAT_DBS="${COMPAT_DBS}
-<radiobutton><label>${COMPAT_REPO}</label><action>/tmp/filterversion.sh ${COMPAT_REPO}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
-  fi
-  echo "${COMPAT_REPO}" >> /tmp/petget_active_repo_list #read in findnames.sh
-  [ "$FIRST_DB" = "" ] && [ $repocnt = 1 ] && FIRST_DB="$COMPAT_REPO"
- done
-fi
-
-PUPPY_DBS=""
-
-#100903 another hack...
-if [ "$DISTRO_COMPAT_VERSION" == "wary5" ];then
- if [ "`echo -n "$PKG_REPOS_ENABLED" | grep 'puppy\-wary5'`" != "" ];then
-  echo 'puppy-wary5-official' >> /tmp/petget_active_repo_list
-  PUPPY_DBS='<radiobutton><label>puppy-wary5</label><action>/tmp/filterversion.sh puppy-wary5-official</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>'
-  FIRST_DB='puppy-wary5-official'
-  repocnt=1
- fi
-fi
-
-#100911 another hack...
-if [ "$DISTRO_COMPAT_VERSION" == "lucid" ];then
- if [ "`echo -n "$PKG_REPOS_ENABLED" | grep 'puppy\-lucid'`" != "" ];then
-  echo 'puppy-lucid-official' >> /tmp/petget_active_repo_list
-  PUPPY_DBS='<radiobutton><label>puppy-lucid</label><action>/tmp/filterversion.sh puppy-lucid-official</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>'
-  FIRST_DB='puppy-lucid-official'
-  repocnt=1
- fi
-fi
-
-xrepocnt=$repocnt #w476
-for ONE_DB in `ls -1 /root/.packages/Packages-puppy* | sort -r | tr '\n' ' '`
+for ONEREPO in $aPRE $bPRE #ex: ' Packages-puppy-precise-official Packages-puppy-noarch-official Packages-ubuntu-precise-main Packages-ubuntu-precise-multiverse '
 do
- BASEREPO="`basename $ONE_DB`"
- #100903 if wary5, want to list quirky repo, as has same code base...
- [ "$BASEREPO" = "Packages-puppy-quirky-official" ] && [ "$DISTRO_COMPAT_VERSION" != "wary5" ] && continue #100126 already handled above. 100903
- [ "$BASEREPO" = "Packages-puppy-wary5-official" ] && continue #100903 already handled above.
- [ "$BASEREPO" = "Packages-puppy-lucid-official" ] && continue #100911 already handled above.
- bPATTERN=' '"$BASEREPO"' '
- [ "`echo -n "$PKG_REPOS_ENABLED" | grep "$bPATTERN"`" = "" ] && continue
- PUPPY_REPO="`echo -n "$ONE_DB" | rev | cut -f 1 -d '/' | rev | cut -f 2-4 -d '-'`"
- #chop size of label down a bit, to fit in 800x600 window...
- PUPPY_REPO_CUT="`echo -n "$ONE_DB" | rev | cut -f 1 -d '/' | rev | cut -f 2,3 -d '-'`"
- PUPPY_REPO_FULL="`echo -n "$ONE_DB" | rev | cut -f 1 -d '/' | rev | cut -f 2-9 -d '-'`"
- if [ "$PUPPY_DBS" = "" ];then #101205
-  PUPPY_DBS="<radiobutton><label>${PUPPY_REPO_CUT}</label><action>/tmp/filterversion.sh ${PUPPY_REPO_FULL}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
- else
-  PUPPY_DBS="${PUPPY_DBS}
-<radiobutton><label>${PUPPY_REPO_CUT}</label><action>/tmp/filterversion.sh ${PUPPY_REPO_FULL}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
- fi
- echo "${PUPPY_REPO}" >> /tmp/petget_active_repo_list #read in findnames.sh
- [ "$FIRST_DB" = "" ] && [ $repocnt = $xrepocnt ] && FIRST_DB="$PUPPY_REPO" #w476
+ [ ! -f /root/.packages/$ONEREPO ] && continue
+ REPOCUT="`echo -n "$ONEREPO" | cut -f 2-4 -d '-'`"
+ [ "$REPOS_RADIO" = "" ] && FIRST_DB="$REPOCUT"
+ REPOS_RADIO="${REPOS_RADIO}<radiobutton><label>${REPOCUT}</label><action>/tmp/filterversion.sh ${REPOCUT}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
  repocnt=`expr $repocnt + 1`
+ [ $repocnt -ge 5 ] && break
 done
+
+##100116 quirky...
+#QUIRKY_DB=''
+#if [ "$DISTRO_COMPAT_VERSION" != "wary5" ];then #101126
+# if [ "`echo "$DISTRO_NAME" | grep -i 'quirky'`" != "" ];then
+#  if [ "`echo -n "$PKG_REPOS_ENABLED" | grep 'puppy\-quirky'`" != "" ];then
+#   echo 'puppy-quirky-official' >> /tmp/petget_active_repo_list
+#   QUIRKY_DB='<radiobutton><label>puppy-quirky</label><action>/tmp/filterversion.sh puppy-quirky-official</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>'
+#   FIRST_DB='puppy-quirky-official'
+#   repocnt=1
+#  fi
+# fi
+#fi
+#
+#if [ "$DISTRO_BINARY_COMPAT" != "puppy" ];then #w477 if compat-distro is puppy, bypass.
+# for ONE_DB in `ls -1 /root/.packages/Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}* | tr '\n' ' '`
+# do
+#  BASEREPO="`basename $ONE_DB`"
+#  bPATTERN=' '"$BASEREPO"' '
+#  [ "`echo -n "$PKG_REPOS_ENABLED" | grep "$bPATTERN"`" = "" ] && continue
+#  repocnt=`expr $repocnt + 1`
+#  COMPAT_REPO="`echo -n "$ONE_DB" | rev | cut -f 1 -d '/' | rev | cut -f 2-4 -d '-'`"
+#  if [ "$COMPAT_DBS" = "" ];then #101205
+#   COMPAT_DBS="<radiobutton><label>${COMPAT_REPO}</label><action>/tmp/filterversion.sh ${COMPAT_REPO}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
+#  else
+#   COMPAT_DBS="${COMPAT_DBS}
+#<radiobutton><label>${COMPAT_REPO}</label><action>/tmp/filterversion.sh ${COMPAT_REPO}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
+#  fi
+#  echo "${COMPAT_REPO}" >> /tmp/petget_active_repo_list #read in findnames.sh
+#  [ "$FIRST_DB" = "" ] && [ $repocnt = 1 ] && FIRST_DB="$COMPAT_REPO"
+# done
+#fi
+#
+#PUPPY_DBS=""
+#
+##100903 another hack...
+#if [ "$DISTRO_COMPAT_VERSION" == "wary5" ];then
+# if [ "`echo -n "$PKG_REPOS_ENABLED" | grep 'puppy\-wary5'`" != "" ];then
+#  echo 'puppy-wary5-official' >> /tmp/petget_active_repo_list
+#  PUPPY_DBS='<radiobutton><label>puppy-wary5</label><action>/tmp/filterversion.sh puppy-wary5-official</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>'
+#  FIRST_DB='puppy-wary5-official'
+#  repocnt=1
+# fi
+#fi
+#
+##100911 another hack...
+#if [ "$DISTRO_COMPAT_VERSION" == "lucid" ];then
+# if [ "`echo -n "$PKG_REPOS_ENABLED" | grep 'puppy\-lucid'`" != "" ];then
+#  echo 'puppy-lucid-official' >> /tmp/petget_active_repo_list
+#  PUPPY_DBS='<radiobutton><label>puppy-lucid</label><action>/tmp/filterversion.sh puppy-lucid-official</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>'
+#  FIRST_DB='puppy-lucid-official'
+#  repocnt=1
+# fi
+#fi
+#
+#xrepocnt=$repocnt #w476
+#for ONE_DB in `ls -1 /root/.packages/Packages-puppy* | sort -r | tr '\n' ' '`
+#do
+# BASEREPO="`basename $ONE_DB`"
+# #100903 if wary5, want to list quirky repo, as has same code base...
+# [ "$BASEREPO" = "Packages-puppy-quirky-official" ] && [ "$DISTRO_COMPAT_VERSION" != "wary5" ] && continue #100126 already handled above. 100903
+# [ "$BASEREPO" = "Packages-puppy-wary5-official" ] && continue #100903 already handled above.
+# [ "$BASEREPO" = "Packages-puppy-lucid-official" ] && continue #100911 already handled above.
+# bPATTERN=' '"$BASEREPO"' '
+# [ "`echo -n "$PKG_REPOS_ENABLED" | grep "$bPATTERN"`" = "" ] && continue
+# PUPPY_REPO="`echo -n "$ONE_DB" | rev | cut -f 1 -d '/' | rev | cut -f 2-4 -d '-'`"
+# #chop size of label down a bit, to fit in 800x600 window...
+# PUPPY_REPO_CUT="`echo -n "$ONE_DB" | rev | cut -f 1 -d '/' | rev | cut -f 2,3 -d '-'`"
+# PUPPY_REPO_FULL="`echo -n "$ONE_DB" | rev | cut -f 1 -d '/' | rev | cut -f 2-9 -d '-'`"
+# if [ "$PUPPY_DBS" = "" ];then #101205
+#  PUPPY_DBS="<radiobutton><label>${PUPPY_REPO_CUT}</label><action>/tmp/filterversion.sh ${PUPPY_REPO_FULL}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
+# else
+#  PUPPY_DBS="${PUPPY_DBS}
+#<radiobutton><label>${PUPPY_REPO_CUT}</label><action>/tmp/filterversion.sh ${PUPPY_REPO_FULL}</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>"
+# fi
+# echo "${PUPPY_REPO}" >> /tmp/petget_active_repo_list #read in findnames.sh
+# [ "$FIRST_DB" = "" ] && [ $repocnt = $xrepocnt ] && FIRST_DB="$PUPPY_REPO" #w476
+# repocnt=`expr $repocnt + 1`
+#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/current-repo-triad #ex: slackware-12.2-official
@@ -301,28 +323,29 @@
 #120515 ditto for gentoo build...
 if [ "$DISTRO_BINARY_COMPAT" = "gentoo" ];then #reintroduce the 'ALL' category.
  ALLCATEGORY="<radiobutton><label>$(gettext 'ALL')</label><action>/usr/local/petget/filterpkgs.sh ALL</action><action>refresh:TREE1</action></radiobutton>"
 fi
 
-#w476 reverse COMPAT_DBS, PUPPY_DBS...
-#100412 make sure first radiobutton matches list of pkgs...
-#101205 bugfix...
-DB_ORDERED="${QUIRKY_DB}
-${PUPPY_DBS}
-${COMPAT_DBS}"
-FIRST_DB_cut="`echo -n "$FIRST_DB" | cut -f 1,2 -d '-' | sed -e 's%\\-%\\\\-%g'`" #ex: puppy-lucid-official cut to puppy\-lucid.
-fdPATTERN='>'"$FIRST_DB_cut"'<'
-DB_temp0="`echo "$DB_ORDERED" | sed -e 's%^$%%' | grep "$fdPATTERN"`"
-if [ ! "$DB_temp0" ];then #120327 above may fail.
- #ex: FIRST_DB=ubuntu-precise-main, DB_ORDERED=puppy-precise\npuppy-noarch\nubuntu-precise-main\nubuntu-precise-multiverse
- FIRST_DB_cut="`echo -n "$FIRST_DB" | cut -f 1,2,3 -d '-' | sed -e 's%\\-%\\\\-%g'`" #ex: ubuntu-precise-main becomes ubuntu\-precise\-main
- fdPATTERN='>'"$FIRST_DB_cut"'<'
- DB_temp0="`echo "$DB_ORDERED" | sed -e 's%^$%%' | grep "$fdPATTERN"`"
-fi
-DB_temp1="`echo "$DB_ORDERED" | sed -e 's%^$%%' | grep -v "$fdPATTERN"`"
-DB_ORDERED="$DB_temp0
-$DB_temp1"
+DB_ORDERED="$REPOS_RADIO" #120831
+##w476 reverse COMPAT_DBS, PUPPY_DBS...
+##100412 make sure first radiobutton matches list of pkgs...
+##101205 bugfix...
+#DB_ORDERED="${QUIRKY_DB}
+#${PUPPY_DBS}
+#${COMPAT_DBS}"
+#FIRST_DB_cut="`echo -n "$FIRST_DB" | cut -f 1,2 -d '-' | sed -e 's%\\-%\\\\-%g'`" #ex: puppy-lucid-official cut to puppy\-lucid.
+#fdPATTERN='>'"$FIRST_DB_cut"'<'
+#DB_temp0="`echo "$DB_ORDERED" | sed -e 's%^$%%' | grep "$fdPATTERN"`"
+#if [ ! "$DB_temp0" ];then #120327 above may fail.
+# #ex: FIRST_DB=ubuntu-precise-main, DB_ORDERED=puppy-precise\npuppy-noarch\nubuntu-precise-main\nubuntu-precise-multiverse
+# FIRST_DB_cut="`echo -n "$FIRST_DB" | cut -f 1,2,3 -d '-' | sed -e 's%\\-%\\\\-%g'`" #ex: ubuntu-precise-main becomes ubuntu\-precise\-main
+# fdPATTERN='>'"$FIRST_DB_cut"'<'
+# DB_temp0="`echo "$DB_ORDERED" | sed -e 's%^$%%' | grep "$fdPATTERN"`"
+#fi
+#DB_temp1="`echo "$DB_ORDERED" | sed -e 's%^$%%' | grep -v "$fdPATTERN"`"
+#DB_ORDERED="$DB_temp0
+#$DB_temp1"
 
 #  <text use-markup=\"true\"><label>\"<b>Just click on a package!</b>\"</label></text>
 #  <text><label>\" \"</label></text>
 
 #110118 alternate User Interfaces...