woof_gui_tabs 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035
  1. #!/usr/sbin/gtkdialog -e
  2. #(c) Copyright Barry Kauler 2009
  3. #This is a GUI frontend for Woof.
  4. #100617 add support for slackware .txz pkgs.
  5. #100730 fix for pet pkg search order.
  6. #100912 checkbox to choose simple or traditional filenames.
  7. #110422 DISTRO_VERSION variable now has dotted format. note, also now using full dotted version# in puppy filenames.
  8. #110608 simplify pet pkg search order.
  9. #110821 updates.
  10. #120522 wary 5.3: 'pidof woof_gui' no longer works! but, busybox applet does.
  11. #120719 support raspbian.
  12. #121102 file DISTRO_SPECS has new variable DISTRO_DB_SUBNAME. ex: for 14.0-based slacko, DISTRO_DB_SUBNAME=slacko14
  13. #121102 Packages-puppy-${DISTRO_FILE_PREFIX}- (or Packages-puppy-${DISTRO_COMPAT_VERSION}-) is now Packages-puppy-${DISTRO_DB_SUBNAME}-. refer /etc/DISTRO_SPECS.
  14. #121105 restore other variables that may have been in prior DISTRO_SPECS.
  15. #130306 arch linux: gz now xz. maybe only 'DISTRO_COMPAT_REPOS-arch'. more arch stuff.
  16. if [ "`busybox pidof woof_gui`" = "" ];then
  17. echo "Please run 'woof_gui' script"
  18. exit
  19. fi
  20. DEFAULTTABNUM="0"
  21. [ $1 ] && DEFAULTTABNUM="$1"
  22. #Specifications
  23. [ ! -f DISTRO_SPECS ] && exit
  24. . ./DISTRO_SPECS
  25. [ ! "$DISTRO_DB_SUBNAME" ] && DISTRO_DB_SUBNAME="$DISTRO_COMPAT_VERSION" #121102 fallback if DISTRO_DB_SUBNAME not defined in file DISTRO_SPECS.
  26. . ./support/HISTORY_DISTRO_SPECS
  27. . ./DISTRO_PET_REPOS
  28. DCRFILE=''
  29. if [ -f ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  30. . ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  31. DCRFILE="DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}" #130306
  32. else
  33. . ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT} #130306
  34. DCRFILE="DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}"
  35. fi
  36. if [ -f ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  37. . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  38. DPSFILE="DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}"
  39. else
  40. . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}
  41. DPSFILE="DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}"
  42. fi
  43. . ./support/HISTORY_3builddistro
  44. [ ! "$DISTRO_NAME" ] && DISTRO_NAME='Puppy'
  45. [ ! "$DISTRO_FILE_PREFIX" ] && DISTRO_FILE_PREFIX='pup'
  46. [ "$DISTRO_VERSION" = "" ] && DISTRO_VERSION='5.0'
  47. [ ! "$DISTRO_COMPAT_VERSION" ] && DISTRO_COMPAT_VERSION='5'
  48. [ ! "$DISTRO_BINARY_COMPAT" ] && DISTRO_BINARY_COMPAT='puppy'
  49. #110422[ ! $DISTRO_MINOR_VERSION ] && DISTRO_MINOR_VERSION=00
  50. BINARIES='deb' #download to packages-deb.
  51. [ "$DISTRO_BINARY_COMPAT" = "t2" ] && BINARIES="bz2" #download to packages-bz2-${DISTRO_COMPAT_VERSION}.
  52. [ "$DISTRO_BINARY_COMPAT" = "slackware" ] && BINARIES="tgz_txz" #100617 download to packages-tgz_txz-${DISTRO_COMPAT_VERSION}.
  53. [ "$DISTRO_BINARY_COMPAT" = "debian" ] && BINARIES="deb" #download to packages-deb-${DISTRO_COMPAT_VERSION}.
  54. [ "$DISTRO_BINARY_COMPAT" = "arch" ] && BINARIES="tar_xz" #download to packages-tar_gz-${DISTRO_COMPAT_VERSION}. 130306
  55. [ "$DISTRO_BINARY_COMPAT" = "puppy" ] && BINARIES="pet" #built entirely from pet pkgs.
  56. [ "$DISTRO_BINARY_COMPAT" = "scientific" ] && BINARIES="rpm" #110523 Iguleder: download to packages-rpm-${DISTRO_COMPAT_VERSION}.
  57. [ "$DISTRO_BINARY_COMPAT" = "mageia" ] && BINARIES="rpm" #110615
  58. [ "$DISTRO_BINARY_COMPAT" = "gentoo" ] && BINARIES="gentoo" #120515 download to packages-gentoo-gap6
  59. [ "$DISTRO_BINARY_COMPAT" = "raspbian" ] && BINARIES="deb_raspbian" #download to packages-deb_raspbian-${DISTRO_COMPAT_VERSION}.
  60. BINARIES="${BINARIES}-${DISTRO_COMPAT_VERSION}"
  61. #run this stuff at first entry only...
  62. ALLPS="`ps`"
  63. if [ "`echo "$ALLPS" | grep 'gtkdialog -i ./woof_gui_tabs'`" = "" ];then
  64. #if [ -f /usr/sbin/gtkdialog3 ];then #110813
  65. # ln -s gtkdialog3 /usr/sbin/gtkdialog
  66. #else
  67. # ln -s gtkdialog /usr/sbin/gtkdialog3
  68. #fi
  69. touch support/HISTORY_DISTRO_SPECS
  70. echo "$DISTRO_NAME" > /tmp/woof_gui_dn
  71. echo "$DISTRO_FILE_PREFIX" > /tmp/woof_gui_dfp
  72. echo "$DISTRO_COMPAT_VERSION" > /tmp/woof_gui_dcv
  73. echo "$PET_REPOS" | sed -e 's% $%%' | tr ' ' '\n' > /tmp/woof_gui_pet_repos
  74. xPET_REPOS="$PET_REPOS"
  75. echo "$PKG_DOCS_PET_REPOS" | sed -e 's% $%%' | tr ' ' '\n' > /tmp/woof_gui_pkg_docs_pet_repos
  76. xPKG_DOCS_PET_REPOS="$PKG_DOCS_PET_REPOS"
  77. echo "$REPOS_DISTRO_COMPAT" | sed -e 's% $%%' | tr ' ' '\n' > /tmp/woof_gui_compat_repos
  78. COMPAT_REPOS="$REPOS_DISTRO_COMPAT" #alternate name used in this script.
  79. xCOMPAT_REPOS="$COMPAT_REPOS"
  80. echo "$PKG_DOCS_DISTRO_COMPAT" | sed -e 's% $%%' | tr ' ' '\n' > /tmp/woof_gui_pkg_docs_compat_repos
  81. PKG_DOCS_COMPAT_REPOS="$PKG_DOCS_DISTRO_COMPAT" #alternative name used in this script.
  82. xPKG_DOCS_COMPAT_REPOS="$PKG_DOCS_COMPAT_REPOS"
  83. fi
  84. xDISTRO_KERNEL_PET="$DISTRO_KERNEL_PET" #100514
  85. ########Specifications tab#######
  86. update_distro_specs_func() {
  87. # if [ "$xHISTORY_DISTRO_SPECS_TEMPLATE" != "$HISTORY_DISTRO_SPECS_TEMPLATE" ];then
  88. if [ "$xHISTORY_DISTRO_SPECS_TEMPLATE" != "settings as above" ];then
  89. HDSTpostfix="`echo -n "$xHISTORY_DISTRO_SPECS_TEMPLATE" | tr ' ' '_'`"
  90. #change all the variables to template values...
  91. . support/HISTORY_DISTRO_SPECS_TEMPLATE_${HDSTpostfix}
  92. xDISTRO_NAME="$DISTRO_NAME"
  93. xDISTRO_VERSION="$DISTRO_VERSION"
  94. xDISTRO_BINARY_COMPAT="$DISTRO_BINARY_COMPAT"
  95. xDISTRO_FILE_PREFIX="$DISTRO_FILE_PREFIX"
  96. xDISTRO_COMPAT_VERSION="$DISTRO_COMPAT_VERSION"
  97. xDISTRO_KERNEL_PET="$DISTRO_KERNEL_PET" #100514
  98. xDISTRO_XORG_AUTO="DISTRO_XORG_AUTO" #110821
  99. fi
  100. # if [ "$xDISTRO_BINARY_COMPAT" = "puppy" ];then
  101. # case $xDISTRO_COMPAT_VERSION in
  102. # 2|3|4|5|6|7|8|9)
  103. # echo
  104. # ;;
  105. # *)
  106. # xmessage -center -bg red "ERROR:
  107. #When the compatible-distro is 'puppy', the 'compatible-distro-version' must be
  108. #set to a single-digit number, ex '4' (to build from the Puppy 4.x PET packages)"
  109. # return
  110. # ;;
  111. # esac
  112. # fi
  113. nDFP=`echo -n "$xDISTRO_FILE_PREFIX" | wc -c`
  114. # [ $nDFP -gt 4 ] && xmessage -center -bg pink "WARNING:
  115. #DISTRO_FILE_PREFIX=${xDISTRO_FILE_PREFIX}, but recommend this be four characters or less,
  116. #if you want to keep the Puppy files such as ${xDISTRO_FILE_PREFIX}-${xDISTRO_VERSION}.sfs within the
  117. #MSDOS-compatible 8+3 filename limit (recommended in some boot situations)"
  118. DPSFILE=''
  119. if [ -f DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION} ];then
  120. DPSFILE="DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}"
  121. else
  122. [ -f DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT} ] && DPSFILE="DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}"
  123. fi
  124. if [ "$DPSFILE" = "" ];then
  125. xmessage -center -bg red "ERROR:
  126. The 'Packages' and later tabs need a configuration file named 'DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}',
  127. which does not exist. This file has a table of what packages are to be included in the
  128. build of Puppy.
  129. If there is a similarly-named file, 'DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-<something>',
  130. a good starting point is to make a copy of it, named 'DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}'.
  131. Aborting changes to file DISTRO_SPECS"
  132. return
  133. fi
  134. DCRFILE=''
  135. if [ -f DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION} ];then
  136. DCRFILE="DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}"
  137. else
  138. [ -f DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT} ] && DCRFILE="DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}"
  139. fi
  140. if [ "$DCRFILE" = "" ];then #130306
  141. xmessage -center -bg red "ERROR:
  142. The 'Compat repos' and later tabs need a configuration file named 'DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}',
  143. which does not exist. This file specifies the URLs where the compatible-distro packages
  144. can be downloaded from.
  145. If there is a similarly-named file, 'DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-<something>',
  146. a good starting point is to make a copy of it, named 'DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}'.
  147. Aborting changes to file DISTRO_SPECS"
  148. return
  149. fi
  150. cp -f DISTRO_SPECS /tmp/DISTRO_SPECS-backup
  151. cp -f support/HISTORY_DISTRO_SPECS /tmp/HISTORY_DISTRO_SPECS-backup
  152. HISTORY_DISTRO_NAME="`echo "$HISTORY_DISTRO_NAME" | head -n 10 | grep -v "^${xDISTRO_NAME}$"`"
  153. HISTORY_DISTRO_NAME="$xDISTRO_NAME
  154. $HISTORY_DISTRO_NAME"
  155. echo "HISTORY_DISTRO_NAME='${HISTORY_DISTRO_NAME}'" > support/HISTORY_DISTRO_SPECS
  156. echo '#One or more words that identify this distribution:' > DISTRO_SPECS
  157. echo "DISTRO_NAME='${xDISTRO_NAME}'" >> DISTRO_SPECS
  158. echo '#version number of this distribution:' >> DISTRO_SPECS
  159. echo "DISTRO_VERSION=${xDISTRO_VERSION}" >> DISTRO_SPECS
  160. #echo '#A two-digit numeric value, minor-version number of this distribution:' >> DISTRO_SPECS
  161. #echo "DISTRO_MINOR_VERSION=${xDISTRO_MINOR_VERSION}" >> DISTRO_SPECS
  162. echo '#The distro whose binary packages were used to build this distribution:' >> DISTRO_SPECS
  163. echo "DISTRO_BINARY_COMPAT='${xDISTRO_BINARY_COMPAT}'" >> DISTRO_SPECS
  164. echo '#Prefix for some filenames: exs: '"${xDISTRO_FILE_PREFIX}save.2fs, ${xDISTRO_FILE_PREFIX}-${xDISTRO_VERSION}.sfs" >> DISTRO_SPECS
  165. HISTORY_DISTRO_FILE_PREFIX="`echo "$HISTORY_DISTRO_FILE_PREFIX" | head -n 10 | grep -v "^${xDISTRO_FILE_PREFIX}$"`"
  166. HISTORY_DISTRO_FILE_PREFIX="$xDISTRO_FILE_PREFIX
  167. $HISTORY_DISTRO_FILE_PREFIX"
  168. echo "HISTORY_DISTRO_FILE_PREFIX='${HISTORY_DISTRO_FILE_PREFIX}'" >> support/HISTORY_DISTRO_SPECS
  169. echo "DISTRO_FILE_PREFIX='${xDISTRO_FILE_PREFIX}'" >> DISTRO_SPECS
  170. echo '#The version of the distro whose binary packages were used to build this distro:' >> DISTRO_SPECS
  171. HISTORY_DISTRO_COMPAT_VERSION="`echo "$HISTORY_DISTRO_COMPAT_VERSION" | head -n 10 | grep -v "^${xDISTRO_COMPAT_VERSION}$"`"
  172. HISTORY_DISTRO_COMPAT_VERSION="$xDISTRO_COMPAT_VERSION
  173. $HISTORY_DISTRO_COMPAT_VERSION"
  174. echo "HISTORY_DISTRO_COMPAT_VERSION='${HISTORY_DISTRO_COMPAT_VERSION}'" >> support/HISTORY_DISTRO_SPECS
  175. echo "DISTRO_COMPAT_VERSION='${xDISTRO_COMPAT_VERSION}'" >> DISTRO_SPECS
  176. if [ "$xDISTRO_KERNEL_PET" ];then #100514
  177. echo '#the kernel pet package used:' >> DISTRO_SPECS
  178. #echo "DISTRO_KERNEL_PET='${CHOICE_KERNELPKG}'" >> support/HISTORY_DISTRO_SPECS
  179. echo "DISTRO_KERNEL_PET='${CHOICE_KERNELPKG}'" >> DISTRO_SPECS
  180. fi
  181. if [ "$xDISTRO_XORG_AUTO" ];then #110821
  182. echo '#read by /usr/bin/xwin to bypass Xorg Wizard at first boot:' >> DISTRO_SPECS
  183. echo "DISTRO_XORG_AUTO='$xDISTRO_XORG_AUTO'" >> DISTRO_SPECS
  184. fi
  185. #echo '#Earlier DISTRO_SPECS than was built in Woof:' >> support/HISTORY_DISTRO_SPECS
  186. #echo "HISTORY_DISTRO_SPECS_TEMPLATE='${xHISTORY_DISTRO_SPECS_TEMPLATE}'" >> support/HISTORY_DISTRO_SPECS
  187. # echo "HISTORY_DISTRO_SPECS_TEMPLATES='${HISTORY_DISTRO_SPECS_TEMPLATES}'" >> support/HISTORY_DISTRO_SPECS
  188. #export XDIALOG_HIGH_DIALOG_COMPAT=1
  189. #121105 restore other variables that may have been in prior DISTRO_SPECS...
  190. for ONEDISTROVAR in `grep -o '^DISTRO_[^# =]*' /tmp/DISTRO_SPECS-backup | tr '\n' ' '`
  191. do
  192. odvPTN="^${ONEDISTROVAR}="
  193. if [ "`grep "$odvPTN" ./DISTRO_SPECS`" == "" ];then
  194. grep "$odvPTN" /tmp/DISTRO_SPECS-backup >> ./DISTRO_SPECS
  195. fi
  196. done
  197. Xdialog --center --title "DISTRO_SPECS" --backtitle "This is now the content of file 'DISTRO_SPECS'. Click OK button to continue" --no-cancel --textbox ./DISTRO_SPECS 0 0
  198. }
  199. ITEMSCOMP="<item>${DISTRO_BINARY_COMPAT}</item>"
  200. for ONECHOICE in arch debian mageia puppy raspbian scientific slackware t2 ubuntu
  201. do
  202. [ "$ONECHOICE" = "$DISTRO_BINARY_COMPAT" ] && continue
  203. ITEMSCOMP="${ITEMSCOMP}<item>${ONECHOICE}</item>"
  204. done
  205. echo -n "" > /tmp/woof_gui_items_hdn
  206. echo "$HISTORY_DISTRO_NAME" |
  207. while read ONECHOICE
  208. do
  209. echo -n "<item>${ONECHOICE}</item>" >> /tmp/woof_gui_items_hdn
  210. done
  211. ITEMS_HDN="`cat /tmp/woof_gui_items_hdn`"
  212. echo -n "" > /tmp/woof_gui_items_hdfp
  213. echo "$HISTORY_DISTRO_FILE_PREFIX" |
  214. while read ONECHOICE
  215. do
  216. echo -n "<item>${ONECHOICE}</item>" >> /tmp/woof_gui_items_hdfp
  217. done
  218. ITEMS_HDFP="`cat /tmp/woof_gui_items_hdfp`"
  219. echo -n "" > /tmp/woof_gui_items_hdcv
  220. echo "$HISTORY_DISTRO_COMPAT_VERSION" |
  221. while read ONECHOICE
  222. do
  223. echo -n "<item>${ONECHOICE}</item>" >> /tmp/woof_gui_items_hdcv
  224. done
  225. ITEMS_HDCV="`cat /tmp/woof_gui_items_hdcv`"
  226. HISTORY_DISTRO_SPECS_TEMPLATES="`ls -1 support/HISTORY_DISTRO_SPECS_TEMPLATE_* | sed -e 's%.*TEMPLATE_%%' -e 's%_% %g'`"
  227. #echo -n "<item>${HISTORY_DISTRO_SPECS_TEMPLATE}</item>" > /tmp/woof_gui_items_hdst
  228. echo -n "<item>settings as above</item>" > /tmp/woof_gui_items_hdst
  229. echo "$HISTORY_DISTRO_SPECS_TEMPLATES" |
  230. while read ONECHOICE
  231. do
  232. #[ "$HISTORY_DISTRO_SPECS_TEMPLATE" = "$ONECHOICE" ] && continue
  233. echo -n "<item>${ONECHOICE}</item>" >> /tmp/woof_gui_items_hdst
  234. done
  235. ITEMS_HDST="`cat /tmp/woof_gui_items_hdst`"
  236. ########PET repos tab##########
  237. edit_pet_repos_func() {
  238. cp -a -f /tmp/woof_gui_pet_repos /tmp/woof_gui_pet_repos2
  239. defaulttextviewer /tmp/woof_gui_pet_repos
  240. prDIFF="`diff -q /tmp/woof_gui_pet_repos /tmp/woof_gui_pet_repos2`"
  241. if [ "$prDIFF" != "" ];then
  242. prADD_LINE="`diff /tmp/woof_gui_pet_repos /tmp/woof_gui_pet_repos2 | grep '^< ' | head -n 1`"
  243. if [ "$prADD_LINE" != "" ];then
  244. prERR=''
  245. prADD_fc=`echo -n "$prADD_LINE" | sed -e 's%[^|]%%g' | wc -c`
  246. [ $prADD_fc -ne 2 ] && prERR="ERROR: wrong number of '|' delimiters in new entry. Aborting edit"
  247. prADD_PKGDB="`echo -n "$prADD_LINE" | cut -f 3 -d '|'`"
  248. [ "`echo "$prADD_PKGDB" | grep '^Packages-puppy-'`" = "" ] && prERR="ERROR: ${prADD_PKGDB} is named incorrectly. See Help button. Aborting change"
  249. if [ "$prERR" != "" ];then
  250. xmessage -center -bg red "$prERR"
  251. cp -a -f /tmp/woof_gui_pet_repos2 /tmp/woof_gui_pet_repos
  252. return
  253. fi
  254. fi
  255. xPET_REPOS="`cat /tmp/woof_gui_pet_repos | tr -s '\n' | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  256. echo "$xPET_REPOS" | tr ' ' '\n' > /tmp/woof_gui_pet_repos
  257. fi
  258. }
  259. edit_pkg_docs_pet_repos_func() {
  260. cp -a -f /tmp/woof_gui_pkg_docs_pet_repos /tmp/woof_gui_pkg_docs_pet_repos2
  261. defaulttextviewer /tmp/woof_gui_pkg_docs_pet_repos
  262. prDIFF="`diff -q /tmp/woof_gui_pkg_docs_pet_repos /tmp/woof_gui_pkg_docs_pet_repos2`"
  263. if [ "$prDIFF" != "" ];then
  264. prADD_LINE="`diff /tmp/woof_gui_pkg_docs_pet_repos /tmp/woof_gui_pkg_docs_pet_repos2 | grep '^< ' | head -n 1`"
  265. prERR=''
  266. prADD_fc=`echo -n "$prADD_LINE" | sed -e 's%[^|]%%g' | wc -c`
  267. [ $prADD_fc -ne 2 ] && prERR="ERROR: wrong number of '|' delimiters in new entry. Aborting edit"
  268. prADD_PKGDB="`echo -n "$prADD_LINE" | cut -f 3 -d '|'`"
  269. [ "`echo "$prADD_PKGDB" | grep '^Packages-puppy-'`" = "" ] && prERR="ERROR: ${prADD_PKGDB} is named incorrectly. See Help button. Aborting change"
  270. if [ "$prERR" != "" ];then
  271. xmessage -center -bg red "$prERR"
  272. cp -a -f /tmp/woof_gui_pkg_docs_pet_repos2 /tmp/woof_gui_pkg_docs_pet_repos
  273. return
  274. fi
  275. xPKG_DOCS_PET_REPOS="`cat /tmp/woof_gui_pkg_docs_pet_repos | tr -s '\n' | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  276. echo "$xPKG_DOCS_PET_REPOS" | tr ' ' '\n' > /tmp/woof_gui_pkg_docs_pet_repos
  277. fi
  278. }
  279. update_distro_pet_repos_func() {
  280. cp -f DISTRO_PET_REPOS /tmp/DISTRO_PET_REPOS-backup
  281. echo '#PKG_DOCS_PET_REPOS
  282. #where to download the pet pkgs databases from.
  283. #first field is for testing the url.
  284. #second field is full URI of the database file.
  285. #third field is name of db file when local and after being processed into standard format
  286. # (in the case of PET databases, the names are the same and no processing is required)' > DISTRO_PET_REPOS
  287. xPKG_DOCS_PET_REPOS="`cat /tmp/woof_gui_pkg_docs_pet_repos | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  288. echo "PKG_DOCS_PET_REPOS='${xPKG_DOCS_PET_REPOS}'" >> DISTRO_PET_REPOS
  289. echo >> DISTRO_PET_REPOS
  290. echo '#PET_REPOS
  291. #first field is for testing the url.
  292. #second field is full URI of the repo
  293. #third field is the name of db-file(s) associated with that repo. it may have glob wildcards.
  294. # ex: Packages-puppy-4-official (note, url paths are in the database)' >> DISTRO_PET_REPOS
  295. xPET_REPOS="`cat /tmp/woof_gui_pet_repos | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  296. echo "PET_REPOS='${xPET_REPOS}'" >> DISTRO_PET_REPOS
  297. # case $xDISTRO_BINARY_COMPAT in
  298. # puppy)
  299. # #w478 2/3: append Packages-puppy-4-official as a fallback, for some arch-independent pkgs...
  300. # case $xDISTRO_COMPAT_VERSION in #100730 110608
  301. # 2) xPACKAGELISTS_PET_ORDER="Packages-puppy-common-official Packages-puppy-2-official Packages-puppy-4-official" ;;
  302. # 3) xPACKAGELISTS_PET_ORDER="Packages-puppy-common-official Packages-puppy-3-official Packages-puppy-4-official" ;;
  303. # 4) xPACKAGELISTS_PET_ORDER="Packages-puppy-common-official Packages-puppy-4-official Packages-puppy-3-official" ;;
  304. # *) xPACKAGELISTS_PET_ORDER="Packages-puppy-${xDISTRO_COMPAT_VERSION}-official Packages-puppy-common-official Packages-puppy-quirky-official Packages-puppy-4-official" ;;
  305. # esac
  306. # ;;
  307. # *)
  308. # xPACKAGELISTS_PET_ORDER="Packages-puppy-common-official Packages-puppy-quirky-official Packages-puppy-4-official"
  309. # ;;
  310. # esac
  311. # echo >> DISTRO_PET_REPOS
  312. # echo '#this defines where Woof looks first and second (and third, etc.) for pet pkgs' >> DISTRO_PET_REPOS
  313. # echo "PACKAGELISTS_PET_ORDER='${xPACKAGELISTS_PET_ORDER}'" >> DISTRO_PET_REPOS
  314. #110608 simplify search order...
  315. xPACKAGELISTS_PET_ORDER='Packages-puppy-common-official Packages-puppy-4-official'
  316. #exs of DISTRO_COMPAT_VERSION: wary5, lucid, 4
  317. [ "$xDISTRO_COMPAT_VERSION" != "4" ] && [ -f Packages-puppy-${xDISTRO_COMPAT_VERSION}-official ] && xPACKAGELISTS_PET_ORDER="Packages-puppy-${xDISTRO_COMPAT_VERSION}-official ${xPACKAGELISTS_PET_ORDER}"
  318. echo "PACKAGELISTS_PET_ORDER='${xPACKAGELISTS_PET_ORDER}'" >> DISTRO_PET_REPOS
  319. Xdialog --center --title "DISTRO_PET_REPOS" --backtitle "This is now the content of file 'DISTRO_PET_REPOS'. Click OK button to continue" --no-cancel --textbox ./DISTRO_PET_REPOS 0 0
  320. }
  321. #########Compat repos tab#####
  322. edit_compat_repos_func() {
  323. cp -a -f /tmp/woof_gui_compat_repos /tmp/woof_gui_compat_repos2
  324. defaulttextviewer /tmp/woof_gui_compat_repos
  325. prDIFF="`diff -q /tmp/woof_gui_compat_repos /tmp/woof_gui_compat_repos2`"
  326. if [ "$prDIFF" != "" ];then
  327. prADD_LINE="`diff /tmp/woof_gui_compat_repos /tmp/woof_gui_compat_repos2 | grep '^< ' | head -n 1`"
  328. if [ "$prADD_LINE" != "" ];then
  329. prERR=''
  330. prADD_fc=`echo -n "$prADD_LINE" | sed -e 's%[^|]%%g' | wc -c`
  331. [ $prADD_fc -ne 2 ] && prERR="ERROR: wrong number of '|' delimiters in new entry. Aborting edit"
  332. prADD_PKGDB="`echo -n "$prADD_LINE" | cut -f 3 -d '|'`"
  333. [ "`echo "$prADD_PKGDB" | grep '^Packages-'`" = "" ] && prERR="ERROR: ${prADD_PKGDB} is named incorrectly. See Help button. Aborting change"
  334. if [ "$prERR" != "" ];then
  335. xmessage -center -bg red "$prERR"
  336. cp -a -f /tmp/woof_gui_compat_repos2 /tmp/woof_gui_compat_repos
  337. return
  338. fi
  339. fi
  340. xCOMPAT_REPOS="`cat /tmp/woof_gui_compat_repos | tr -s '\n' | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  341. echo "$xCOMPAT_REPOS" | tr ' ' '\n' > /tmp/woof_gui_compat_repos
  342. fi
  343. }
  344. edit_pkg_docs_compat_repos_func() {
  345. cp -a -f /tmp/woof_gui_pkg_docs_compat_repos /tmp/woof_gui_pkg_docs_compat_repos2
  346. defaulttextviewer /tmp/woof_gui_pkg_docs_compat_repos
  347. prDIFF="`diff -q /tmp/woof_gui_pkg_docs_compat_repos /tmp/woof_gui_pkg_docs_compat_repos2`"
  348. if [ "$prDIFF" != "" ];then
  349. prADD_LINE="`diff /tmp/woof_gui_pkg_docs_compat_repos /tmp/woof_gui_pkg_docs_compat_repos2 | grep '^< ' | head -n 1`"
  350. prERR=''
  351. prADD_fc=`echo -n "$prADD_LINE" | sed -e 's%[^|]%%g' | wc -c`
  352. [ $prADD_fc -ne 2 ] && prERR="ERROR: wrong number of '|' delimiters in new entry. Aborting edit"
  353. prADD_PKGDB="`echo -n "$prADD_LINE" | cut -f 3 -d '|'`"
  354. [ "`echo "$prADD_PKGDB" | grep '^Packages-'`" = "" ] && prERR="ERROR: ${prADD_PKGDB} is named incorrectly. See Help button. Aborting change"
  355. if [ "$prERR" != "" ];then
  356. xmessage -center -bg red "$prERR"
  357. cp -a -f /tmp/woof_gui_pkg_docs_compat_repos2 /tmp/woof_gui_pkg_docs_compat_repos
  358. return
  359. fi
  360. xPKG_DOCS_COMPAT_REPOS="`cat /tmp/woof_gui_pkg_docs_compat_repos | tr -s '\n' | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  361. echo "$xPKG_DOCS_COMPAT_REPOS" | tr ' ' '\n' > /tmp/woof_gui_pkg_docs_compat_repos
  362. fi
  363. }
  364. update_distro_compat_repos_func() {
  365. #cp -f DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} /tmp/DISTRO_COMPAT_REPOS-backup
  366. cp -f $DCRFILE /tmp/DISTRO_COMPAT_REPOS-backup #130306
  367. echo '#PKG_DOCS_DISTRO_COMPAT
  368. #where to download the compatible-distro pkgs databases from.
  369. #first field is for testing the url.
  370. #second field is full URI of the database file.
  371. #third field is name of db file when local and after being processed into standard format' > $DCRFILE #130306 DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  372. xPKG_DOCS_COMPAT_REPOS="`cat /tmp/woof_gui_pkg_docs_compat_repos | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  373. echo "PKG_DOCS_DISTRO_COMPAT='${xPKG_DOCS_COMPAT_REPOS}'" >> $DCRFILE #130306 DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  374. #echo 'PKG_DOCS_DISTRO_COMPAT="$PKG_DOCS_COMPAT_REPOS" #older equiv. name.' >> DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  375. echo >> $DCRFILE #130306 DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  376. echo '#REPOS_DISTRO_COMPAT
  377. #first field is for testing the url.
  378. #second field is full URI of the repo
  379. #third field is the name of db-file(s) associated with that repo. it may have glob wildcards.' >> $DCRFILE #130306 DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  380. xCOMPAT_REPOS="`cat /tmp/woof_gui_compat_repos | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  381. echo "REPOS_DISTRO_COMPAT='${xCOMPAT_REPOS}'" >> $DCRFILE #130306 DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  382. #echo 'REPOS_DISTRO_COMPAT="$COMPAT_REPOS" #older equiv. name.' >> DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  383. Xdialog --center --title "${DCRFILE}" --backtitle "This is now the content of file '${DCRFILE}'. Click OK button to continue" --no-cancel --textbox ./${DCRFILE} 0 0 #130306
  384. }
  385. #####Download dbs######
  386. PET_REPOS_LIST_ONLINE="`echo "$PKG_DOCS_PET_REPOS" | tr ' ' '\n' | cut -f 3 -d '|' | sort -u`"
  387. PET_REPOS_LIST_LOCAL="`ls -1 Packages-puppy-*`"
  388. echo -n "" > /tmp/PET_REPOS_LIST_LOCAL
  389. for ONE_DB in $PET_REPOS_LIST_LOCAL
  390. do
  391. [ "`echo "$PET_REPOS_LIST_ONLINE" | grep "^${ONE_DB}$"`" != "" ] && echo "$ONE_DB" >> /tmp/PET_REPOS_LIST_LOCAL
  392. done
  393. PET_REPOS_LIST_LOCAL="`cat /tmp/PET_REPOS_LIST_LOCAL`"
  394. PKG_DOCS_DISTRO_COMPAT_LIST_ONLINE="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | sort -u`"
  395. echo -n "" > /tmp/PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL
  396. for ONE_DB in $PKG_DOCS_DISTRO_COMPAT_LIST_ONLINE
  397. do
  398. [ -f $ONE_DB ] && echo "$ONE_DB" >> /tmp/PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL
  399. done
  400. PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL="`cat /tmp/PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL`"
  401. #in some cases, the "online" db is not available online. Then 1st and 2nd fields are empty...
  402. PKG_DOCS_DISTRO_COMPAT_LIST_ONLINE="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | grep -v '||' | cut -f 3 -d '|' | sort -u`"
  403. report_0setup_func() {
  404. if [ ! -f /var/woof/0setup_fail_report_no ];then
  405. xmessage -center -bg red "ERROR: Must run 'UPDATE' first"
  406. return
  407. fi
  408. xmessage -center -bg pink "`cat /var/woof/0setup_fail_report_no`"
  409. }
  410. ########Choose pkgs#######
  411. #has 2 variables, FALLBACKS_COMPAT_VERSIONS and PKGS_SPECS_TABLE
  412. if [ ! -f /tmp/CHOSEN_PET_PKGS -o ! -f /tmp/CHOSEN_COMPAT_PKGS ];then
  413. xmessage -center -bg orange -buttons "" "Please wait, processing..." &
  414. WAITPID=$!
  415. CHOSEN_PET_PKGS="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep '||' | cut -f 2 -d '|'`"
  416. #add a description...
  417. echo -n "" > /tmp/CHOSEN_PET_PKGS
  418. for ONE_CPP in $CHOSEN_PET_PKGS
  419. do
  420. ocppPATTERN='|'"$ONE_CPP"'|'
  421. ocppDESCR="`cat $PACKAGELISTS_PET_ORDER | grep "$ocppPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  422. echo "${ONE_CPP}|${ocppDESCR}" >> /tmp/CHOSEN_PET_PKGS
  423. done
  424. #add a description...
  425. echo -n "" > /tmp/CHOSEN_COMPAT_PKGS
  426. if [ "$DISTRO_BINARY_COMPAT" = "puppy" ];then
  427. CHOSEN_COMPAT_PKGS="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep -v '||' | cut -f 2 -d '|'`"
  428. PACKAGELISTS_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | tr '\n' ' '`"
  429. for ONE_CCP in $CHOSEN_COMPAT_PKGS
  430. do
  431. occpPATTERN='|'"$ONE_CCP"'|'
  432. occpDESCR="`cat $PACKAGELISTS_COMPAT | grep "$occpPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  433. echo "${ONE_CCP}|${occpDESCR}" >> /tmp/CHOSEN_COMPAT_PKGS
  434. done
  435. else
  436. CHOSEN_COMPAT_PKGS="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep -v '||' | cut -f 2,3 -d '|'`"
  437. PACKAGELISTS_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | tr '\n' ' '`"
  438. for ONE_CCP in $CHOSEN_COMPAT_PKGS
  439. do
  440. ccpCOMPAT="`echo -n "$ONE_CCP" | cut -f 2 -d '|' | cut -f 1 -d ','`"
  441. ccpGENERIC="`echo -n "$ONE_CCP" | cut -f 1 -d '|'`"
  442. occpPATTERN='|'"$ccpGENERIC"'|'
  443. ccpcPATTERN='|'"$ccpCOMPAT"'|'
  444. occpDESCR="`cat $PACKAGELISTS_COMPAT | grep "$occpPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  445. [ "$occpDESCR" = "" ] && occpDESCR="`cat $PACKAGELISTS_COMPAT | grep "$ccpcPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  446. echo "${ccpGENERIC}|${occpDESCR}" >> /tmp/CHOSEN_COMPAT_PKGS
  447. done
  448. fi
  449. #echo "$CHOSEN_COMPAT_PKGS" > /tmp/CHOSEN_COMPAT_PKGS
  450. echo "$PACKAGELISTS_COMPAT" > /tmp/PACKAGELISTS_COMPAT
  451. kill $WAITPID
  452. fi
  453. add_remove_pet_pkgs_func() {
  454. xmessage -center -bg orange -buttons "" "Please wait, processing..." &
  455. WAITPID=$!
  456. ./findwoofinstalledpkgs >/dev/null #writes db entries to /tmp/woof-installed-packages-pet and /tmp/woof-installed-packages-compat
  457. #ex: bash-3.0.16-1|bash|3.0.16-1||BuildingBlock|498K|pet_packages-woof|bash-3.0.16-1.pet|+ncurses|Bash shell|puppy|412|woof|
  458. CHOSEN_ENTRIES="`cat /tmp/woof-installed-packages-pet | tr -d '"' | sed -e 's%|% %' -e 's%|% on "%' -e 's%$%"%'`" #'geany
  459. #...ex: bash-3.0.16-1 bash on "3.0.16-1||BuildingBlock|498K|pet_packages-woof|bash-3.0.16-1.pet|+ncurses|Bash shell|puppy|412|woof|"
  460. cppPATTERNS="`cat /tmp/CHOSEN_PET_PKGS | cut -f 1 -d '|' | sed -e 's%^%|%' -e 's%$%|%'`"
  461. echo "$cppPATTERNS" > /tmp/cppPATTERNS
  462. grep --file=/tmp/cppPATTERNS -v $PACKAGELISTS_PET_ORDER > /tmp/NOT_CHOSEN_PETS_DB_RAW #note: grep prepends <filename>: on each line.
  463. NOT_CHOSEN_ENTRIES="`cat /tmp/NOT_CHOSEN_PETS_DB_RAW | cut -f 2-9 -d ':' | tr -d '"' | sed -e 's%|% %' -e 's%|% off "%' -e 's%$%"%'`" #'geany
  464. #...ex: bash-3.0.16-1 bash off "3.0.16-1||BuildingBlock|498K|pet_packages-woof|bash-3.0.16-1.pet|+ncurses|Bash shell|puppy|412|woof|"
  465. kill $WAITPID
  466. EXECME="Xdialog --backtitle \"The right pane has the chosen PET packages, left pane has unchosen pkgs. Note that mouseover displays further database details\" --title \"Choose PET packages\" --left --stdout --separator \" \" --item-help --buildlist \"\" 0 0 8 ${CHOSEN_ENTRIES} ${NOT_CHOSEN_ENTRIES} >/tmp/cpp_rettags.txt"
  467. eval $EXECME
  468. if [ $? -eq 0 ];then
  469. rtPATTERNS="`cat /tmp/cpp_rettags.txt | tr ' ' '\n' | sed -e 's%^%^%' -e 's%$%|%'`"
  470. echo "$rtPATTERNS" > /tmp/rtPATTERNS
  471. NEW_CHOSEN_GENERICNAMES="`cat $PACKAGELISTS_PET_ORDER | grep --file=/tmp/rtPATTERNS | cut -f 2 -d '|' | sort -u`"
  472. OLD_CHOSEN_GENERICNAMES="`cat /tmp/woof-installed-packages-pet | cut -f 2 -d '|' | sort -u`"
  473. echo "$NEW_CHOSEN_GENERICNAMES" > /tmp/NEW_CHOSEN_GENERICNAMES
  474. echo "$OLD_CHOSEN_GENERICNAMES" > /tmp/OLD_CHOSEN_GENERICNAMES
  475. rtDIFF="`diff /tmp/OLD_CHOSEN_GENERICNAMES /tmp/NEW_CHOSEN_GENERICNAMES`"
  476. PET_ADDED="`echo "$rtDIFF" | grep '^> ' | cut -f 2 -d ' '`" #generic names only, one each line.
  477. PET_REMOVED="`echo "$rtDIFF" | grep '^< ' | cut -f 2 -d ' '`" # "
  478. if [ "$PET_REMOVED" != "" ];then
  479. prPATTERNS="`echo "$PET_REMOVED" | sed -e 's%^%|%' -e 's%$%|%'`"
  480. echo "$prPATTERNS" > /tmp/prPATTERNS
  481. PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep --file=/tmp/prPATTERNS -v`"
  482. fi
  483. ####for now, create new entry 'yes|<genericname>||exe'
  484. ####but need to ask about the last field....
  485. echo "$PKGS_SPECS_TABLE" > /tmp/PKGS_SPECS_TABLE
  486. if [ "$PET_ADDED" != "" ];then
  487. NEW_ENTRIES="`echo "$PET_ADDED" | sed -e 's%^%yes|%' -e 's%$%||exe%'`"
  488. echo "$NEW_ENTRIES" >> /tmp/PKGS_SPECS_TABLE
  489. #important note, order is important. ex, seamonkey must come before the seamonkey_addon pkgs,
  490. #as former has symlink /usr/lib/seamonkey, latter have it as an actual directory. The param
  491. #'--key=2,2' takes care of the seamonkey case, sort on field 2 only...
  492. PKGS_SPECS_TABLE="`sort --key=2,2 --field-separator='|' --unique /tmp/PKGS_SPECS_TABLE`"
  493. echo "$PKGS_SPECS_TABLE" > /tmp/PKGS_SPECS_TABLE
  494. fi
  495. #update for gui...
  496. echo -n "" > /tmp/CHOSEN_PET_PKGS
  497. for ONE_CPP in $NEW_CHOSEN_GENERICNAMES
  498. do
  499. ocppPATTERN='|'"$ONE_CPP"'|'
  500. ocppDESCR="`cat $PACKAGELISTS_PET_ORDER | grep "$ocppPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  501. echo "${ONE_CPP}|${ocppDESCR}" >> /tmp/CHOSEN_PET_PKGS
  502. done
  503. #update DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}...
  504. echo 'Fallbacks when looking for pkgs (space-separated list of distro versions)...' > ${DPSFILE}
  505. echo "FALLBACKS_COMPAT_VERSIONS='$FALLBACKS_COMPAT_VERSIONS'" >> ${DPSFILE}
  506. echo '
  507. #PKGS_SPECS_TABLE table format:
  508. #will pkg be in puppy-build.
  509. # Generic name for pkg. Note: PET packages, if exist, use this name.
  510. # Comma-separated list of compatible-distro pkg(s). "-" prefix, exclude.
  511. # Must be exact name-only of pkg, else "*" on end is wildcard to search full name.
  512. # Empty field, then use PET pkg.
  513. # How the package will get split up in woof (optional redirection ">" operator).
  514. # Missing field, it goes into exe. Can also redirect >null, means dump it.
  515. #yes|abiword|iceword,iceword-plugins|exe,dev,doc,nls
  516. #example showing wildcard. finds all full pkg names with "gcc-4.3*",
  517. #but, exclude any "gcc-4.3-doc*" matches...
  518. #yes|gcc|gcc,gcc-4.3*,-gcc-4.3-doc*|exe,dev,doc,nls
  519. ' >> ${DPSFILE}
  520. echo "PKGS_SPECS_TABLE='$PKGS_SPECS_TABLE'" >> ${DPSFILE}
  521. Xdialog --center --title "PET selection change" --msgbox "These PET packages have been added:\n
  522. ${PET_ADDED}\n
  523. These PET packages have been removed:\n
  524. ${PET_REMOVED}\n
  525. The changes have been made to variable 'PKGS_SPECS_TABLE'\n
  526. in file ${DPSFILE}" 0 0
  527. fi
  528. }
  529. add_remove_compat_pkgs_func() {
  530. if [ "$DISTRO_BINARY_COMPAT" != "puppy" ];then
  531. xmessage -center -bg pink "SORRY, currently this must be done manually."
  532. return
  533. fi
  534. xmessage -center -bg orange -buttons "" "Please wait, processing..." &
  535. WAITPID=$!
  536. ./findwoofinstalledpkgs >/dev/null #writes db entries to /tmp/woof-installed-packages-pet and /tmp/woof-installed-packages-compat
  537. #ex: abiword_2.6.6|abiword|2.6.6|0ubuntu1|Document|7808K|pool/main/a/abiword|abiword_2.6.6-0ubuntu1_i386.deb|+libaiksaurus-1.2-0c2a,+libaiksaurusgtk-1.2-0c2a,+libart-2.0-2,+libatk1.0-0,+libc6,+libcairo2,+libenchant1c2a,+libexpat1,+libfontconfig1,+libfreetype6,+libfribidi0,+libgcc1,+libglade2-0,+libglib2.0-0,+libgnomecanvas2-0,+libgnomeprint2.2-0,+libgnomeprintui2.2-0,+libgsf-1-114,+libgtk2.0-0,+libice6,+libidn11,+libjpeg62,+libloudmouth1-0,+libncurses5,+libots0,+libpango1.0-0,+libpng12-0,+libpopt0,+libreadline5,+librsvg2-2,+libsm6,+libstdc++6,+libwmf0.2-7,+libwpd8c2a,+libwpg-0.1-1,+libwv-1.2-3|efficient featureful word processor with collaboration|
  538. CHOSEN_ENTRIES="`cat /tmp/woof-installed-packages-compat | tr -d '"' | sed -e 's%|% %' -e 's%|% on "%' -e 's%$%"%'`" #'geany
  539. #...ex: abiword_2.6.6 abiword on "2.6.6|0ubuntu1|Document|7808K|pool/main/a/abiword|abiword_2.6.6-0ubuntu1_i386.deb|+libaiksaurus-1.2-0c2a,+libaiksaurusgtk-1.2-0c2a,+libart-2.0-2,+libatk1.0-0,+libc6,+libcairo2,+libenchant1c2a,+libexpat1,+libfontconfig1,+libfreetype6,+libfribidi0,+libgcc1,+libglade2-0,+libglib2.0-0,+libgnomecanvas2-0,+libgnomeprint2.2-0,+libgnomeprintui2.2-0,+libgsf-1-114,+libgtk2.0-0,+libice6,+libidn11,+libjpeg62,+libloudmouth1-0,+libncurses5,+libots0,+libpango1.0-0,+libpng12-0,+libpopt0,+libreadline5,+librsvg2-2,+libsm6,+libstdc++6,+libwmf0.2-7,+libwpd8c2a,+libwpg-0.1-1,+libwv-1.2-3|efficient featureful word processor with collaboration|"
  540. ccpPATTERNS="`cat /tmp/CHOSEN_COMPAT_PKGS | cut -f 1 -d '|' | sed -e 's%^%|%' -e 's%$%|%'`"
  541. echo "$ccpPATTERNS" > /tmp/ccpPATTERNS
  542. PACKAGELISTS_COMPAT="`cat /tmp/PACKAGELISTS_COMPAT`"
  543. grep --file=/tmp/ccpPATTERNS -v $PACKAGELISTS_COMPAT > /tmp/NOT_CHOSEN_COMPATS_DB_RAW #note: grep prepends <filename>: on each line.
  544. ####UNCHOSEN ENTRIES MAY BE TOO BIG!#####
  545. ####may need to add category filtering, plus for debian get rid of those language pkgs####
  546. # #w091018 ubuntu/debian not-chosen list is too long for Xdialog. for now, until i can think of anything better...
  547. # nceFIRST="`Xdialog --title "Choose compat-repo pkgs by alphabet" --left --stdout --no-tags --no-cancel --radiolist "Some package repos are enormous (ex: Ubuntu/Debian) and the Xdialog\n
  548. #tool used for the GUI cannot handle a long list of all of them.\n
  549. #Until I think of a better way of doing it, this cumbersome method\n
  550. #is used -- choose by first character. For example, if you want to\n
  551. #add 'sylpheed' to Puppy, choose 's' here..." 0 0 0 0-9 0-9 off aA a on bB b off cC c off dD d off eE e off fF f off gG g off hH h off iI i off jJ j off kK k off lL l off mM m off nN n off oO o off pP p off qQ q off rR r off sS s off tT t off uU u off vV v off wW w off xX x off yY y off zZ z off`"
  552. # [ "$nceFIRST" = "" -o $? -ne 0 ] && nceFIRST='aA'
  553. # ncePATTERN="^[${nceFIRST}]"
  554. # #and add ncePATTERN here to extract alphabetical pkgs only...
  555. # NOT_CHOSEN_ENTRIES="`cat /tmp/NOT_CHOSEN_COMPATS_DB_RAW | cut -f 2-9 -d ':' | grep "$ncePATTERN" | tr -d '"' | sed -e 's%|% %' -e 's%|% off "%' -e 's%$%"%'`" #'geany
  556. NOT_CHOSEN_ENTRIES="`cat /tmp/NOT_CHOSEN_COMPATS_DB_RAW | cut -f 2-9 -d ':' | tr -d '"' | sed -e 's%|% %' -e 's%|% off "%' -e 's%$%"%'`" #'geany
  557. #...ex: abiword_2.6.6 abiword off "2.6.6|0ubuntu1|Document|7808K|pool/main/a/abiword|abiword_2.6.6-0ubuntu1_i386.deb|+libaiksaurus-1.2-0c2a,+libaiksaurusgtk-1.2-0c2a,+libart-2.0-2,+libatk1.0-0,+libc6,+libcairo2,+libenchant1c2a,+libexpat1,+libfontconfig1,+libfreetype6,+libfribidi0,+libgcc1,+libglade2-0,+libglib2.0-0,+libgnomecanvas2-0,+libgnomeprint2.2-0,+libgnomeprintui2.2-0,+libgsf-1-114,+libgtk2.0-0,+libice6,+libidn11,+libjpeg62,+libloudmouth1-0,+libncurses5,+libots0,+libpango1.0-0,+libpng12-0,+libpopt0,+libreadline5,+librsvg2-2,+libsm6,+libstdc++6,+libwmf0.2-7,+libwpd8c2a,+libwpg-0.1-1,+libwv-1.2-3|efficient featureful word processor with collaboration|"
  558. #xNOT_CHOSEN_ENTRIES="`echo "$NOT_CHOSEN_ENTRIES" | tr '\n' ' '`"
  559. #xCHOSEN_ENTRIES="`echo "$CHOSEN_ENTRIES" | tr '\n' ' '`"
  560. kill $WAITPID
  561. EXECME="Xdialog --backtitle \"The right pane has the chosen packages, left pane has unchosen pkgs. Note that mouseover displays further database details\" --title \"Choose compat-distro packages\" --left --stdout --separator \" \" --item-help --buildlist \"\" 0 0 8 ${CHOSEN_ENTRIES} ${NOT_CHOSEN_ENTRIES} >/tmp/ccp_rettags.txt"
  562. echo "$EXECME" > /tmp/woof_gui_not_chosen_items #TEST
  563. eval $EXECME
  564. if [ $? -eq 0 ];then
  565. rtPATTERNS="`cat /tmp/ccp_rettags.txt | tr ' ' '\n' | sed -e 's%^%^%' -e 's%$%|%'`"
  566. echo "$rtPATTERNS" > /tmp/rtPATTERNS
  567. NEW_CHOSEN_GENERICNAMES="`cat $PACKAGELISTS_COMPAT | grep --file=/tmp/rtPATTERNS | cut -f 2 -d '|' | sort -u`"
  568. OLD_CHOSEN_GENERICNAMES="`cat /tmp/woof-installed-packages-compat | cut -f 2 -d '|' | sort -u`"
  569. echo "$NEW_CHOSEN_GENERICNAMES" > /tmp/NEW_CHOSEN_GENERICNAMES
  570. echo "$OLD_CHOSEN_GENERICNAMES" > /tmp/OLD_CHOSEN_GENERICNAMES
  571. rtDIFF="`diff /tmp/OLD_CHOSEN_GENERICNAMES /tmp/NEW_CHOSEN_GENERICNAMES`"
  572. COMPAT_ADDED="`echo "$rtDIFF" | grep '^> ' | cut -f 2 -d ' '`" #generic names only, one each line.
  573. COMPAT_REMOVED="`echo "$rtDIFF" | grep '^< ' | cut -f 2 -d ' '`" # "
  574. if [ "$COMPAT_REMOVED" != "" ];then
  575. prPATTERNS="`echo "$COMPAT_REMOVED" | sed -e 's%^%[|,]%' -e 's%$%[|,]%'`" #finds an entry in 3rd field of PKGS_SPECS_TABLE
  576. echo "$prPATTERNS" > /tmp/prPATTERNS
  577. PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep --file=/tmp/prPATTERNS -v`"
  578. fi
  579. ####for now, create new entry 'yes|<genericname>|<genericname>|exe,dev,doc,nls'
  580. ####but need to ask about the last field....
  581. ####also for debian/ubuntu many pkgs are split into smaller pkgs, may want to bring them together.
  582. ####if compat-distro=puppy, merge _DEV into any pre-existing entry (?)
  583. echo "$PKGS_SPECS_TABLE" > /tmp/PKGS_SPECS_TABLE
  584. if [ "$COMPAT_ADDED" != "" ];then
  585. #NEW_ENTRIES="`echo "$COMPAT_ADDED" | sed -e 's%^%yes|%' -e 's%$%||exe%'`"
  586. #echo "$NEW_ENTRIES" >> /tmp/PKGS_SPECS_TABLE
  587. for ONE_CA in $COMPAT_ADDED
  588. do
  589. echo "yes|${ONE_CA}|${ONE_CA}|exe,dev,doc,nls" >> /tmp/PKGS_SPECS_TABLE
  590. done
  591. #important note, order is important. ex, seamonkey must come before the seamonkey_addon pkgs,
  592. #as former has symlink /usr/lib/seamonkey, latter have it as an actual directory. The param
  593. #'--key=2,2' takes care of the seamonkey case, sort on field 2 only...
  594. PKGS_SPECS_TABLE="`sort --key=2,2 --field-separator='|' --unique /tmp/PKGS_SPECS_TABLE`"
  595. echo "$PKGS_SPECS_TABLE" > /tmp/PKGS_SPECS_TABLE
  596. fi
  597. #update for gui...
  598. echo -n "" > /tmp/CHOSEN_COMPAT_PKGS
  599. for ONE_CCP in $NEW_CHOSEN_GENERICNAMES
  600. do
  601. occpPATTERN='|'"$ONE_CCP"'|'
  602. occpDESCR="`cat $PACKAGELISTS_COMPAT | grep "$occpPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  603. echo "${ONE_CCP}|${occpDESCR}" >> /tmp/CHOSEN_COMPAT_PKGS
  604. done
  605. #update DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}...
  606. echo "FALLBACKS_COMPAT_VERSIONS='$FALLBACKS_COMPAT_VERSIONS'" > ${DPSFILE}
  607. echo "PKGS_SPECS_TABLE='$PKGS_SPECS_TABLE'" >> ${DPSFILE}
  608. Xdialog --center --title "Compat-distro package selection change" --msgbox "These packages have been added:\n
  609. ${COMPAT_ADDED}\n
  610. These packages have been removed:\n
  611. ${COMPAT_REMOVED}\n
  612. The changes have been made to variable 'PKGS_SPECS_TABLE'\n
  613. in file ${DPSFILE}" 0 0
  614. fi
  615. }
  616. check_dependencies_func() {
  617. xmessage "COMING SOON"
  618. }
  619. #######Download pkgs#####
  620. download_summary_func() {
  621. xmessage "COMING SOON"
  622. }
  623. ########Build pkgs########
  624. CHOSEN_GENERICNAMES="`echo "$PKGS_SPECS_TABLE" | grep -v '^#' | grep '^yes' | cut -f 2 -d '|'`"
  625. if [ -s /var/cache/woof/2createpackages_history_builds-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  626. ITEMS_CG="<item>CHANGED_ONLY</item><item>ALL_PACKAGES</item>" #091211
  627. else
  628. ITEMS_CG="<item>ALL_PACKAGES</item>"
  629. fi
  630. ITEMS_CG="${ITEMS_CG} `echo "$CHOSEN_GENERICNAMES" | sed -e 's%^%<item>%' -e 's%$%</item>%' | tr '\n' ' '`"
  631. createpackages_summary_func() {
  632. xmessage "COMING SOON"
  633. }
  634. #######Build distro#######
  635. AVAILKERNELS="`ls -1 packages-pet/linux_kernel-*.pet`"
  636. ITEMS_AK=""
  637. [ "$DISTRO_KERNEL_PET" ] && ITEMS_AK='<item>'"$DISTRO_KERNEL_PET"'</item>' #should be in DISTRO_SPECS.
  638. for ONE_AK in $AVAILKERNELS
  639. do
  640. BASE_AK="`basename $ONE_AK`"
  641. [ "$BASE_AK" = "$DISTRO_KERNEL_PET" ] && continue
  642. ITEMS_AK="${ITEMS_AK}<item>${BASE_AK}</item>"
  643. done
  644. ITEMS_SCSI0='<item>'"$HISTORY_wantscsi"'</item>' #see support/HISTORY_3builddistro
  645. ITEMS_SCSI="${ITEMS_SCSI0}`echo 'Erase_SCSI Keep_SCSI Boot_SCSI' | tr ' ' '\n' | grep -v "$HISTORY_wantscsi" | sed -e 's%^%<item>%' -e 's%$%</item>%'`"
  646. ITEMS_BIGMODEM0='<item>'"$HISTORY_bigmodem"'</item>' #see support/HISTORY_3builddistro
  647. ITEMS_BIGMODEM="${ITEMS_BIGMODEM0}`echo 'Erase_big_modems Keep_big_modems Zdrv_big_modems' | tr ' ' '\n' | grep -v "$HISTORY_bigmodem" | sed -e 's%^%<item>%' -e 's%$%</item>%'`"
  648. CHK_FB_DEFAULT="$HISTORY_CHK_FB_STATE"
  649. CHK_EXOTIC_DEFAULT="$HISTORY_CHK_EXOTIC_STATE"
  650. CHK_RADICAL_DEFAULT="$HISTORY_CHK_RADICAL_STATE"
  651. CHK_SIMPLE_FILENAMES_DEFAULT="$HISTORY_CHK_SIMPLE_FILENAMES_STATE" #100912
  652. save_builddistro_options_func() {
  653. cp -f support/HISTORY_3builddistro /tmp/HISTORY_3builddistro-backup1
  654. echo "
  655. HISTORY_KERNELPKG='${CHOICE_KERNELPKG}'
  656. HISTORY_wantscsi='${CHOICE_SCSI}'
  657. HISTORY_bigmodem='${CHOICE_BIGMODEM}'
  658. HISTORY_CHK_FB_STATE='${CHK_FB_STATE}'
  659. HISTORY_CHK_EXOTIC_STATE='${CHK_EXOTIC_STATE}'
  660. HISTORY_CHK_RADICAL_STATE='${CHK_RADICAL_STATE}'
  661. HISTORY_CHK_SIMPLE_FILENAMES_STATE='${CHK_SIMPLE_FILENAMES_STATE}'" > support/HISTORY_3builddistro #100912
  662. #100514 if defined in file DISTRO_SPECS, update...
  663. dkpPATTERN="s%^DISTRO_KERNEL_PET.*%DISTRO_KERNEL_PET='${CHOICE_KERNELPKG}'%"
  664. sed -i -e "$dkpPATTERN" ./DISTRO_SPECS
  665. }
  666. export MAIN_DIALOG="
  667. <window title=\"Woof: the Puppy builder\" icon-name=\"gtk-preferences\" >
  668. <vbox>
  669. <notebook page=\"${DEFAULTTABNUM}\" labels=\"Specifications|PET repos|Compat repos|Download dbs|Choose pkgs|Download pkgs|Build pkgs|Kernel options|Build distro\">
  670. <vbox>
  671. <hbox>
  672. <text use-markup=\"true\"><label>\"<b>These are the highest-level settings for building Puppy</b>\"</label></text>
  673. <text><label>Note, where appropriate, older choices are in a drop-down list on the right. Choose and click the left-arrow button for speedy selection of an older choice</label></text>
  674. </hbox>
  675. <hbox>
  676. <text><label>A title for this build:</label></text>
  677. <entry>
  678. <input>cat /tmp/woof_gui_dn</input>
  679. <variable>xDISTRO_NAME</variable>
  680. </entry>
  681. <text><label>\"(Any title, one to three words)\"</label></text>
  682. <button><input file stock=\"gtk-go-back\"></input><action>echo \$xHISTORY_DISTRO_NAME > /tmp/woof_gui_dn</action><action type=\"refresh\">xDISTRO_NAME</action></button>
  683. <combobox><variable>xHISTORY_DISTRO_NAME</variable>${ITEMS_HDN}</combobox>
  684. </hbox>
  685. <hbox>
  686. <text><label>Puppy version number:</label></text>
  687. <entry>
  688. <default>${DISTRO_VERSION}</default>
  689. <variable>xDISTRO_VERSION</variable>
  690. </entry>
  691. <text><label>(use dots to separate: major.minor[.subminor...] ex: 5.1.23)</label></text>
  692. <text><label>\" \"</label></text>
  693. </hbox>
  694. <hbox>
  695. <text><label>File prefix:</label></text>
  696. <entry>
  697. <input>cat /tmp/woof_gui_dfp</input>
  698. <variable>xDISTRO_FILE_PREFIX</variable>
  699. </entry>
  700. <text><label>\"(one to four characters only)\"</label></text>
  701. <button><input file stock=\"gtk-go-back\"></input><action>echo \$xHISTORY_DISTRO_FILE_PREFIX > /tmp/woof_gui_dfp</action><action type=\"refresh\">xDISTRO_FILE_PREFIX</action></button>
  702. <combobox><variable>xHISTORY_DISTRO_FILE_PREFIX</variable>${ITEMS_HDFP}</combobox>
  703. </hbox>
  704. <hbox>
  705. <text>
  706. <label>Compatible-distro:</label>
  707. </text>
  708. <combobox>
  709. <variable>xDISTRO_BINARY_COMPAT</variable>
  710. ${ITEMSCOMP}
  711. </combobox>
  712. <text><label>(this the distro where to get the binary pkgs from)</label></text>
  713. <text><label>\" \"</label></text>
  714. </hbox>
  715. <hbox>
  716. <text><label>Compatible-distro version:</label></text>
  717. <entry>
  718. <input>cat /tmp/woof_gui_dcv</input>
  719. <variable>xDISTRO_COMPAT_VERSION</variable>
  720. </entry>
  721. <text><label>\"(a word or number)\"</label></text>
  722. <button><input file stock=\"gtk-go-back\"></input><action>echo \$xHISTORY_DISTRO_COMPAT_VERSION > /tmp/woof_gui_dcv</action><action type=\"refresh\">xDISTRO_COMPAT_VERSION</action></button>
  723. <combobox><variable>xHISTORY_DISTRO_COMPAT_VERSION</variable>${ITEMS_HDCV}</combobox>
  724. </hbox>
  725. <text><label>\" \"</label></text>
  726. <hbox>
  727. <text><label>The available kernels are PET packages, located in directory 'packages-pet'. Choose which one is to be in the live-CD:</label></text>
  728. <combobox><variable>CHOICE_KERNELPKG</variable>${ITEMS_AK}</combobox>
  729. <text><label>\" \"</label></text>
  730. </hbox>
  731. <hbox>
  732. <text><label>\" \"</label></text>
  733. <frame Previous templates>
  734. <hbox>
  735. <text><label>If you are even slightly confused by the above choices, this section makes it easy. Choose a configuration that has previously been built in Woof (and will likely just-work):</label></text>
  736. <combobox><variable>xHISTORY_DISTRO_SPECS_TEMPLATE</variable>${ITEMS_HDST}</combobox>
  737. </hbox>
  738. </frame>
  739. </hbox>
  740. <hbox>
  741. <text><label>Welcome! Each of these tabs is a GUI frontend for a single configuration file or script. This first tab is a GUI for configuration file 'DISTRO_SPECS'. This file has the overall specifications for your proposed build of Puppy.</label></text>
  742. <text use-markup=\"true\"><label>\"<b>If any changes made above, click 'UPDATE' button to save changes:</b>\"</label></text>
  743. </hbox>
  744. <hbox>
  745. <button><label>Help: Introduction</label><action>defaulttextviewer ./README.txt & </action></button>
  746. <button><label>UPDATE OVERALL SPECS</label><action>update_distro_specs_func</action><action type=\"exit\">UPDATE_DS</action></button>
  747. </hbox>
  748. </vbox>
  749. <vbox>
  750. <hbox>
  751. <text use-markup=\"true\"><label>\"<b>These are the online repositories of PET packages</b>\"</label></text>
  752. <text><label>Even if you are building Puppy from some other compatible-distro, still many PET packages are required</label></text>
  753. <button><label>Edit</label><action>edit_pet_repos_func</action><action type=\"refresh\">TREE_PET_REPOS</action></button>
  754. </hbox>
  755. <tree>
  756. <label>URL|Local database file(s)</label>
  757. <input>cat /tmp/woof_gui_pet_repos | tr '\n' ' ' | sed -e 's%\n$%%' | tr ' ' '\n' | cut -f 2,3 -d '|'</input>
  758. <variable>TREE_PET_REPOS</variable>
  759. </tree>
  760. <hbox>
  761. <text use-markup=\"true\"><label>\"<b>Online PET database files</b>\"</label></text>
  762. <text><label>The up-to-date PET database files are online, for Woof to download</label></text>
  763. <button><label>Edit</label><action>edit_pkg_docs_pet_repos_func</action><action type=\"refresh\">TREE_PKG_DOCS_PET_REPOS</action></button>
  764. </hbox>
  765. <tree>
  766. <label>URL of online database file|Local database file</label>
  767. <input>cat /tmp/woof_gui_pkg_docs_pet_repos | tr '\n' ' ' | sed -e 's%\n$%%' | tr ' ' '\n' | cut -f 2,3 -d '|'</input>
  768. <variable>TREE_PKG_DOCS_PET_REPOS</variable>
  769. </tree>
  770. <text><label>\" \"</label></text>
  771. <hbox>
  772. <text><label>This tab is a GUI for configuration file 'DISTRO_PET_REPOS'.</label></text>
  773. <text use-markup=\"true\"><label>\"<b>If any changes made above, click 'UPDATE' button to save:</b>\"</label></text>
  774. </hbox>
  775. <hbox>
  776. <button><label>Help: Repositories</label><action>defaulthtmlviewer /usr/local/petget/README-add-repo.htm & </action></button>
  777. <button><label>UPDATE PET REPOS</label><action>update_distro_pet_repos_func</action><action type=\"exit\">UPDATE_PR</action></button>
  778. </hbox>
  779. </vbox>
  780. <vbox>
  781. <hbox>
  782. <text use-markup=\"true\"><label>\"<b>These are the online repositories of compatible-distro (${DISTRO_BINARY_COMPAT}) packages</b>\"</label></text>
  783. <text><label>This tab specifies the URLs for downloading the binary packages of ${DISTRO_BINARY_COMPAT}, release ${DISTRO_COMPAT_VERSION}, that you want to build Puppy from.</label></text>
  784. <button><label>Edit</label><action>edit_compat_repos_func</action><action type=\"refresh\">TREE_COMPAT_REPOS</action></button>
  785. </hbox>
  786. <tree>
  787. <label>URL|Local database file(s)</label>
  788. <input>cat /tmp/woof_gui_compat_repos | tr '\n' ' ' | sed -e 's%\n$%%' | tr ' ' '\n' | cut -f 2,3 -d '|'</input>
  789. <variable>TREE_COMPAT_REPOS</variable>
  790. </tree>
  791. <hbox>
  792. <text use-markup=\"true\"><label>\"<b>Online compat-distro database files</b>\"</label></text>
  793. <text><label>The up-to-date compat-distro database files are online, for Woof to download</label></text>
  794. <button><label>Edit</label><action>edit_pkg_docs_compat_repos_func</action><action type=\"refresh\">TREE_PKG_DOCS_COMPAT_REPOS</action></button>
  795. </hbox>
  796. <tree>
  797. <label>URL of online database file|Local database file</label>
  798. <input>cat /tmp/woof_gui_pkg_docs_compat_repos | tr '\n' ' ' | sed -e 's%\n$%%' | tr ' ' '\n' | cut -f 2,3 -d '|'</input>
  799. <variable>TREE_PKG_DOCS_COMPAT_REPOS</variable>
  800. </tree>
  801. <text><label>\" \"</label></text>
  802. <hbox>
  803. <text><label>This tab is a GUI for configuration file '${DCRFILE}'.</label></text>
  804. <text use-markup=\"true\"><label>\"<b>If any changes made above, click 'UPDATE' button to save:</b>\"</label></text>
  805. </hbox>
  806. <hbox>
  807. <button><label>Help: Repositories</label><action>defaulthtmlviewer /usr/local/petget/README-add-repo.htm & </action></button>
  808. <button><label>UPDATE COMPAT-DISTRO REPOS</label><action>update_distro_compat_repos_func</action><action type=\"exit\">UPDATE_CR</action></button>
  809. </hbox>
  810. </vbox>
  811. <vbox>
  812. <hbox>
  813. <text use-markup=\"true\"><label>\"<b>This tab is for downloading the package databases</b>\"</label></text>
  814. <text><label>The databases of PET and compat-distro (${DISTRO_BINARY_COMPAT}, release ${DISTRO_COMPAT_VERSION}) are online and need to be downloaded and converted to Puppy Standard Format.</label></text>
  815. </hbox>
  816. <hbox>
  817. <frame PET pkg online databases><text><label>\"${PET_REPOS_LIST_ONLINE}\"</label></text></frame>
  818. <frame PET pkg local databases><text><label>\"${PET_REPOS_LIST_LOCAL}\"</label></text></frame>
  819. <text><label>This shows the PET package database files available online and what is local. If local files are incomplete or you want to update them, click the 'UPDATE' button. Note: the online files are already in Puppy Standard Format, so only need to be downloaded.</label></text>
  820. </hbox>
  821. <hbox>
  822. <frame compat-distro pkg online databases><text><label>\"${PKG_DOCS_DISTRO_COMPAT_LIST_ONLINE}\"</label></text></frame>
  823. <frame compat-distro pkg local databases><text><label>\"${PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL}\"</label></text></frame>
  824. <text><label>The left frame shows the database files as they would be named after downloading and converting to Puppy Standard Format (the actual online files are named differently). The right frame shows what is actually available locally -- if any are missing, or you want to update them, click the UPDATE button</label></text>
  825. </hbox>
  826. <hbox>
  827. <text use-markup=\"true\"><label>\"<b>WARNING: If you click 'UPDATE', the download and conversion will take a long time</b>\"</label></text>
  828. <text><label>For any compat-distro other than a Puppy-release, it is the conversion to Puppy Standard Format that takes a long time. This is because it is currently written in Bash script -- one day I'll get around to rewriting it in C or Genie.</label></text>
  829. </hbox>
  830. <text><label>\" \"</label></text>
  831. <hbox>
  832. <text><label>This tab is a frontend for script '0setup'</label></text>
  833. <text use-markup=\"true\"><label>\"<b>Click 'UPDATE' if any files missing in right panes, or need updating:</b>\"</label></text>
  834. <text use-markup=\"true\"><label>\"<b>Report on last update:</b>\"</label></text>
  835. </hbox>
  836. <hbox>
  837. <button><label>Help: Standard DB Format</label><action>defaulthtmlviewer http://puppylinux.com/woof/pkg-db-format.htm & </action></button>
  838. <button><label>UPDATE LOCAL DB FILES</label><action type=\"exit\">UPDATE_DB</action></button>
  839. <button><label>REPORT</label><action>report_0setup_func</action></button>
  840. </hbox>
  841. </vbox>
  842. <vbox>
  843. <hbox>
  844. <text use-markup=\"true\"><label>\"<b>This tab is for choosing what packages you want to have in the Puppy build</b>\"</label></text>
  845. <text><label>You can choose either PET packages or from the compat-distro (${DISTRO_BINARY_COMPAT}, release ${DISTRO_COMPAT_VERSION}). Of course, if you choose a Puppy-release as the compat-distro then they will also be PET packages.</label></text>
  846. </hbox>
  847. <hbox>
  848. <tree><label>Chosen PET packages|Descriptions</label><input>cat /tmp/CHOSEN_PET_PKGS</input><height>180</height><variable>TREE_CHOSEN_PET_PKGS</variable></tree>
  849. <text><label>These are packages that are going to be in most builds of Puppy, regardless which compat-distro you choose. They are essential infrastructure pkgs, or architecture-independent pkgs, or packages that are not available in the compat-distro (or the pkg in the compat-distro is in some way unsuitable)</label></text>
  850. </hbox>
  851. <hbox>
  852. <tree><label>Chosen compat-distro packages|Descriptions</label><input>cat /tmp/CHOSEN_COMPAT_PKGS</input><height>180</height><variable>TREE_CHOSEN_COMPAT_PKGS</variable></tree>
  853. <text><label>These are binary packages available in the compatible-distro '${DISTRO_BINARY_COMPAT}', release '${DISTRO_COMPAT_VERSION}'.</label></text>
  854. </hbox>
  855. <text><label>This tab is a frontend for config file '${DPSFILE}'</label></text>
  856. <hbox>
  857. <button><label>ADD/REMOVE PET PKGS</label><action>add_remove_pet_pkgs_func</action><action type=\"refresh\">TREE_CHOSEN_PET_PKGS</action></button>
  858. <button><label>ADD/REMOVE COMPAT-DISTRO PKGS</label><action>add_remove_compat_pkgs_func</action><action type=\"refresh\">TREE_CHOSEN_COMPAT_PKGS</action></button>
  859. <button><label>CHECK DEPENDENCIES</label><action>check_dependencies_func</action></button>
  860. </hbox>
  861. </vbox>
  862. <vbox>
  863. <hbox>
  864. <text use-markup=\"true\"><label>\"<b>This tab is for downloading the PET and compat-distro packages needed to build the Puppy live-CD</b>\"</label></text>
  865. <text><label>Assuming that at some prior stage the package database files were downloaded (see 'Download dbs' tab), the packages can now be downloaded. The PET packages will be downloaded to directory 'packages-pet' and the compat-distro packages to 'packages-${BINARIES}'.</label></text>
  866. </hbox>
  867. <hbox>
  868. <text><label>Click the button to download packages. Note that if packages already exist in those directories, they will not be re-downloaded, so you can click this button to download any packages that have been added in the 'Choose pkgs' tab since the last download...</label></text>
  869. <vbox>
  870. <button><label>DOWNLOAD PACKAGES</label><action>rxvt -title \"Downloading packages\" -bg yellow -e ./1download</action><action>xmessage -bg green -center \"Download finished. Click 'REPORT' button (in 'Download pkgs' tab) for download summary\"</action><action type=\"exit\">UPDATE_DP</action></button>
  871. </vbox>
  872. </hbox>
  873. <hbox>
  874. <text><label>Click 'REPORT' button after downloading, for a summary. Sometimes things can go wrong, like the package no longer being available online, or the repository servers are offline, so it is wise to check. Note, sometimes clicking the 'DOWNLOAD' button again will succeed in getting missed pkgs.</label></text>
  875. <vbox>
  876. <button><label>REPORT</label><action>download_summary_func</action></button>
  877. </vbox>
  878. </hbox>
  879. <text><label>\" \"</label></text>
  880. <text><label>NOTE: It is allowed to manually copy a pkg into those directories. If you have a package that you have already added via 'Choose pkgs', you can manually place a PET package into 'packages-pet' and a compat-distro package into 'packages-${BINARIES}'. In that case, no need to click the above buttons.</label></text>
  881. <text><label>\" \"</label></text>
  882. <text><label>This tab is a frontend for script '1download'</label></text>
  883. </vbox>
  884. <vbox>
  885. <hbox>
  886. <text use-markup=\"true\"><label>\"<b>This tab is for creating the cut-down packages needed to build a Puppy live-CD</b>\"</label></text>
  887. <text><label>You must have previously downloaded all the packages, see 'Download pkgs' tab. Now, they need to be processed into a cut-down and Puppy-compatible format. The resulting packages are created in directory 'packages-${DISTRO_FILE_PREFIX}'</label></text>
  888. </hbox>
  889. <hbox>
  890. <text><label>'ALL_PACKAGES' means all chosen packages (see 'Choose pkgs' tab) are processed, directory 'packages-${DISTRO_FILE_PREFIX}' is wiped and all packages re-created. 'CHANGED_ONLY' will automatically process only packages that have changed or added since last time 2createpackages was run. Or, if only one package has been added or modified in the 'Choose pkgs' tab, then it can be explicitly selected here to process just that one:</label></text>
  891. <combobox><variable>CHOICE_CREATEPACKAGES</variable>${ITEMS_CG}</combobox>
  892. </hbox>
  893. <hbox>
  894. <text><label>Click this button to build all the packages in directory 'packages-${DISTRO_FILE_PREFIX}', or the single package selected above:</label></text>
  895. <vbox>
  896. <button><label>CREATE PACKAGES</label><action>rxvt -title \"Creating packages\" -bg yellow -e ./2createpackages \$CHOICE_CREATEPACKAGES</action><action>xmessage -bg green -center \"Finished. Click 'REPORT' button for a summary.\"</action></button>
  897. </vbox>
  898. </hbox>
  899. <hbox>
  900. <text><label>Click 'REPORT' button afterward, for a summary. This can be useful to check that the right 'raw' binary packages were processed:</label></text>
  901. <vbox>
  902. <button><label>REPORT</label><action>createpackages_summary_func</action></button>
  903. </vbox>
  904. </hbox>
  905. <text><label>\" \"</label></text>
  906. <text><label>This tab is a frontend for script '2createpackages'</label></text>
  907. </vbox>
  908. <vbox>
  909. <hbox>
  910. <text use-markup=\"true\"><label>\"<b>This tab is to choose the kernel config and module options</b>\"</label></text>
  911. <text><label>Building '${DISTRO_NAME}' version '${DISTRO_VERSION}', from the packages of compatible-distro '${DISTRO_BINARY_COMPAT}', version ${DISTRO_COMPAT_VERSION}. The compat-distro is designed to work with a certain minimum kernel version, do not choose anything older.</label></text>
  912. </hbox>
  913. <frame Kernel modules options >
  914. <hbox>
  915. <vbox>
  916. <text><label>What do you want to do with the SCSI drivers? Some network server PCs had these, 10-20 years ago, and they are quite rare now, so choosing 'Erase' to get rid of them is a reasonable choice. If you decide to leave them in, they will add about 1.1MB to the live-CD. There are two options if you leave them in: 'Boot' places them into the initrd so Puppy can boot from a SCSI drive, whereas 'Keep' enables SCSI drives to be recognised and mounted but not booted from.</label></text>
  917. <hbox><combobox><variable>CHOICE_SCSI</variable>${ITEMS_SCSI}</combobox></hbox>
  918. </vbox>
  919. <vbox>
  920. <text><label>The kernel has some very large drivers for Internet dialup analog modems, these can add up to 9MB to the live-CD. If you choose 'Erase', the biggest will be deleted, so you won't have support for many Intel, Conexant and Agere modems -- but there are many others that will still be supported, and of course true hardware modems will be supported. Alternatively, you can choose to move them to a 'zdrv' and optionally bundle that on the live-CD.</label></text>
  921. <hbox><combobox><variable>CHOICE_BIGMODEM</variable>${ITEMS_BIGMODEM}</combobox></hbox>
  922. </vbox>
  923. </hbox>
  924. <hbox>
  925. <vbox>
  926. <text><label>The kernel is configured with the 'vesafb' driver builtin, which is usually ok if it is ever required to boot in framebuffer video mode. The other framebuffer modules take up 1.4MB uncompressed and are not normally required.</label></text>
  927. <checkbox><label>Tick to erase framebuffer modules</label><default>${CHK_FB_DEFAULT}</default><variable>CHK_FB_STATE</variable></checkbox>
  928. </vbox>
  929. <vbox>
  930. <text><label>There are some modules that are unlikely to be needed, and it is normally ok to remove them (see variable CHK_EXOTIC_STATE in 3builddistro for details). If you want the smallest possible live-CD, 5-9MB off, there is more radical culling of less-commonly required modules (see CHK_RADICAL_STATE in 3builddistro).</label></text>
  931. <checkbox><label>Tick to erase exotic modules</label><default>${CHK_EXOTIC_DEFAULT}</default><variable>CHK_EXOTIC_STATE</variable></checkbox>
  932. <checkbox><label>Tick for radical culling of modules</label><default>${CHK_RADICAL_DEFAULT}</default><variable>CHK_RADICAL_STATE</variable></checkbox>
  933. </vbox>
  934. </hbox>
  935. </frame>
  936. <hbox>
  937. <text><label>This tab and the next are frontends for script '3builddistro'.</label></text>
  938. <text use-markup=\"true\"><label>\"<b>Choose the kernel and module options above, then go onto the 'Build distro' tab...</b>\"</label></text>
  939. </hbox>
  940. </vbox>
  941. <vbox>
  942. <hbox>
  943. <text use-markup=\"true\"><label>\"<b>This tab is for building the live-CD and 'devx' file</b>\"</label></text>
  944. <text><label>'${DISTRO_NAME}' version '${DISTRO_VERSION}' live-CD will be created, built from the packages of compatible-distro '${DISTRO_BINARY_COMPAT}' (release ${DISTRO_COMPAT_VERSION}).</label></text>
  945. </hbox>
  946. <text><label>\" \"</label></text>
  947. <hbox>
  948. <text><label>Choose simple or traditional Puppy filenames (this will be variable CHK_SIMPLE_FILENAMES in 3builddistro). Simple names: vmlinuz, initrd.gz, puppy.sfs, zdrv.sfs, devx.sfs. Example traditional names: vmlinuz, initrd.gz, wary_071.sfs, zw071335.sfs, wary_devx_071.sfs</label></text>
  949. <vbox>
  950. <checkbox><label>Tick for simplified filenames</label><default>${CHK_SIMPLE_FILENAMES_DEFAULT}</default><variable>CHK_SIMPLE_FILENAMES_STATE</variable></checkbox>
  951. <button><label>help</label><action>defaulthtmlviewer `pwd`/support/help_filenames.htm & </action></button>
  952. </vbox>
  953. </hbox>
  954. <text><label>\" \"</label></text>
  955. <text><label>MORE STUFF HERE SOON</label></text>
  956. <text><label>\" \"</label></text>
  957. <text><label>This tab is a frontend for script '3builddistro'</label></text>
  958. <hbox>
  959. <text><label>After making appropriate choices above, click here to build live-CD:</label></text>
  960. <button><label>BUILD DISTRO</label><action>save_builddistro_options_func</action><action>rxvt -title \"Building distro\" -bg yellow -e ./3builddistro \$CHOICE_KERNELPKG \$CHOICE_SCSI \$CHOICE_BIGMODEM \$CHK_FB_STATE \$CHK_EXOTIC_STATE \$CHK_RADICAL_STATE \$CHK_SIMPLE_FILENAMES_STATE </action></button>
  961. </hbox>
  962. </vbox>
  963. </notebook>
  964. </vbox>
  965. </window>"
  966. #gtkdialog3 --program=MAIN_DIALOG