woof_gui_tabs 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046
  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. xBUILD_FROM_WOOF="$BUILD_FROM_WOOF"
  86. ########Specifications tab#######
  87. update_distro_specs_func() {
  88. # if [ "$xHISTORY_DISTRO_SPECS_TEMPLATE" != "$HISTORY_DISTRO_SPECS_TEMPLATE" ];then
  89. if [ "$xHISTORY_DISTRO_SPECS_TEMPLATE" != "settings as above" ];then
  90. HDSTpostfix="`echo -n "$xHISTORY_DISTRO_SPECS_TEMPLATE" | tr ' ' '_'`"
  91. #change all the variables to template values...
  92. . support/HISTORY_DISTRO_SPECS_TEMPLATE_${HDSTpostfix}
  93. xDISTRO_NAME="$DISTRO_NAME"
  94. xDISTRO_VERSION="$DISTRO_VERSION"
  95. xDISTRO_BINARY_COMPAT="$DISTRO_BINARY_COMPAT"
  96. xDISTRO_FILE_PREFIX="$DISTRO_FILE_PREFIX"
  97. xDISTRO_COMPAT_VERSION="$DISTRO_COMPAT_VERSION"
  98. xDISTRO_KERNEL_PET="$DISTRO_KERNEL_PET" #100514
  99. xDISTRO_XORG_AUTO="DISTRO_XORG_AUTO" #110821
  100. xBUILD_FROM_WOOF="$BUILD_FROM_WOOF"
  101. fi
  102. # if [ "$xDISTRO_BINARY_COMPAT" = "puppy" ];then
  103. # case $xDISTRO_COMPAT_VERSION in
  104. # 2|3|4|5|6|7|8|9)
  105. # echo
  106. # ;;
  107. # *)
  108. # xmessage -center -bg red "ERROR:
  109. #When the compatible-distro is 'puppy', the 'compatible-distro-version' must be
  110. #set to a single-digit number, ex '4' (to build from the Puppy 4.x PET packages)"
  111. # return
  112. # ;;
  113. # esac
  114. # fi
  115. nDFP=`echo -n "$xDISTRO_FILE_PREFIX" | wc -c`
  116. # [ $nDFP -gt 4 ] && xmessage -center -bg pink "WARNING:
  117. #DISTRO_FILE_PREFIX=${xDISTRO_FILE_PREFIX}, but recommend this be four characters or less,
  118. #if you want to keep the Puppy files such as ${xDISTRO_FILE_PREFIX}-${xDISTRO_VERSION}.sfs within the
  119. #MSDOS-compatible 8+3 filename limit (recommended in some boot situations)"
  120. DPSFILE=''
  121. if [ -f DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION} ];then
  122. DPSFILE="DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}"
  123. else
  124. [ -f DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT} ] && DPSFILE="DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}"
  125. fi
  126. if [ "$DPSFILE" = "" ];then
  127. xmessage -center -bg red "ERROR:
  128. The 'Packages' and later tabs need a configuration file named 'DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}',
  129. which does not exist. This file has a table of what packages are to be included in the
  130. build of Puppy.
  131. If there is a similarly-named file, 'DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-<something>',
  132. a good starting point is to make a copy of it, named 'DISTRO_PKGS_SPECS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}'.
  133. Aborting changes to file DISTRO_SPECS"
  134. return
  135. fi
  136. DCRFILE=''
  137. if [ -f DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION} ];then
  138. DCRFILE="DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}"
  139. else
  140. [ -f DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT} ] && DCRFILE="DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}"
  141. fi
  142. if [ "$DCRFILE" = "" ];then #130306
  143. xmessage -center -bg red "ERROR:
  144. The 'Compat repos' and later tabs need a configuration file named 'DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}',
  145. which does not exist. This file specifies the URLs where the compatible-distro packages
  146. can be downloaded from.
  147. If there is a similarly-named file, 'DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-<something>',
  148. a good starting point is to make a copy of it, named 'DISTRO_COMPAT_REPOS-${xDISTRO_BINARY_COMPAT}-${xDISTRO_COMPAT_VERSION}'.
  149. Aborting changes to file DISTRO_SPECS"
  150. return
  151. fi
  152. cp -f DISTRO_SPECS /tmp/DISTRO_SPECS-backup
  153. cp -f support/HISTORY_DISTRO_SPECS /tmp/HISTORY_DISTRO_SPECS-backup
  154. HISTORY_DISTRO_NAME="`echo "$HISTORY_DISTRO_NAME" | head -n 10 | grep -v "^${xDISTRO_NAME}$"`"
  155. HISTORY_DISTRO_NAME="$xDISTRO_NAME
  156. $HISTORY_DISTRO_NAME"
  157. echo "HISTORY_DISTRO_NAME='${HISTORY_DISTRO_NAME}'" > support/HISTORY_DISTRO_SPECS
  158. echo '#One or more words that identify this distribution:' > DISTRO_SPECS
  159. echo "DISTRO_NAME='${xDISTRO_NAME}'" >> DISTRO_SPECS
  160. echo '#version number of this distribution:' >> DISTRO_SPECS
  161. echo "DISTRO_VERSION=${xDISTRO_VERSION}" >> DISTRO_SPECS
  162. #echo '#A two-digit numeric value, minor-version number of this distribution:' >> DISTRO_SPECS
  163. #echo "DISTRO_MINOR_VERSION=${xDISTRO_MINOR_VERSION}" >> DISTRO_SPECS
  164. echo '#The distro whose binary packages were used to build this distribution:' >> DISTRO_SPECS
  165. echo "DISTRO_BINARY_COMPAT='${xDISTRO_BINARY_COMPAT}'" >> DISTRO_SPECS
  166. echo '#Prefix for some filenames: exs: '"${xDISTRO_FILE_PREFIX}save.2fs, ${xDISTRO_FILE_PREFIX}-${xDISTRO_VERSION}.sfs" >> DISTRO_SPECS
  167. HISTORY_DISTRO_FILE_PREFIX="`echo "$HISTORY_DISTRO_FILE_PREFIX" | head -n 10 | grep -v "^${xDISTRO_FILE_PREFIX}$"`"
  168. HISTORY_DISTRO_FILE_PREFIX="$xDISTRO_FILE_PREFIX
  169. $HISTORY_DISTRO_FILE_PREFIX"
  170. echo "HISTORY_DISTRO_FILE_PREFIX='${HISTORY_DISTRO_FILE_PREFIX}'" >> support/HISTORY_DISTRO_SPECS
  171. echo "DISTRO_FILE_PREFIX='${xDISTRO_FILE_PREFIX}'" >> DISTRO_SPECS
  172. echo '#The version of the distro whose binary packages were used to build this distro:' >> DISTRO_SPECS
  173. HISTORY_DISTRO_COMPAT_VERSION="`echo "$HISTORY_DISTRO_COMPAT_VERSION" | head -n 10 | grep -v "^${xDISTRO_COMPAT_VERSION}$"`"
  174. HISTORY_DISTRO_COMPAT_VERSION="$xDISTRO_COMPAT_VERSION
  175. $HISTORY_DISTRO_COMPAT_VERSION"
  176. echo "HISTORY_DISTRO_COMPAT_VERSION='${HISTORY_DISTRO_COMPAT_VERSION}'" >> support/HISTORY_DISTRO_SPECS
  177. echo "DISTRO_COMPAT_VERSION='${xDISTRO_COMPAT_VERSION}'" >> DISTRO_SPECS
  178. if [ "$xDISTRO_KERNEL_PET" ];then #100514
  179. echo '#the kernel pet package used:' >> DISTRO_SPECS
  180. #echo "DISTRO_KERNEL_PET='${CHOICE_KERNELPKG}'" >> support/HISTORY_DISTRO_SPECS
  181. if [ "$CB_HK" = false ];then
  182. echo "DISTRO_KERNEL_PET='${CHOICE_KERNELPKG}'" >> DISTRO_SPECS
  183. else
  184. echo "DISTRO_KERNEL_PET='Huge_Kernel'" >> DISTRO_SPECS
  185. fi
  186. fi
  187. if [ "$xDISTRO_XORG_AUTO" ];then #110821
  188. echo '#read by /usr/bin/xwin to bypass Xorg Wizard at first boot:' >> DISTRO_SPECS
  189. echo "DISTRO_XORG_AUTO='$xDISTRO_XORG_AUTO'" >> DISTRO_SPECS
  190. fi
  191. if [ "$xBUILD_FROM_WOOF" ];then
  192. echo "BUILD_FROM_WOOF='${xBUILD_FROM_WOOF}'" >> DISTRO_SPECS
  193. fi
  194. #echo '#Earlier DISTRO_SPECS than was built in Woof:' >> support/HISTORY_DISTRO_SPECS
  195. #echo "HISTORY_DISTRO_SPECS_TEMPLATE='${xHISTORY_DISTRO_SPECS_TEMPLATE}'" >> support/HISTORY_DISTRO_SPECS
  196. # echo "HISTORY_DISTRO_SPECS_TEMPLATES='${HISTORY_DISTRO_SPECS_TEMPLATES}'" >> support/HISTORY_DISTRO_SPECS
  197. #export XDIALOG_HIGH_DIALOG_COMPAT=1
  198. #121105 restore other variables that may have been in prior DISTRO_SPECS...
  199. for ONEDISTROVAR in `grep -o '^DISTRO_[^# =]*' /tmp/DISTRO_SPECS-backup | tr '\n' ' '`
  200. do
  201. odvPTN="^${ONEDISTROVAR}="
  202. if [ "`grep "$odvPTN" ./DISTRO_SPECS`" == "" ];then
  203. grep "$odvPTN" /tmp/DISTRO_SPECS-backup >> ./DISTRO_SPECS
  204. fi
  205. done
  206. 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
  207. }
  208. ITEMSCOMP="<item>${DISTRO_BINARY_COMPAT}</item>"
  209. for ONECHOICE in arch debian mageia puppy raspbian scientific slackware t2 ubuntu
  210. do
  211. [ "$ONECHOICE" = "$DISTRO_BINARY_COMPAT" ] && continue
  212. ITEMSCOMP="${ITEMSCOMP}<item>${ONECHOICE}</item>"
  213. done
  214. echo -n "" > /tmp/woof_gui_items_hdn
  215. echo "$HISTORY_DISTRO_NAME" |
  216. while read ONECHOICE
  217. do
  218. echo -n "<item>${ONECHOICE}</item>" >> /tmp/woof_gui_items_hdn
  219. done
  220. ITEMS_HDN="`cat /tmp/woof_gui_items_hdn`"
  221. echo -n "" > /tmp/woof_gui_items_hdfp
  222. echo "$HISTORY_DISTRO_FILE_PREFIX" |
  223. while read ONECHOICE
  224. do
  225. echo -n "<item>${ONECHOICE}</item>" >> /tmp/woof_gui_items_hdfp
  226. done
  227. ITEMS_HDFP="`cat /tmp/woof_gui_items_hdfp`"
  228. echo -n "" > /tmp/woof_gui_items_hdcv
  229. echo "$HISTORY_DISTRO_COMPAT_VERSION" |
  230. while read ONECHOICE
  231. do
  232. echo -n "<item>${ONECHOICE}</item>" >> /tmp/woof_gui_items_hdcv
  233. done
  234. ITEMS_HDCV="`cat /tmp/woof_gui_items_hdcv`"
  235. HISTORY_DISTRO_SPECS_TEMPLATES="`ls -1 support/HISTORY_DISTRO_SPECS_TEMPLATE_* | sed -e 's%.*TEMPLATE_%%' -e 's%_% %g'`"
  236. #echo -n "<item>${HISTORY_DISTRO_SPECS_TEMPLATE}</item>" > /tmp/woof_gui_items_hdst
  237. echo -n "<item>settings as above</item>" > /tmp/woof_gui_items_hdst
  238. echo "$HISTORY_DISTRO_SPECS_TEMPLATES" |
  239. while read ONECHOICE
  240. do
  241. #[ "$HISTORY_DISTRO_SPECS_TEMPLATE" = "$ONECHOICE" ] && continue
  242. echo -n "<item>${ONECHOICE}</item>" >> /tmp/woof_gui_items_hdst
  243. done
  244. ITEMS_HDST="`cat /tmp/woof_gui_items_hdst`"
  245. ########PET repos tab##########
  246. edit_pet_repos_func() {
  247. cp -a -f /tmp/woof_gui_pet_repos /tmp/woof_gui_pet_repos2
  248. defaulttextviewer /tmp/woof_gui_pet_repos
  249. prDIFF="`diff -q /tmp/woof_gui_pet_repos /tmp/woof_gui_pet_repos2`"
  250. if [ "$prDIFF" != "" ];then
  251. prADD_LINE="`diff /tmp/woof_gui_pet_repos /tmp/woof_gui_pet_repos2 | grep '^< ' | head -n 1`"
  252. if [ "$prADD_LINE" != "" ];then
  253. prERR=''
  254. prADD_fc=`echo -n "$prADD_LINE" | sed -e 's%[^|]%%g' | wc -c`
  255. [ $prADD_fc -ne 2 ] && prERR="ERROR: wrong number of '|' delimiters in new entry. Aborting edit"
  256. prADD_PKGDB="`echo -n "$prADD_LINE" | cut -f 3 -d '|'`"
  257. [ "`echo "$prADD_PKGDB" | grep '^Packages-puppy-'`" = "" ] && prERR="ERROR: ${prADD_PKGDB} is named incorrectly. See Help button. Aborting change"
  258. if [ "$prERR" != "" ];then
  259. xmessage -center -bg red "$prERR"
  260. cp -a -f /tmp/woof_gui_pet_repos2 /tmp/woof_gui_pet_repos
  261. return
  262. fi
  263. fi
  264. xPET_REPOS="`cat /tmp/woof_gui_pet_repos | tr -s '\n' | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  265. echo "$xPET_REPOS" | tr ' ' '\n' > /tmp/woof_gui_pet_repos
  266. fi
  267. }
  268. edit_pkg_docs_pet_repos_func() {
  269. cp -a -f /tmp/woof_gui_pkg_docs_pet_repos /tmp/woof_gui_pkg_docs_pet_repos2
  270. defaulttextviewer /tmp/woof_gui_pkg_docs_pet_repos
  271. prDIFF="`diff -q /tmp/woof_gui_pkg_docs_pet_repos /tmp/woof_gui_pkg_docs_pet_repos2`"
  272. if [ "$prDIFF" != "" ];then
  273. prADD_LINE="`diff /tmp/woof_gui_pkg_docs_pet_repos /tmp/woof_gui_pkg_docs_pet_repos2 | grep '^< ' | head -n 1`"
  274. prERR=''
  275. prADD_fc=`echo -n "$prADD_LINE" | sed -e 's%[^|]%%g' | wc -c`
  276. [ $prADD_fc -ne 2 ] && prERR="ERROR: wrong number of '|' delimiters in new entry. Aborting edit"
  277. prADD_PKGDB="`echo -n "$prADD_LINE" | cut -f 3 -d '|'`"
  278. [ "`echo "$prADD_PKGDB" | grep '^Packages-puppy-'`" = "" ] && prERR="ERROR: ${prADD_PKGDB} is named incorrectly. See Help button. Aborting change"
  279. if [ "$prERR" != "" ];then
  280. xmessage -center -bg red "$prERR"
  281. cp -a -f /tmp/woof_gui_pkg_docs_pet_repos2 /tmp/woof_gui_pkg_docs_pet_repos
  282. return
  283. fi
  284. xPKG_DOCS_PET_REPOS="`cat /tmp/woof_gui_pkg_docs_pet_repos | tr -s '\n' | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  285. echo "$xPKG_DOCS_PET_REPOS" | tr ' ' '\n' > /tmp/woof_gui_pkg_docs_pet_repos
  286. fi
  287. }
  288. update_distro_pet_repos_func() {
  289. cp -f DISTRO_PET_REPOS /tmp/DISTRO_PET_REPOS-backup
  290. echo '#PKG_DOCS_PET_REPOS
  291. #where to download the pet pkgs databases from.
  292. #first field is for testing the url.
  293. #second field is full URI of the database file.
  294. #third field is name of db file when local and after being processed into standard format
  295. # (in the case of PET databases, the names are the same and no processing is required)' > DISTRO_PET_REPOS
  296. xPKG_DOCS_PET_REPOS="`cat /tmp/woof_gui_pkg_docs_pet_repos | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  297. echo "PKG_DOCS_PET_REPOS='${xPKG_DOCS_PET_REPOS}'" >> DISTRO_PET_REPOS
  298. echo >> DISTRO_PET_REPOS
  299. echo '#PET_REPOS
  300. #first field is for testing the url.
  301. #second field is full URI of the repo
  302. #third field is the name of db-file(s) associated with that repo. it may have glob wildcards.
  303. # ex: Packages-puppy-4-official (note, url paths are in the database)' >> DISTRO_PET_REPOS
  304. xPET_REPOS="`cat /tmp/woof_gui_pet_repos | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  305. echo "PET_REPOS='${xPET_REPOS}'" >> DISTRO_PET_REPOS
  306. # case $xDISTRO_BINARY_COMPAT in
  307. # puppy)
  308. # #w478 2/3: append Packages-puppy-4-official as a fallback, for some arch-independent pkgs...
  309. # case $xDISTRO_COMPAT_VERSION in #100730 110608
  310. # 2) xPACKAGELISTS_PET_ORDER="Packages-puppy-common-official Packages-puppy-2-official Packages-puppy-4-official" ;;
  311. # 3) xPACKAGELISTS_PET_ORDER="Packages-puppy-common-official Packages-puppy-3-official Packages-puppy-4-official" ;;
  312. # 4) xPACKAGELISTS_PET_ORDER="Packages-puppy-common-official Packages-puppy-4-official Packages-puppy-3-official" ;;
  313. # *) xPACKAGELISTS_PET_ORDER="Packages-puppy-${xDISTRO_COMPAT_VERSION}-official Packages-puppy-common-official Packages-puppy-quirky-official Packages-puppy-4-official" ;;
  314. # esac
  315. # ;;
  316. # *)
  317. # xPACKAGELISTS_PET_ORDER="Packages-puppy-common-official Packages-puppy-quirky-official Packages-puppy-4-official"
  318. # ;;
  319. # esac
  320. # echo >> DISTRO_PET_REPOS
  321. # echo '#this defines where Woof looks first and second (and third, etc.) for pet pkgs' >> DISTRO_PET_REPOS
  322. # echo "PACKAGELISTS_PET_ORDER='${xPACKAGELISTS_PET_ORDER}'" >> DISTRO_PET_REPOS
  323. #110608 simplify search order...
  324. xPACKAGELISTS_PET_ORDER='Packages-puppy-common-official Packages-puppy-4-official'
  325. #exs of DISTRO_COMPAT_VERSION: wary5, lucid, 4
  326. [ "$xDISTRO_COMPAT_VERSION" != "4" ] && [ -f Packages-puppy-${xDISTRO_COMPAT_VERSION}-official ] && xPACKAGELISTS_PET_ORDER="Packages-puppy-${xDISTRO_COMPAT_VERSION}-official ${xPACKAGELISTS_PET_ORDER}"
  327. echo "PACKAGELISTS_PET_ORDER='${xPACKAGELISTS_PET_ORDER}'" >> DISTRO_PET_REPOS
  328. 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
  329. }
  330. #########Compat repos tab#####
  331. edit_compat_repos_func() {
  332. cp -a -f /tmp/woof_gui_compat_repos /tmp/woof_gui_compat_repos2
  333. defaulttextviewer /tmp/woof_gui_compat_repos
  334. prDIFF="`diff -q /tmp/woof_gui_compat_repos /tmp/woof_gui_compat_repos2`"
  335. if [ "$prDIFF" != "" ];then
  336. prADD_LINE="`diff /tmp/woof_gui_compat_repos /tmp/woof_gui_compat_repos2 | grep '^< ' | head -n 1`"
  337. if [ "$prADD_LINE" != "" ];then
  338. prERR=''
  339. prADD_fc=`echo -n "$prADD_LINE" | sed -e 's%[^|]%%g' | wc -c`
  340. [ $prADD_fc -ne 2 ] && prERR="ERROR: wrong number of '|' delimiters in new entry. Aborting edit"
  341. prADD_PKGDB="`echo -n "$prADD_LINE" | cut -f 3 -d '|'`"
  342. [ "`echo "$prADD_PKGDB" | grep '^Packages-'`" = "" ] && prERR="ERROR: ${prADD_PKGDB} is named incorrectly. See Help button. Aborting change"
  343. if [ "$prERR" != "" ];then
  344. xmessage -center -bg red "$prERR"
  345. cp -a -f /tmp/woof_gui_compat_repos2 /tmp/woof_gui_compat_repos
  346. return
  347. fi
  348. fi
  349. xCOMPAT_REPOS="`cat /tmp/woof_gui_compat_repos | tr -s '\n' | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  350. echo "$xCOMPAT_REPOS" | tr ' ' '\n' > /tmp/woof_gui_compat_repos
  351. fi
  352. }
  353. edit_pkg_docs_compat_repos_func() {
  354. cp -a -f /tmp/woof_gui_pkg_docs_compat_repos /tmp/woof_gui_pkg_docs_compat_repos2
  355. defaulttextviewer /tmp/woof_gui_pkg_docs_compat_repos
  356. prDIFF="`diff -q /tmp/woof_gui_pkg_docs_compat_repos /tmp/woof_gui_pkg_docs_compat_repos2`"
  357. if [ "$prDIFF" != "" ];then
  358. prADD_LINE="`diff /tmp/woof_gui_pkg_docs_compat_repos /tmp/woof_gui_pkg_docs_compat_repos2 | grep '^< ' | head -n 1`"
  359. prERR=''
  360. prADD_fc=`echo -n "$prADD_LINE" | sed -e 's%[^|]%%g' | wc -c`
  361. [ $prADD_fc -ne 2 ] && prERR="ERROR: wrong number of '|' delimiters in new entry. Aborting edit"
  362. prADD_PKGDB="`echo -n "$prADD_LINE" | cut -f 3 -d '|'`"
  363. [ "`echo "$prADD_PKGDB" | grep '^Packages-'`" = "" ] && prERR="ERROR: ${prADD_PKGDB} is named incorrectly. See Help button. Aborting change"
  364. if [ "$prERR" != "" ];then
  365. xmessage -center -bg red "$prERR"
  366. cp -a -f /tmp/woof_gui_pkg_docs_compat_repos2 /tmp/woof_gui_pkg_docs_compat_repos
  367. return
  368. fi
  369. xPKG_DOCS_COMPAT_REPOS="`cat /tmp/woof_gui_pkg_docs_compat_repos | tr -s '\n' | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  370. echo "$xPKG_DOCS_COMPAT_REPOS" | tr ' ' '\n' > /tmp/woof_gui_pkg_docs_compat_repos
  371. fi
  372. }
  373. update_distro_compat_repos_func() {
  374. #cp -f DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} /tmp/DISTRO_COMPAT_REPOS-backup
  375. cp -f $DCRFILE /tmp/DISTRO_COMPAT_REPOS-backup #130306
  376. echo '#PKG_DOCS_DISTRO_COMPAT
  377. #where to download the compatible-distro pkgs databases from.
  378. #first field is for testing the url.
  379. #second field is full URI of the database file.
  380. #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}
  381. xPKG_DOCS_COMPAT_REPOS="`cat /tmp/woof_gui_pkg_docs_compat_repos | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  382. echo "PKG_DOCS_DISTRO_COMPAT='${xPKG_DOCS_COMPAT_REPOS}'" >> $DCRFILE #130306 DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  383. #echo 'PKG_DOCS_DISTRO_COMPAT="$PKG_DOCS_COMPAT_REPOS" #older equiv. name.' >> DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  384. echo >> $DCRFILE #130306 DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  385. echo '#REPOS_DISTRO_COMPAT
  386. #first field is for testing the url.
  387. #second field is full URI of the repo
  388. #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}
  389. xCOMPAT_REPOS="`cat /tmp/woof_gui_compat_repos | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%'`"
  390. echo "REPOS_DISTRO_COMPAT='${xCOMPAT_REPOS}'" >> $DCRFILE #130306 DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  391. #echo 'REPOS_DISTRO_COMPAT="$COMPAT_REPOS" #older equiv. name.' >> DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  392. 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
  393. }
  394. #####Download dbs######
  395. PET_REPOS_LIST_ONLINE="`echo "$PKG_DOCS_PET_REPOS" | tr ' ' '\n' | cut -f 3 -d '|' | sort -u`"
  396. PET_REPOS_LIST_LOCAL="`ls -1 Packages-puppy-*`"
  397. echo -n "" > /tmp/PET_REPOS_LIST_LOCAL
  398. for ONE_DB in $PET_REPOS_LIST_LOCAL
  399. do
  400. [ "`echo "$PET_REPOS_LIST_ONLINE" | grep "^${ONE_DB}$"`" != "" ] && echo "$ONE_DB" >> /tmp/PET_REPOS_LIST_LOCAL
  401. done
  402. PET_REPOS_LIST_LOCAL="`cat /tmp/PET_REPOS_LIST_LOCAL`"
  403. PKG_DOCS_DISTRO_COMPAT_LIST_ONLINE="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | sort -u`"
  404. echo -n "" > /tmp/PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL
  405. for ONE_DB in $PKG_DOCS_DISTRO_COMPAT_LIST_ONLINE
  406. do
  407. [ -f $ONE_DB ] && echo "$ONE_DB" >> /tmp/PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL
  408. done
  409. PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL="`cat /tmp/PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL`"
  410. #in some cases, the "online" db is not available online. Then 1st and 2nd fields are empty...
  411. PKG_DOCS_DISTRO_COMPAT_LIST_ONLINE="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | grep -v '||' | cut -f 3 -d '|' | sort -u`"
  412. report_0setup_func() {
  413. if [ ! -f /var/woof/0setup_fail_report_no ];then
  414. xmessage -center -bg red "ERROR: Must run 'UPDATE' first"
  415. return
  416. fi
  417. xmessage -center -bg pink "`cat /var/woof/0setup_fail_report_no`"
  418. }
  419. ########Choose pkgs#######
  420. #has 2 variables, FALLBACKS_COMPAT_VERSIONS and PKGS_SPECS_TABLE
  421. if [ ! -f /tmp/CHOSEN_PET_PKGS -o ! -f /tmp/CHOSEN_COMPAT_PKGS ];then
  422. xmessage -center -bg orange -buttons "" "Please wait, processing..." &
  423. WAITPID=$!
  424. CHOSEN_PET_PKGS="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep '||' | cut -f 2 -d '|'`"
  425. #add a description...
  426. echo -n "" > /tmp/CHOSEN_PET_PKGS
  427. for ONE_CPP in $CHOSEN_PET_PKGS
  428. do
  429. ocppPATTERN='|'"$ONE_CPP"'|'
  430. ocppDESCR="`cat $PACKAGELISTS_PET_ORDER | grep "$ocppPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  431. echo "${ONE_CPP}|${ocppDESCR}" >> /tmp/CHOSEN_PET_PKGS
  432. done
  433. #add a description...
  434. echo -n "" > /tmp/CHOSEN_COMPAT_PKGS
  435. if [ "$DISTRO_BINARY_COMPAT" = "puppy" ];then
  436. CHOSEN_COMPAT_PKGS="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep -v '||' | cut -f 2 -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. occpPATTERN='|'"$ONE_CCP"'|'
  441. occpDESCR="`cat $PACKAGELISTS_COMPAT | grep "$occpPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  442. echo "${ONE_CCP}|${occpDESCR}" >> /tmp/CHOSEN_COMPAT_PKGS
  443. done
  444. else
  445. CHOSEN_COMPAT_PKGS="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep -v '||' | cut -f 2,3 -d '|'`"
  446. PACKAGELISTS_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | tr '\n' ' '`"
  447. for ONE_CCP in $CHOSEN_COMPAT_PKGS
  448. do
  449. ccpCOMPAT="`echo -n "$ONE_CCP" | cut -f 2 -d '|' | cut -f 1 -d ','`"
  450. ccpGENERIC="`echo -n "$ONE_CCP" | cut -f 1 -d '|'`"
  451. occpPATTERN='|'"$ccpGENERIC"'|'
  452. ccpcPATTERN='|'"$ccpCOMPAT"'|'
  453. occpDESCR="`cat $PACKAGELISTS_COMPAT | grep "$occpPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  454. [ "$occpDESCR" = "" ] && occpDESCR="`cat $PACKAGELISTS_COMPAT | grep "$ccpcPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  455. echo "${ccpGENERIC}|${occpDESCR}" >> /tmp/CHOSEN_COMPAT_PKGS
  456. done
  457. fi
  458. #echo "$CHOSEN_COMPAT_PKGS" > /tmp/CHOSEN_COMPAT_PKGS
  459. echo "$PACKAGELISTS_COMPAT" > /tmp/PACKAGELISTS_COMPAT
  460. kill $WAITPID
  461. fi
  462. add_remove_pet_pkgs_func() {
  463. xmessage -center -bg orange -buttons "" "Please wait, processing..." &
  464. WAITPID=$!
  465. ./findwoofinstalledpkgs >/dev/null #writes db entries to /tmp/woof-installed-packages-pet and /tmp/woof-installed-packages-compat
  466. #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|
  467. CHOSEN_ENTRIES="`cat /tmp/woof-installed-packages-pet | tr -d '"' | sed -e 's%|% %' -e 's%|% on "%' -e 's%$%"%'`" #'geany
  468. #...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|"
  469. cppPATTERNS="`cat /tmp/CHOSEN_PET_PKGS | cut -f 1 -d '|' | sed -e 's%^%|%' -e 's%$%|%'`"
  470. echo "$cppPATTERNS" > /tmp/cppPATTERNS
  471. grep --file=/tmp/cppPATTERNS -v $PACKAGELISTS_PET_ORDER > /tmp/NOT_CHOSEN_PETS_DB_RAW #note: grep prepends <filename>: on each line.
  472. 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
  473. #...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|"
  474. kill $WAITPID
  475. 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"
  476. eval $EXECME
  477. if [ $? -eq 0 ];then
  478. rtPATTERNS="`cat /tmp/cpp_rettags.txt | tr ' ' '\n' | sed -e 's%^%^%' -e 's%$%|%'`"
  479. echo "$rtPATTERNS" > /tmp/rtPATTERNS
  480. NEW_CHOSEN_GENERICNAMES="`cat $PACKAGELISTS_PET_ORDER | grep --file=/tmp/rtPATTERNS | cut -f 2 -d '|' | sort -u`"
  481. OLD_CHOSEN_GENERICNAMES="`cat /tmp/woof-installed-packages-pet | cut -f 2 -d '|' | sort -u`"
  482. echo "$NEW_CHOSEN_GENERICNAMES" > /tmp/NEW_CHOSEN_GENERICNAMES
  483. echo "$OLD_CHOSEN_GENERICNAMES" > /tmp/OLD_CHOSEN_GENERICNAMES
  484. rtDIFF="`diff /tmp/OLD_CHOSEN_GENERICNAMES /tmp/NEW_CHOSEN_GENERICNAMES`"
  485. PET_ADDED="`echo "$rtDIFF" | grep '^> ' | cut -f 2 -d ' '`" #generic names only, one each line.
  486. PET_REMOVED="`echo "$rtDIFF" | grep '^< ' | cut -f 2 -d ' '`" # "
  487. if [ "$PET_REMOVED" != "" ];then
  488. prPATTERNS="`echo "$PET_REMOVED" | sed -e 's%^%|%' -e 's%$%|%'`"
  489. echo "$prPATTERNS" > /tmp/prPATTERNS
  490. PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep --file=/tmp/prPATTERNS -v`"
  491. fi
  492. ####for now, create new entry 'yes|<genericname>||exe'
  493. ####but need to ask about the last field....
  494. echo "$PKGS_SPECS_TABLE" > /tmp/PKGS_SPECS_TABLE
  495. if [ "$PET_ADDED" != "" ];then
  496. NEW_ENTRIES="`echo "$PET_ADDED" | sed -e 's%^%yes|%' -e 's%$%||exe%'`"
  497. echo "$NEW_ENTRIES" >> /tmp/PKGS_SPECS_TABLE
  498. #important note, order is important. ex, seamonkey must come before the seamonkey_addon pkgs,
  499. #as former has symlink /usr/lib/seamonkey, latter have it as an actual directory. The param
  500. #'--key=2,2' takes care of the seamonkey case, sort on field 2 only...
  501. PKGS_SPECS_TABLE="`sort --key=2,2 --field-separator='|' --unique /tmp/PKGS_SPECS_TABLE`"
  502. echo "$PKGS_SPECS_TABLE" > /tmp/PKGS_SPECS_TABLE
  503. fi
  504. #update for gui...
  505. echo -n "" > /tmp/CHOSEN_PET_PKGS
  506. for ONE_CPP in $NEW_CHOSEN_GENERICNAMES
  507. do
  508. ocppPATTERN='|'"$ONE_CPP"'|'
  509. ocppDESCR="`cat $PACKAGELISTS_PET_ORDER | grep "$ocppPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  510. echo "${ONE_CPP}|${ocppDESCR}" >> /tmp/CHOSEN_PET_PKGS
  511. done
  512. #update DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}...
  513. echo 'Fallbacks when looking for pkgs (space-separated list of distro versions)...' > ${DPSFILE}
  514. echo "FALLBACKS_COMPAT_VERSIONS='$FALLBACKS_COMPAT_VERSIONS'" >> ${DPSFILE}
  515. echo '
  516. #PKGS_SPECS_TABLE table format:
  517. #will pkg be in puppy-build.
  518. # Generic name for pkg. Note: PET packages, if exist, use this name.
  519. # Comma-separated list of compatible-distro pkg(s). "-" prefix, exclude.
  520. # Must be exact name-only of pkg, else "*" on end is wildcard to search full name.
  521. # Empty field, then use PET pkg.
  522. # How the package will get split up in woof (optional redirection ">" operator).
  523. # Missing field, it goes into exe. Can also redirect >null, means dump it.
  524. #yes|abiword|iceword,iceword-plugins|exe,dev,doc,nls
  525. #example showing wildcard. finds all full pkg names with "gcc-4.3*",
  526. #but, exclude any "gcc-4.3-doc*" matches...
  527. #yes|gcc|gcc,gcc-4.3*,-gcc-4.3-doc*|exe,dev,doc,nls
  528. ' >> ${DPSFILE}
  529. echo "PKGS_SPECS_TABLE='$PKGS_SPECS_TABLE'" >> ${DPSFILE}
  530. Xdialog --center --title "PET selection change" --msgbox "These PET packages have been added:\n
  531. ${PET_ADDED}\n
  532. These PET packages have been removed:\n
  533. ${PET_REMOVED}\n
  534. The changes have been made to variable 'PKGS_SPECS_TABLE'\n
  535. in file ${DPSFILE}" 0 0
  536. fi
  537. }
  538. add_remove_compat_pkgs_func() {
  539. if [ "$DISTRO_BINARY_COMPAT" != "puppy" ];then
  540. xmessage -center -bg pink "SORRY, currently this must be done manually."
  541. return
  542. fi
  543. xmessage -center -bg orange -buttons "" "Please wait, processing..." &
  544. WAITPID=$!
  545. ./findwoofinstalledpkgs >/dev/null #writes db entries to /tmp/woof-installed-packages-pet and /tmp/woof-installed-packages-compat
  546. #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|
  547. CHOSEN_ENTRIES="`cat /tmp/woof-installed-packages-compat | tr -d '"' | sed -e 's%|% %' -e 's%|% on "%' -e 's%$%"%'`" #'geany
  548. #...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|"
  549. ccpPATTERNS="`cat /tmp/CHOSEN_COMPAT_PKGS | cut -f 1 -d '|' | sed -e 's%^%|%' -e 's%$%|%'`"
  550. echo "$ccpPATTERNS" > /tmp/ccpPATTERNS
  551. PACKAGELISTS_COMPAT="`cat /tmp/PACKAGELISTS_COMPAT`"
  552. grep --file=/tmp/ccpPATTERNS -v $PACKAGELISTS_COMPAT > /tmp/NOT_CHOSEN_COMPATS_DB_RAW #note: grep prepends <filename>: on each line.
  553. ####UNCHOSEN ENTRIES MAY BE TOO BIG!#####
  554. ####may need to add category filtering, plus for debian get rid of those language pkgs####
  555. # #w091018 ubuntu/debian not-chosen list is too long for Xdialog. for now, until i can think of anything better...
  556. # 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
  557. #tool used for the GUI cannot handle a long list of all of them.\n
  558. #Until I think of a better way of doing it, this cumbersome method\n
  559. #is used -- choose by first character. For example, if you want to\n
  560. #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`"
  561. # [ "$nceFIRST" = "" -o $? -ne 0 ] && nceFIRST='aA'
  562. # ncePATTERN="^[${nceFIRST}]"
  563. # #and add ncePATTERN here to extract alphabetical pkgs only...
  564. # 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
  565. 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
  566. #...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|"
  567. #xNOT_CHOSEN_ENTRIES="`echo "$NOT_CHOSEN_ENTRIES" | tr '\n' ' '`"
  568. #xCHOSEN_ENTRIES="`echo "$CHOSEN_ENTRIES" | tr '\n' ' '`"
  569. kill $WAITPID
  570. 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"
  571. echo "$EXECME" > /tmp/woof_gui_not_chosen_items #TEST
  572. eval $EXECME
  573. if [ $? -eq 0 ];then
  574. rtPATTERNS="`cat /tmp/ccp_rettags.txt | tr ' ' '\n' | sed -e 's%^%^%' -e 's%$%|%'`"
  575. echo "$rtPATTERNS" > /tmp/rtPATTERNS
  576. NEW_CHOSEN_GENERICNAMES="`cat $PACKAGELISTS_COMPAT | grep --file=/tmp/rtPATTERNS | cut -f 2 -d '|' | sort -u`"
  577. OLD_CHOSEN_GENERICNAMES="`cat /tmp/woof-installed-packages-compat | cut -f 2 -d '|' | sort -u`"
  578. echo "$NEW_CHOSEN_GENERICNAMES" > /tmp/NEW_CHOSEN_GENERICNAMES
  579. echo "$OLD_CHOSEN_GENERICNAMES" > /tmp/OLD_CHOSEN_GENERICNAMES
  580. rtDIFF="`diff /tmp/OLD_CHOSEN_GENERICNAMES /tmp/NEW_CHOSEN_GENERICNAMES`"
  581. COMPAT_ADDED="`echo "$rtDIFF" | grep '^> ' | cut -f 2 -d ' '`" #generic names only, one each line.
  582. COMPAT_REMOVED="`echo "$rtDIFF" | grep '^< ' | cut -f 2 -d ' '`" # "
  583. if [ "$COMPAT_REMOVED" != "" ];then
  584. prPATTERNS="`echo "$COMPAT_REMOVED" | sed -e 's%^%[|,]%' -e 's%$%[|,]%'`" #finds an entry in 3rd field of PKGS_SPECS_TABLE
  585. echo "$prPATTERNS" > /tmp/prPATTERNS
  586. PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep --file=/tmp/prPATTERNS -v`"
  587. fi
  588. ####for now, create new entry 'yes|<genericname>|<genericname>|exe,dev,doc,nls'
  589. ####but need to ask about the last field....
  590. ####also for debian/ubuntu many pkgs are split into smaller pkgs, may want to bring them together.
  591. ####if compat-distro=puppy, merge _DEV into any pre-existing entry (?)
  592. echo "$PKGS_SPECS_TABLE" > /tmp/PKGS_SPECS_TABLE
  593. if [ "$COMPAT_ADDED" != "" ];then
  594. #NEW_ENTRIES="`echo "$COMPAT_ADDED" | sed -e 's%^%yes|%' -e 's%$%||exe%'`"
  595. #echo "$NEW_ENTRIES" >> /tmp/PKGS_SPECS_TABLE
  596. for ONE_CA in $COMPAT_ADDED
  597. do
  598. echo "yes|${ONE_CA}|${ONE_CA}|exe,dev,doc,nls" >> /tmp/PKGS_SPECS_TABLE
  599. done
  600. #important note, order is important. ex, seamonkey must come before the seamonkey_addon pkgs,
  601. #as former has symlink /usr/lib/seamonkey, latter have it as an actual directory. The param
  602. #'--key=2,2' takes care of the seamonkey case, sort on field 2 only...
  603. PKGS_SPECS_TABLE="`sort --key=2,2 --field-separator='|' --unique /tmp/PKGS_SPECS_TABLE`"
  604. echo "$PKGS_SPECS_TABLE" > /tmp/PKGS_SPECS_TABLE
  605. fi
  606. #update for gui...
  607. echo -n "" > /tmp/CHOSEN_COMPAT_PKGS
  608. for ONE_CCP in $NEW_CHOSEN_GENERICNAMES
  609. do
  610. occpPATTERN='|'"$ONE_CCP"'|'
  611. occpDESCR="`cat $PACKAGELISTS_COMPAT | grep "$occpPATTERN" | head -n 1 | cut -f 10 -d '|'`"
  612. echo "${ONE_CCP}|${occpDESCR}" >> /tmp/CHOSEN_COMPAT_PKGS
  613. done
  614. #update DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}...
  615. echo "FALLBACKS_COMPAT_VERSIONS='$FALLBACKS_COMPAT_VERSIONS'" > ${DPSFILE}
  616. echo "PKGS_SPECS_TABLE='$PKGS_SPECS_TABLE'" >> ${DPSFILE}
  617. Xdialog --center --title "Compat-distro package selection change" --msgbox "These packages have been added:\n
  618. ${COMPAT_ADDED}\n
  619. These packages have been removed:\n
  620. ${COMPAT_REMOVED}\n
  621. The changes have been made to variable 'PKGS_SPECS_TABLE'\n
  622. in file ${DPSFILE}" 0 0
  623. fi
  624. }
  625. check_dependencies_func() {
  626. xmessage "COMING SOON"
  627. }
  628. #######Download pkgs#####
  629. download_summary_func() {
  630. xmessage "COMING SOON"
  631. }
  632. ########Build pkgs########
  633. CHOSEN_GENERICNAMES="`echo "$PKGS_SPECS_TABLE" | grep -v '^#' | grep '^yes' | cut -f 2 -d '|'`"
  634. if [ -s /var/cache/woof/2createpackages_history_builds-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  635. ITEMS_CG="<item>CHANGED_ONLY</item><item>ALL_PACKAGES</item>" #091211
  636. else
  637. ITEMS_CG="<item>ALL_PACKAGES</item>"
  638. fi
  639. ITEMS_CG="${ITEMS_CG} `echo "$CHOSEN_GENERICNAMES" | sed -e 's%^%<item>%' -e 's%$%</item>%' | tr '\n' ' '`"
  640. createpackages_summary_func() {
  641. xmessage "COMING SOON"
  642. }
  643. #######Build distro#######
  644. AVAILKERNELS="`ls -1 packages-pet/linux_kernel-*.pet`"
  645. ITEMS_AK=""
  646. [ "$DISTRO_KERNEL_PET" ] && ITEMS_AK='<item>'"$DISTRO_KERNEL_PET"'</item>' #should be in DISTRO_SPECS.
  647. for ONE_AK in $AVAILKERNELS
  648. do
  649. BASE_AK="`basename $ONE_AK`"
  650. [ "$BASE_AK" = "$DISTRO_KERNEL_PET" ] && continue
  651. ITEMS_AK="${ITEMS_AK}<item>${BASE_AK}</item>"
  652. done
  653. ITEMS_SCSI0='<item>'"$HISTORY_wantscsi"'</item>' #see support/HISTORY_3builddistro
  654. ITEMS_SCSI="${ITEMS_SCSI0}`echo 'Erase_SCSI Keep_SCSI Boot_SCSI' | tr ' ' '\n' | grep -v "$HISTORY_wantscsi" | sed -e 's%^%<item>%' -e 's%$%</item>%'`"
  655. ITEMS_BIGMODEM0='<item>'"$HISTORY_bigmodem"'</item>' #see support/HISTORY_3builddistro
  656. 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>%'`"
  657. CHK_FB_DEFAULT="$HISTORY_CHK_FB_STATE"
  658. CHK_EXOTIC_DEFAULT="$HISTORY_CHK_EXOTIC_STATE"
  659. CHK_RADICAL_DEFAULT="$HISTORY_CHK_RADICAL_STATE"
  660. CHK_SIMPLE_FILENAMES_DEFAULT="$HISTORY_CHK_SIMPLE_FILENAMES_STATE" #100912
  661. save_builddistro_options_func() {
  662. cp -f support/HISTORY_3builddistro /tmp/HISTORY_3builddistro-backup1
  663. echo "
  664. HISTORY_KERNELPKG='${CHOICE_KERNELPKG}'
  665. HISTORY_wantscsi='${CHOICE_SCSI}'
  666. HISTORY_bigmodem='${CHOICE_BIGMODEM}'
  667. HISTORY_CHK_FB_STATE='${CHK_FB_STATE}'
  668. HISTORY_CHK_EXOTIC_STATE='${CHK_EXOTIC_STATE}'
  669. HISTORY_CHK_RADICAL_STATE='${CHK_RADICAL_STATE}'
  670. HISTORY_CHK_SIMPLE_FILENAMES_STATE='${CHK_SIMPLE_FILENAMES_STATE}'" > support/HISTORY_3builddistro #100912
  671. #100514 if defined in file DISTRO_SPECS, update...
  672. dkpPATTERN="s%^DISTRO_KERNEL_PET.*%DISTRO_KERNEL_PET='${CHOICE_KERNELPKG}'%"
  673. sed -i -e "$dkpPATTERN" ./DISTRO_SPECS
  674. }
  675. export MAIN_DIALOG="
  676. <window title=\"Woof: the Puppy builder\" icon-name=\"gtk-preferences\" >
  677. <vbox>
  678. <notebook page=\"${DEFAULTTABNUM}\" labels=\"Specifications|PET repos|Compat repos|Download dbs|Choose pkgs|Download pkgs|Build pkgs|Kernel options|Build distro\">
  679. <vbox>
  680. <hbox>
  681. <text use-markup=\"true\"><label>\"<b>These are the highest-level settings for building Puppy</b>\"</label></text>
  682. <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>
  683. </hbox>
  684. <hbox>
  685. <text><label>A title for this build:</label></text>
  686. <entry>
  687. <input>cat /tmp/woof_gui_dn</input>
  688. <variable>xDISTRO_NAME</variable>
  689. </entry>
  690. <text><label>\"(Any title, one to three words)\"</label></text>
  691. <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>
  692. <combobox><variable>xHISTORY_DISTRO_NAME</variable>${ITEMS_HDN}</combobox>
  693. </hbox>
  694. <hbox>
  695. <text><label>Puppy version number:</label></text>
  696. <entry>
  697. <default>${DISTRO_VERSION}</default>
  698. <variable>xDISTRO_VERSION</variable>
  699. </entry>
  700. <text><label>(use dots to separate: major.minor[.subminor...] ex: 5.1.23)</label></text>
  701. <text><label>\" \"</label></text>
  702. </hbox>
  703. <hbox>
  704. <text><label>File prefix:</label></text>
  705. <entry>
  706. <input>cat /tmp/woof_gui_dfp</input>
  707. <variable>xDISTRO_FILE_PREFIX</variable>
  708. </entry>
  709. <text><label>\"(one to four characters only)\"</label></text>
  710. <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>
  711. <combobox><variable>xHISTORY_DISTRO_FILE_PREFIX</variable>${ITEMS_HDFP}</combobox>
  712. </hbox>
  713. <hbox>
  714. <text>
  715. <label>Compatible-distro:</label>
  716. </text>
  717. <combobox>
  718. <variable>xDISTRO_BINARY_COMPAT</variable>
  719. ${ITEMSCOMP}
  720. </combobox>
  721. <text><label>(this the distro where to get the binary pkgs from)</label></text>
  722. <text><label>\" \"</label></text>
  723. </hbox>
  724. <hbox>
  725. <text><label>Compatible-distro version:</label></text>
  726. <entry>
  727. <input>cat /tmp/woof_gui_dcv</input>
  728. <variable>xDISTRO_COMPAT_VERSION</variable>
  729. </entry>
  730. <text><label>\"(a word or number)\"</label></text>
  731. <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>
  732. <combobox><variable>xHISTORY_DISTRO_COMPAT_VERSION</variable>${ITEMS_HDCV}</combobox>
  733. </hbox>
  734. <text><label>\" \"</label></text>
  735. <hbox space-expand=\"true\">
  736. <text><label>The available kernels are PET packages, located in directory 'packages-pet'. Choose which one is to be in the live-CD. ALTERNATIVELY, check the 'huge kernel' checkbox</label></text>
  737. <combobox width-request=\"300\"><variable>CHOICE_KERNELPKG</variable>${ITEMS_AK}</combobox>
  738. <checkbox><label>Huge Kernel</label><variable>CB_HK</variable></checkbox>
  739. </hbox>
  740. <hbox>
  741. <text><label>\" \"</label></text>
  742. <frame Previous templates>
  743. <hbox>
  744. <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>
  745. <combobox><variable>xHISTORY_DISTRO_SPECS_TEMPLATE</variable>${ITEMS_HDST}</combobox>
  746. </hbox>
  747. </frame>
  748. </hbox>
  749. <hbox>
  750. <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>
  751. <text use-markup=\"true\"><label>\"<b>If any changes made above, click 'UPDATE' button to save changes:</b>\"</label></text>
  752. </hbox>
  753. <hbox>
  754. <button><label>Help: Introduction</label><action>defaulttextviewer ./README.txt & </action></button>
  755. <button><label>UPDATE OVERALL SPECS</label><action>update_distro_specs_func</action><action type=\"exit\">UPDATE_DS</action></button>
  756. </hbox>
  757. </vbox>
  758. <vbox>
  759. <hbox>
  760. <text use-markup=\"true\"><label>\"<b>These are the online repositories of PET packages</b>\"</label></text>
  761. <text><label>Even if you are building Puppy from some other compatible-distro, still many PET packages are required</label></text>
  762. <button><label>Edit</label><action>edit_pet_repos_func</action><action type=\"refresh\">TREE_PET_REPOS</action></button>
  763. </hbox>
  764. <tree>
  765. <label>URL|Local database file(s)</label>
  766. <input>cat /tmp/woof_gui_pet_repos | tr '\n' ' ' | sed -e 's%\n$%%' | tr ' ' '\n' | cut -f 2,3 -d '|'</input>
  767. <variable>TREE_PET_REPOS</variable>
  768. </tree>
  769. <hbox>
  770. <text use-markup=\"true\"><label>\"<b>Online PET database files</b>\"</label></text>
  771. <text><label>The up-to-date PET database files are online, for Woof to download</label></text>
  772. <button><label>Edit</label><action>edit_pkg_docs_pet_repos_func</action><action type=\"refresh\">TREE_PKG_DOCS_PET_REPOS</action></button>
  773. </hbox>
  774. <tree>
  775. <label>URL of online database file|Local database file</label>
  776. <input>cat /tmp/woof_gui_pkg_docs_pet_repos | tr '\n' ' ' | sed -e 's%\n$%%' | tr ' ' '\n' | cut -f 2,3 -d '|'</input>
  777. <variable>TREE_PKG_DOCS_PET_REPOS</variable>
  778. </tree>
  779. <text><label>\" \"</label></text>
  780. <hbox>
  781. <text><label>This tab is a GUI for configuration file 'DISTRO_PET_REPOS'.</label></text>
  782. <text use-markup=\"true\"><label>\"<b>If any changes made above, click 'UPDATE' button to save:</b>\"</label></text>
  783. </hbox>
  784. <hbox>
  785. <button><label>Help: Repositories</label><action>defaulthtmlviewer /usr/local/petget/README-add-repo.htm & </action></button>
  786. <button><label>UPDATE PET REPOS</label><action>update_distro_pet_repos_func</action><action type=\"exit\">UPDATE_PR</action></button>
  787. </hbox>
  788. </vbox>
  789. <vbox>
  790. <hbox>
  791. <text use-markup=\"true\"><label>\"<b>These are the online repositories of compatible-distro (${DISTRO_BINARY_COMPAT}) packages</b>\"</label></text>
  792. <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>
  793. <button><label>Edit</label><action>edit_compat_repos_func</action><action type=\"refresh\">TREE_COMPAT_REPOS</action></button>
  794. </hbox>
  795. <tree>
  796. <label>URL|Local database file(s)</label>
  797. <input>cat /tmp/woof_gui_compat_repos | tr '\n' ' ' | sed -e 's%\n$%%' | tr ' ' '\n' | cut -f 2,3 -d '|'</input>
  798. <variable>TREE_COMPAT_REPOS</variable>
  799. </tree>
  800. <hbox>
  801. <text use-markup=\"true\"><label>\"<b>Online compat-distro database files</b>\"</label></text>
  802. <text><label>The up-to-date compat-distro database files are online, for Woof to download</label></text>
  803. <button><label>Edit</label><action>edit_pkg_docs_compat_repos_func</action><action type=\"refresh\">TREE_PKG_DOCS_COMPAT_REPOS</action></button>
  804. </hbox>
  805. <tree>
  806. <label>URL of online database file|Local database file</label>
  807. <input>cat /tmp/woof_gui_pkg_docs_compat_repos | tr '\n' ' ' | sed -e 's%\n$%%' | tr ' ' '\n' | cut -f 2,3 -d '|'</input>
  808. <variable>TREE_PKG_DOCS_COMPAT_REPOS</variable>
  809. </tree>
  810. <text><label>\" \"</label></text>
  811. <hbox>
  812. <text><label>This tab is a GUI for configuration file '${DCRFILE}'.</label></text>
  813. <text use-markup=\"true\"><label>\"<b>If any changes made above, click 'UPDATE' button to save:</b>\"</label></text>
  814. </hbox>
  815. <hbox>
  816. <button><label>Help: Repositories</label><action>defaulthtmlviewer /usr/local/petget/README-add-repo.htm & </action></button>
  817. <button><label>UPDATE COMPAT-DISTRO REPOS</label><action>update_distro_compat_repos_func</action><action type=\"exit\">UPDATE_CR</action></button>
  818. </hbox>
  819. </vbox>
  820. <vbox>
  821. <hbox>
  822. <text use-markup=\"true\"><label>\"<b>This tab is for downloading the package databases</b>\"</label></text>
  823. <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>
  824. </hbox>
  825. <hbox>
  826. <frame PET pkg online databases><text><label>\"${PET_REPOS_LIST_ONLINE}\"</label></text></frame>
  827. <frame PET pkg local databases><text><label>\"${PET_REPOS_LIST_LOCAL}\"</label></text></frame>
  828. <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>
  829. </hbox>
  830. <hbox>
  831. <frame compat-distro pkg online databases><text><label>\"${PKG_DOCS_DISTRO_COMPAT_LIST_ONLINE}\"</label></text></frame>
  832. <frame compat-distro pkg local databases><text><label>\"${PKG_DOCS_DISTRO_COMPAT_LIST_LOCAL}\"</label></text></frame>
  833. <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>
  834. </hbox>
  835. <hbox>
  836. <text use-markup=\"true\"><label>\"<b>WARNING: If you click 'UPDATE', the download and conversion will take a long time</b>\"</label></text>
  837. <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>
  838. </hbox>
  839. <text><label>\" \"</label></text>
  840. <hbox>
  841. <text><label>This tab is a frontend for script '0setup'</label></text>
  842. <text use-markup=\"true\"><label>\"<b>Click 'UPDATE' if any files missing in right panes, or need updating:</b>\"</label></text>
  843. <text use-markup=\"true\"><label>\"<b>Report on last update:</b>\"</label></text>
  844. </hbox>
  845. <hbox>
  846. <button><label>Help: Standard DB Format</label><action>defaulthtmlviewer http://puppylinux.com/woof/pkg-db-format.htm & </action></button>
  847. <button><label>UPDATE LOCAL DB FILES</label><action type=\"exit\">UPDATE_DB</action></button>
  848. <button><label>REPORT</label><action>report_0setup_func</action></button>
  849. </hbox>
  850. </vbox>
  851. <vbox>
  852. <hbox>
  853. <text use-markup=\"true\"><label>\"<b>This tab is for choosing what packages you want to have in the Puppy build</b>\"</label></text>
  854. <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>
  855. </hbox>
  856. <hbox>
  857. <tree><label>Chosen PET packages|Descriptions</label><input>cat /tmp/CHOSEN_PET_PKGS</input><height>180</height><variable>TREE_CHOSEN_PET_PKGS</variable></tree>
  858. <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>
  859. </hbox>
  860. <hbox>
  861. <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>
  862. <text><label>These are binary packages available in the compatible-distro '${DISTRO_BINARY_COMPAT}', release '${DISTRO_COMPAT_VERSION}'.</label></text>
  863. </hbox>
  864. <text><label>This tab is a frontend for config file '${DPSFILE}'</label></text>
  865. <hbox>
  866. <button><label>ADD/REMOVE PET PKGS</label><action>add_remove_pet_pkgs_func</action><action type=\"refresh\">TREE_CHOSEN_PET_PKGS</action></button>
  867. <button><label>ADD/REMOVE COMPAT-DISTRO PKGS</label><action>add_remove_compat_pkgs_func</action><action type=\"refresh\">TREE_CHOSEN_COMPAT_PKGS</action></button>
  868. <button><label>CHECK DEPENDENCIES</label><action>check_dependencies_func</action></button>
  869. </hbox>
  870. </vbox>
  871. <vbox>
  872. <hbox>
  873. <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>
  874. <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>
  875. </hbox>
  876. <hbox>
  877. <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>
  878. <vbox>
  879. <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>
  880. </vbox>
  881. </hbox>
  882. <hbox>
  883. <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>
  884. <vbox>
  885. <button><label>REPORT</label><action>download_summary_func</action></button>
  886. </vbox>
  887. </hbox>
  888. <text><label>\" \"</label></text>
  889. <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>
  890. <text><label>\" \"</label></text>
  891. <text><label>This tab is a frontend for script '1download'</label></text>
  892. </vbox>
  893. <vbox>
  894. <hbox>
  895. <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>
  896. <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>
  897. </hbox>
  898. <hbox>
  899. <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>
  900. <combobox><variable>CHOICE_CREATEPACKAGES</variable>${ITEMS_CG}</combobox>
  901. </hbox>
  902. <hbox>
  903. <text><label>Click this button to build all the packages in directory 'packages-${DISTRO_FILE_PREFIX}', or the single package selected above:</label></text>
  904. <vbox>
  905. <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>
  906. </vbox>
  907. </hbox>
  908. <hbox>
  909. <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>
  910. <vbox>
  911. <button><label>REPORT</label><action>createpackages_summary_func</action></button>
  912. </vbox>
  913. </hbox>
  914. <text><label>\" \"</label></text>
  915. <text><label>This tab is a frontend for script '2createpackages'</label></text>
  916. </vbox>
  917. <vbox>
  918. <hbox>
  919. <text use-markup=\"true\"><label>\"<b>This tab is to choose the kernel config and module options. This is ignored for a 'huge' build.</b>\"</label></text>
  920. <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>
  921. </hbox>
  922. <frame Kernel modules options >
  923. <hbox>
  924. <vbox>
  925. <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>
  926. <hbox><combobox><variable>CHOICE_SCSI</variable>${ITEMS_SCSI}</combobox></hbox>
  927. </vbox>
  928. <vbox>
  929. <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>
  930. <hbox><combobox><variable>CHOICE_BIGMODEM</variable>${ITEMS_BIGMODEM}</combobox></hbox>
  931. </vbox>
  932. </hbox>
  933. <hbox>
  934. <vbox>
  935. <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>
  936. <checkbox><label>Tick to erase framebuffer modules</label><default>${CHK_FB_DEFAULT}</default><variable>CHK_FB_STATE</variable></checkbox>
  937. </vbox>
  938. <vbox>
  939. <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>
  940. <checkbox><label>Tick to erase exotic modules</label><default>${CHK_EXOTIC_DEFAULT}</default><variable>CHK_EXOTIC_STATE</variable></checkbox>
  941. <checkbox><label>Tick for radical culling of modules</label><default>${CHK_RADICAL_DEFAULT}</default><variable>CHK_RADICAL_STATE</variable></checkbox>
  942. </vbox>
  943. </hbox>
  944. </frame>
  945. <hbox>
  946. <text><label>This tab and the next are frontends for script '3builddistro'.</label></text>
  947. <text use-markup=\"true\"><label>\"<b>Choose the kernel and module options above, then go onto the 'Build distro' tab...</b>\"</label></text>
  948. </hbox>
  949. </vbox>
  950. <vbox>
  951. <hbox>
  952. <text use-markup=\"true\"><label>\"<b>This tab is for building the live-CD and 'devx' file</b>\"</label></text>
  953. <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>
  954. </hbox>
  955. <text><label>\" \"</label></text>
  956. <hbox>
  957. <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>
  958. <vbox>
  959. <checkbox><label>Tick for simplified filenames</label><default>${CHK_SIMPLE_FILENAMES_DEFAULT}</default><variable>CHK_SIMPLE_FILENAMES_STATE</variable></checkbox>
  960. <button><label>help</label><action>defaulthtmlviewer `pwd`/support/help_filenames.htm & </action></button>
  961. </vbox>
  962. </hbox>
  963. <text><label>\" \"</label></text>
  964. <text><label>MORE STUFF HERE SOON</label></text>
  965. <text><label>\" \"</label></text>
  966. <text><label>This tab is a frontend for script '3builddistro'</label></text>
  967. <hbox>
  968. <text><label>After making appropriate choices above, click here to build live-CD: CAUTION: The new HUGE BUILD DISTRO is only if you intend to build with a huge kernel. All the checkboxes for simple file names, frame buffer module deletion, scsi etc are ignored. See README in kernel-kit for more info.</label></text>
  969. <button><label>BUILD DISTRO (normal build)</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>
  970. <button><label>HUGE BUILD DISTRO</label><action>save_builddistro_options_func</action><action>rxvt -title \"Building distro\" -bg yellow -e ./3builddistro-Z </action></button>
  971. </hbox>
  972. </vbox>
  973. </notebook>
  974. </vbox>
  975. </window>"
  976. #gtkdialog3 --program=MAIN_DIALOG