1choosepackages 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. #!/bin/bash
  2. #we have DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}, for example
  3. #DISTRO_PKGS_SPECS-puppy-wary5, which has variable PKGS_SPECS_TABLE which is a list of
  4. #chosen packages.
  5. #this script is for rebuilding PKGS_SPECS_TABLE, with a choice suiting you, and
  6. #taking into account dependencies.
  7. #110610 first version.
  8. #120111 updated for woof2.
  9. #121102 file DISTRO_SPECS has new variable DISTRO_DB_SUBNAME. ex: for 14.0-based slacko, DISTRO_DB_SUBNAME=slacko14
  10. . ./DISTRO_SPECS
  11. [ ! "$DISTRO_DB_SUBNAME" ] && DISTRO_DB_SUBNAME="$DISTRO_COMPAT_VERSION" #121102 fallback if DISTRO_DB_SUBNAME not defined in file DISTRO_SPECS.
  12. if [ -f ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  13. CURRENT_CHOICE=DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  14. else
  15. CURRENT_CHOICE=DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}
  16. fi
  17. . ./DISTRO_PET_REPOS #has PACKAGELISTS_PET_ORDER
  18. . ./PKGS_MANAGEMENT
  19. xPKG_NAME_ALIASES="`echo "$PKG_NAME_ALIASES" | tr ' ' '\n' | grep -v '^$' | sed -e 's%^%|%' -e 's%$%|%' -e 's%,%|,|%g' -e 's%\\*%.*%g'`"
  20. echo "$xPKG_NAME_ALIASES" > /tmp/1choosepackages_pkg_name_aliases_patterns
  21. echo "$xPKG_NAME_ALIASES" | tr ',' '\n' > /tmp/1choosepackages_pkg_name_aliases_patterns2
  22. XD7="Xdialog --wrap --stdout --left --title \"1choosepackages: welcome\" --msgbox \"Welcome to the '1choosepackages' script. Ultimately, this script is planned to be an easy GUI means of selecting all packages in the PKGS_SPECS_TABLE variable (in file ${CURRENT_CHOICE}), however for now it only offers selection of the base PET packages.
  23. The base PET packages are those used in all Puppy builds. These are in the 'noarch' and 'common' repos at ibiblio.org. Click the 'Help' button in the next dialog window if you want more explanation.
  24. Running this script will not wreak your current PKGS_SPECS_TABLE (hopefully), it will only update your choices of what base packages you want in the build, and will modify PKGS_SPECS_TABLE accordingly -- you will be able to view all changes before committing.\" 0 90"
  25. eval "$XD7"
  26. [ $? -ne 0 ] && exit
  27. #default yes choices in wary5 5.1.2...
  28. YES_puppy_wary5="915resolution a52dec abiword afternoonstalker align alsa-lib21a alsa-utils21 apr apr-util asunder atk audiofile aufs2-util-old aufs2-util autoconf automake axel ayttm bacon bash batrachians bbc_provided bc bcrypt bin86 binutils bison boehm-gc bones burgerspace busybox bzip2 cairo cddetect cdparanoia-III cdrkit cgtkcalc chmlib cmake coreutils cosmosmash cpio cups cups_pdf curl cvs ddcprobe desk_icon_theme_jq8flat desk_icon_theme_silver_marble desk_icon_theme_smooth_color desk_icon_theme_stardust dhcpcd dialog dictd_client didiwiki dietlibc diffstat diffutils disktype dmidecode docbookx dosfstools dpkg-deb dvdauthor dvd+rwtools e2fsprogs e3_utf8 edid eject elspci embutils_cut enchant epdfview ethtool exiv2 expat faac faad2 ffconvert ffmpeg file file_sharing-curlftpfs-mpscan findutils flac flashplayer flatzebra flex floppy_format flsynclient foomatic-filters fpm2 freeglut freememapplet_tray freetype fribidi fuse gawk gcc_dev gcc_lib gccmakedep gcolor2 gdb gdbm gdmap geany getcurpos getdir gettext gettext-tools gexec gfnrename gfontsel gftp ghasher ghostscript gifsicle git glade3 glib glibc_dev glibc glibc_locales glipper gmeasures gmp gnumeric gnome-menus goffice gparted gperf gphoto2 gpptp grep groff grub grub4dos gtk+ gtkam gtk-chtheme gtkdialog2 gtkdialog3 gtklp gtk_theme_citrus_cut gtk_theme_flat_grey_rounded gtk_theme_gradient_grey gtk_theme_polished_blue gtksourceview gtrayicon guess_fs gutenprint gview gwhere gzip hardinfo helpsurfer hiawatha hicolor-icon-theme homebank hotplug2stdout hunspell hunspell-en-us id3lib ifplugd ifplugd_old imake inkscapelite inotail inotify-tools installwatch intltool iptables isomaster jasper jimtcl jwm2 jwmconfig2 ktsuss lame lcms libao libart libcap libcddb libcdio libdaemon libdc1394 libdv libdvdcss libdvdnav libdvdplay libdvdread libexif libexif-gtk libgee libgif libgl libglade2 libgnomecanvas libgnomecups libgnomeprint libgnomeprintui libgphoto2 libgsf libgtkhtml libical libid3tag libidl libidn libieee1284 libjpeg libjpeg_old libltdl libmad libmng libofx libogg libpciaccess libpng libpthread-stubs libraw1394 librsvg libsigc++ libsndfile libstdc++ libtheora libtiff libtool libusb libvorbis libvpx libxcb_base libxml2 libxscrnsaver libxslt libyahoo2 linux_firewall linux_firmware_dvb linux_headers linuxwacom m4 madplay make makebootfat man man_cut maze-rays mesa_base mesa-demos metamail mhwaveedit mingetty minixcal mirdir mktemp modem_stats module-init-tools mp mpfr mplayer_gui mplayerplug-in mplayer_codecs_basic ms-sys mscw mtpaint mtr mut2 nasm nbtscan ncurses ndiswrapper nenscript neon netpbm net_setup net-tools network_tray nicoedit normalize notecase ntfs-3g ntfsprogs ogle ogle_gui opencore-amr OpenSP openssh_client openssl orc osmo pango panoramixproto_xorg73 parted partview patch patchutils pbackup pburn pcd pciutils pcmciautils pcre pdvdrsab peasyscan perl perl_tiny perl-digest-sha1 perl-digest-sha1 perl-extutils-depends perl-extutils-pkgconfig perl-html-parser perl-html-parser perl-uri perl-xml-simple perl-xml-parser pfilesearch pfind picocom pixman pkgconfig pmetatagger pmirror pmirrorget pmusic pnethood poppler popt powerapplet_tray pplog ppp pprocess pptp precord prename procps programchooser pschedule psip psmisc psync ptiming ptooltips puppyinputdetect puppy-podcast-grabber puppyserialdetect pupradio pupx pure_ftpd pwallpaper pwsget python pzchmview readline replaceit retrovol rman rox_filer rp_pppoe_cli rsync rubix rxvt-unicode samba_client samba_mount_cifs sane-backends scale2x schroedinger scrollkeeper SDL SDL_image SDL_mixer SDL_ttf seamonkey1 seamonkey1_addon_adblock seamonkey1_addon_copyplaintext seamonkey1_addon_flashblock seamonkey1_addon_fullerscreen seamonkey1_addon_user_agent_switcher seamonkey1_addon_zombiekeys sed setserial setvol sfs-converter sgtt shared-mime-info snap2 speex sqlite squashfs-tools squashfs-tools4 ssh_gui startup-notification strace subversion sudo superscan sys-freedos sysfsutils syslinux sysprof sysvinit tar texinfo transmission truncate udev_167p unclutter unionfs_utils unzip usb-modeswitch usb-modeswitch-data util-linux util-macros vala vamps vcdimager viewnior vobcopy vorbis-tools waitmax wavplay wcpufreq wget wireless-tools wpa_supplicant wv wv_patterns_wingding wvdial x11proto x264 xarchive xclip xcompmgr xcur2png xdelta xdg_puppy xdialog xf86-input-synaptics xf86-video-ati-radeon_mach64_r128-june2008 xf86-video-geode xf86-video-i810 xf86-video-i810_old xf86-video-nv xf86-video-openchrome xf86-video-rdc xfdiff-cut xfprot xkbconfigmanager xload xlock_gui xlockmore xorg-input-wizardpen xorg-server xorg73_base_t2 xsane xserver_xorg_partialcut_t2 xserver_xvesa_t2 xsoldier xtrans xvidcore xz yaf_splash yasm ycalc you2pup zip zlib zzt2_fixup_hack_xorg73 "
  29. YES_PETS_wary_512="afternoonstalker align axel bacon bash batrachians bbc_provided bcrypt bones burgerspace cddetect cgtkcalc coreutils cosmosmash cups_pdf ddcprobe desk_icon_theme_jq8flat desk_icon_theme_silver_marble desk_icon_theme_smooth_color desk_icon_theme_stardust dictd_client didiwiki dietlibc disktype e3_utf8 edid elspci embutils_cut ffconvert file_sharing-curlftpfs-mpscan flatzebra floppy_format flsynclient fpm2 freememapplet_tray gcolor2 gdmap getcurpos getdir gexec gfnrename gfontsel ghasher gifsicle glipper gmeasures gnome-menus gpptp grub grub4dos gtk-chtheme gtkdialog2 gtk_theme_citrus_cut gtk_theme_flat_grey_rounded gtk_theme_gradient_grey gtk_theme_polished_blue gtrayicon guess_fs gview gwhere hardinfo helpsurfer hiawatha hotplug2stdout hunspell-en-us id3lib ifplugd_old inotail installwatch jimtcl jwm2 jwmconfig2 ktsuss libjpeg_old libstdc++ linux_firewall linux_firmware_dvb makebootfat man_cut maze-rays metamail mingetty minixcal mirdir modem_stats mp mplayerplug-in mplayer_codecs_basic ms-sys mscw mut2 nbtscan nenscript net_setup panoramixproto_xorg73 partview pbackup pburn pcd pdvdrsab peasyscan pfilesearch pfind picocom pmetatagger pmirror pmirrorget pmusic pnethood pplog pprocess pptp precord prename programchooser pschedule psip psync ptiming ptooltips puppyinputdetect puppy-podcast-grabber puppyserialdetect pupradio pupx pure_ftpd pwallpaper pwsget pzchmview replaceit rox_filer rp_pppoe_cli rubix samba_client samba_mount_cifs scale2x seamonkey1 setvol sfs-converter sgtt shared-mime-info snap2 squashfs-tools squashfs-tools4 ssh_gui sudo superscan sys-freedos syslinux sysvinit transmission truncate udev_167p unclutter unionfs_utils usb-modeswitch usb-modeswitch-data viewnior vobcopy waitmax wavplay wcpufreq wvdial xarchive xclip xcur2png xdg_puppy xdialog xfdiff-cut xfprot xkbconfigmanager xlock_gui xlockmore xserver_xvesa_t2 xsoldier xz yaf_splash yasm ycalc you2pup "
  30. YES_HOST_PKGS_wary_512="915resolution a52dec abiword alsa-lib21a alsa-utils21 apr apr-util asunder atk audiofile aufs2-util-old aufs2-util autoconf automake ayttm bc bin86 binutils bison boehm-gc busybox bzip2 cairo cdparanoia-III cdrkit chmlib cmake cpio cups curl cvs dhcpcd dialog diffstat diffutils dmidecode docbookx dosfstools dpkg-deb dvdauthor dvd+rwtools e2fsprogs eject enchant epdfview ethtool exiv2 expat faac faad2 ffmpeg file findutils flac flashplayer flex foomatic-filters freeglut freetype fribidi fuse gawk gcc_dev gcc_lib gccmakedep gdb gdbm geany gettext gettext-tools gftp ghostscript git glade3 glib glibc_dev glibc glibc_locales gmp gnumeric goffice gparted gperf gphoto2 grep groff gtk+ gtkam gtkdialog3 gtklp gtksourceview gutenprint gzip hicolor-icon-theme homebank hunspell ifplugd imake inkscapelite inotify-tools intltool iptables isomaster jasper lame lcms libao libart libcap libcddb libcdio libdaemon libdc1394 libdv libdvdcss libdvdnav libdvdplay libdvdread libexif libexif-gtk libgee libgif libgl libglade2 libgnomecanvas libgnomecups libgnomeprint libgnomeprintui libgphoto2 libgsf libgtkhtml libical libid3tag libidl libidn libieee1284 libjpeg libltdl libmad libmng libofx libogg libpciaccess libpng libpthread-stubs libraw1394 librsvg libsigc++ libsndfile libtheora libtiff libtool libusb libvorbis libvpx libxcb_base libxml2 libxscrnsaver libxslt libyahoo2 linux_headers linuxwacom m4 madplay make man mesa_base mesa-demos mhwaveedit mktemp module-init-tools mpfr mplayer_gui mtpaint mtr nasm ncurses ndiswrapper neon netpbm net-tools network_tray nicoedit normalize notecase ntfs-3g ntfsprogs ogle ogle_gui opencore-amr OpenSP openssh_client openssl orc osmo pango parted patch patchutils pciutils pcmciautils pcre perl perl_tiny perl-digest-sha1 perl-digest-sha1 perl-extutils-depends perl-extutils-pkgconfig perl-html-parser perl-html-parser perl-uri perl-xml-simple perl-xml-parser pixman pkgconfig poppler popt powerapplet_tray ppp procps psmisc python readline retrovol rman rsync rxvt-unicode sane-backends schroedinger scrollkeeper SDL SDL_image SDL_mixer SDL_ttf seamonkey1_addon_adblock seamonkey1_addon_copyplaintext seamonkey1_addon_flashblock seamonkey1_addon_fullerscreen seamonkey1_addon_user_agent_switcher seamonkey1_addon_zombiekeys sed setserial speex sqlite startup-notification strace subversion sysfsutils sysprof tar texinfo unzip util-linux util-macros vala vamps vcdimager vorbis-tools wget wireless-tools wpa_supplicant wv wv_patterns_wingding x11proto x264 xcompmgr xdelta xf86-input-synaptics xf86-video-ati-radeon_mach64_r128-june2008 xf86-video-geode xf86-video-i810 xf86-video-i810_old xf86-video-nv xf86-video-openchrome xf86-video-rdc xload xorg-input-wizardpen xorg-server xorg73_base_t2 xsane xserver_xorg_partialcut_t2 xtrans xvidcore zip zlib zzt2_fixup_hack_xorg73 "
  31. #ask which pkg-choice-list to use...
  32. if [ -d support/HISTORY-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  33. ARCHIVED_CHOICES="`find support/HISTORY-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} -maxdepth 1 -name 'DISTRO_PKGS_SPECS-*' | sed -e 's%^%ARCHIVE %' -e 's%$% off%'`"
  34. CNT=1
  35. echo -n "" > /tmp/1choosepackages-archchoices
  36. echo "$ARCHIVED_CHOICES" |
  37. while read ONECH
  38. do
  39. echo "$ONECH" | sed -e 's%ARCHIVE %Archive${CNT} %' >> /tmp/1choosepackages-archchoices
  40. CNT=`expr $CNT + 1`
  41. done
  42. ARCHIVED_CHOICES="`cat /tmp/1choosepackages-archchoices | tr '\n' ' '`"
  43. fi
  44. XD0="Xdialog --left --wrap --stdout --title \"1choosepackages: select input\" --radiolist \"Please choose the file that has the choice of packages for the Puppy build. Recommend choose '${CURRENT_CHOICE}'. Whatever is chosen below, file '${CURRENT_CHOICE}' will be updated and used by later scripts to build Puppy.\n\nNote, selecting an 'Archive*' entry here does not mean that you will be choosing older PET packages. These files are only lists of package names, and the actual PETs are chosen from the database files, so will be the most recent versions. Look at variable PACKAGELISTS_PET_ORDER in file DISTRO_PET_REPOS to see the PET search order, also mouse-over a package in the next dialog window to see what PET package is actually being chosen.\" 27 99 0 Current ${CURRENT_CHOICE} on Reference \"A fallback of recommended choices\" off ${ARCHIVED_CHOICES}"
  45. RESULTS="`eval "$XD0"`"
  46. [ $? -ne 0 ] && exit
  47. yaf-splash -placement center -bg yellow -close never -fontsize large -text "Processing, please wait..." &
  48. YPID=$!
  49. #using this one...
  50. ALLCHOICES="Current ${CURRENT_CHOICE}
  51. Reference internal
  52. `cat /tmp/1choosepackages-archchoices`"
  53. resPTN="^${RESULTS} "
  54. CHOICES_INPUT="`echo "$ALLCHOICES" | grep "$resPTN" | cut -f 2 -d ' '`"
  55. case $CHOICES_INPUT in
  56. internal)
  57. YES_PUPS="$YES_PETS_wary_512"
  58. YES_HOST_PKGS="$YES_HOST_PKGS_wary_512"
  59. ;;
  60. *)
  61. . ./${CHOICES_INPUT} #ex: file DISTRO_PKGS_SPECS-puppy-wary5, which has variable $PKGS_SPECS_TABLE
  62. #only want entries like yes|915resolution||exe,dev,doc,nls (3rd field empty)...
  63. #YES_PUPS="`echo "$PKGS_SPECS_TABLE" | grep '^yes|[0-9a-zA-Z].*||' | cut -f 2 -d '|' | tr '\n' ' '`"
  64. YES_PUPS="`echo "$PKGS_SPECS_TABLE" | grep '^yes|[0-9a-zA-Z][^|]*||' | cut -f 2 -d '|' | tr '\n' ' '`"
  65. YES_HOST_PKGS="`echo "$PKGS_SPECS_TABLE" | grep '^yes|[0-9a-zA-Z][^|]*|[0-9a-zA-Z]' | cut -f 2 -d '|' | tr '\n' ' '`"
  66. ;;
  67. esac
  68. #w469 modify compat-distro fallback list...
  69. if [ "$FALLBACKS_COMPAT_VERSIONS" != "" ];then
  70. FALLBACKS_COMPAT_VERSIONS="`echo -n "$FALLBACKS_COMPAT_VERSIONS" | grep -o "${DISTRO_COMPAT_VERSION}.*"`"
  71. #ex: 'koala jaunty intrepid' gets reduced to 'jaunty intrepid' if DISTRO_COMPAT_VERSION=jaunty
  72. fi
  73. echo "$YES_PUPS" | tr -s ' ' | sed -e 's% $%%' | tr ' ' '\n' | sed -e 's%^%|%' -e 's%$%|%' > /tmp/1choosepackages-yes-pups-ptns
  74. sync
  75. #Packages-puppy-common-official is repo of pet pkgs likely to be needed in all puppies...
  76. #YESITEMS="`grep --file=/tmp/1choosepackages-yes-pups-ptns Packages-puppy-common-official | cut -f 2,10 -d '|' | sed -e 's%"%%g' -e 's%|% "%' -e 's%$%" on%'`" #'geany
  77. #echo "$YESITEMS" > /tmp/1choosepackages-yesitems
  78. #NOITEMS="`grep -v --file=/tmp/1choosepackages-yes-pups-ptns Packages-puppy-common-official | cut -f 2,10 -d '|' | sed -e 's%"%%g' -e 's%|% "%' -e 's%$%" off%'`" #'geany
  79. #echo -n "" > /tmp/1choosepackages-noitems
  80. #echo "$NOITEMS" |
  81. #while read ONEITEM
  82. #do
  83. # NAME1="`echo -n "$ONEITEM" | cut -f 1 -d '|' | sed -e 's%_DEV%%' -e 's%_DOC%%' -e 's%_NLS%%'`"
  84. # fPTN1="^${FIELD1} "
  85. # [ "`grep "$fPTN1" /tmp/1choosepackages-yesitems`" != "" ] && continue
  86. # echo "$ONEITEM" >> /tmp/1choosepackages-noitems
  87. #done
  88. #NOITEMS="`cat /tmp/1choosepackages-noitems`"
  89. YESITEMS="`grep --file=/tmp/1choosepackages-yes-pups-ptns Packages-puppy-noarch-official Packages-puppy-common-official | cut -f 2-99 -d ':' | cut -f 2,10 -d '|' | sort --field-separator='|' --key=1,1 --unique | sed -e 's%"%%g' -e 's%|% "%' -e 's%$%" on%'`" #'geany
  90. NOITEMS="`grep -v --file=/tmp/1choosepackages-yes-pups-ptns Packages-puppy-noarch-official Packages-puppy-common-official | cut -f 2-99 -d ':' | grep -v -E '_DEV|_DOC|_NLS' | cut -f 2,10 -d '|' | sort --field-separator='|' --key=1,1 --unique | sed -e 's%"%%g' -e 's%|% "%' -e 's%$%" off%'`" #'geany
  91. ALLITEMS="`echo "$YESITEMS
  92. $NOITEMS" | sort --key=1,1 --field-separator=' ' --unique`"
  93. echo "$ALLITEMS" > /tmp/1choosepackages-allitems
  94. #if pkg is a host pkg, insert "HOSTPACKAGE"...
  95. echo -n "" > /tmp/1choosepackages-allitems-mod
  96. cat /tmp/1choosepackages-allitems |
  97. while read ONELINE
  98. do
  99. oPTN=" `echo -n "$ONELINE" | cut -f 1 -d ' '` "
  100. if [ "`echo " ${YES_HOST_PKGS} " | grep "$oPTN"`" != "" ];then
  101. ONEMODIF="`echo "$ONELINE" | sed -e 's% "% "HOSTPACKAGE %'`"
  102. echo "$ONEMODIF" >> /tmp/1choosepackages-allitems-mod
  103. else
  104. echo "$ONELINE" >> /tmp/1choosepackages-allitems-mod
  105. fi
  106. done
  107. mv -f /tmp/1choosepackages-allitems-mod /tmp/1choosepackages-allitems
  108. ALLITEMS="`cat /tmp/1choosepackages-allitems`"
  109. #add deps shown on mouse-over...
  110. echo -n "" > /tmp/1choosepackages-allitems-withhelp
  111. echo "$ALLITEMS" |
  112. while read ONEITEM
  113. do
  114. NAME1="`echo -n "$ONEITEM" | cut -f 1 -d ' '`"
  115. #in case of multiple pets with same name...
  116. n0PTN="^${NAME1} "
  117. [ "`grep "$n0PTN" /tmp/1choosepackages-allitems-withhelp`" != "" ] && continue
  118. #INLINE_PASSED1='1choosepackages'
  119. GENERICNAME="$NAME1"
  120. if [ "`echo -n "$ONEITEM" | grep 'HOSTPACKAGE'`" != "" ];then
  121. #pkg is chosen from the host repos...
  122. echo "${ONEITEM} \"This package will be provided from the ${DISTRO_BINARY_COMPAT}|${DISTRO_COMPAT_VERSION} host repos.\"" >> /tmp/1choosepackages-allitems-withhelp
  123. else
  124. ##note, PACKAGELISTS_PET_ORDER is specified in DISTRO_PET_REPOS included above...
  125. #. ./support/inline_get_pet
  126. ##...returns SPEC_PETPKG, ex: SPEC_PETPKG=pet_packages-quirky|acpid-1.0.8-20100603.pet
  127. ##...returns PKGLIST, name of repo, ex: Packages-puppy-common-official
  128. #120111 woof2 has findpkgs...
  129. support/findpkgs
  130. #...returns file status/findpkgs_FINAL_PKGS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  131. # each line is full db entry for pkg, prefixed with :generic-name:, pet/compat and repo-filename.
  132. # ex: :a52dec:|compat|Packages-puppy-wary5-official|a52dec-0.7.4-w5|a52dec|0.7.4-w5||BuildingBlock|68K||a52dec-0.7.4-w5.pet||A free ATSC A52 stream decoder|puppy|wary5||
  133. #PETPKG="`echo -n "$SPEC_PETPKG" | cut -f 2 -d '|'`"
  134. gnPTN=":${GENERICNAME}:"
  135. #***NOTE*** this can find more than one pkg... *FIX*
  136. fndPKG="`grep "$gnPTN" status/findpkgs_FINAL_PKGS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} | head -n 1`"
  137. PETPKG="`echo -n "$fndPKG" | cut -f 11 -d '|'`"
  138. PKGLIST="`echo -n "$fndPKG" | cut -f 3 -d '|'`"
  139. #n1PTN="|${PETPKG}|"
  140. #HOST_DISTRO="`grep "$n1PTN" Packages-puppy-common-official | tail -n 1 | cut -f 11 -d '|'`"
  141. #HOST_RELEASE="`grep "$n1PTN" Packages-puppy-common-official | tail -n 1 | cut -f 12 -d '|'`"
  142. #DEPS="`grep "$n1PTN" Packages-puppy-common-official | tail -n 1 | cut -f 9 -d '|'`"
  143. HOST_DISTRO="`echo -n "$fndPKG" | cut -f 14 -d '|'`"
  144. HOST_RELEASE="`echo -n "$fndPKG" | cut -f 15 -d '|'`"
  145. DEPS="`echo -n "$fndPKG" | cut -f 12 -d '|'`"
  146. HOSTCOMP="${HOST_DISTRO}|${HOST_RELEASE}"
  147. [ "$HOST_DISTRO" = "" ] && HOSTCOMP="NOARCH (no compiled excutables, or distro-independent such as static)"
  148. [ "$DEPS" = "" ] && DEPS="none-specified"
  149. echo "${ONEITEM} \"DEPENDENCIES:${DEPS} PET:${PETPKG} REPO:${PKGLIST} PACKAGE-COMPILED:${HOSTCOMP}\"" >> /tmp/1choosepackages-allitems-withhelp
  150. fi
  151. done
  152. ALLITEMSWITHHELP="`cat /tmp/1choosepackages-allitems-withhelp | tr '\n' ' '`"
  153. kill $YPID
  154. XD1="Xdialog --wrap --stdout --left --separator \"|\" --title \"1choosepackages: choose common PET packages\" --item-help --help \"The common PET packages are those that will normally be in all Puppy\n
  155. builds. You may want to disable some of these, for example\n
  156. 'ghostscript' when the package is available from the host distro\n
  157. (note, our ghostscript PET is very small). PETs that do not have\n
  158. any compiled binary executables (scripts or data files only) are\n
  159. labelled 'NOARCH'. In the case of compiled executables, the common\n
  160. repo probably has a PET that will work, but in some cases you may\n
  161. have to recompile or use a host-distro package.\n\n
  162. Note1: 'PACKAGE-COMPILED' identifies which distro and release\n
  163. version the binary executables were compiled in.\n\n
  164. Note2: Our practice has been often not to give any dependencies\n
  165. when we know that Puppy will definitely have all the required\n
  166. packages. Also, some package-creators have been lax with regard\n
  167. to specifying deps, so take the deps field as a guide only.\n\n
  168. Note3: Important: if a common PET package is unticked, but if\n
  169. PKGS_SPECS_TABLE has an entry for same package in the host repo\n
  170. (format: no|ghostscript|ghostscript|exe,dev,doc,nls)\n
  171. then the host package will be set to 'yes'. And vice-versa.\n\n
  172. Warning: some packages may be marked as NOARCH, but actually do\n
  173. have compiled binaries. The opposite may also be true. Note to\n
  174. package creators: specify fields 11&12 as |puppy|| for compiled\n
  175. binaries that will suit all builds, for true NOARCH specify |||.\" --checklist \"These are the base packages that are used in all Puppy builds.\n\n If ticked, then a PET will be used chosen from the database files specified by this variable in file DISTRO_PET_REPOS:\n PACKAGELISTS_PET_ORDER=${PACKAGELISTS_PET_ORDER}\n..mouseover packages below to see what PET will be chosen, plus other details.\n\nIf unticked, you may optionally create an entry in PKGS_SPECS_TABLE to use an equivalent package from the host repository. 'HOSTPACKAGE' marks packages that already have an alternate entry (so you would only tick those boxes if you wanted to use a PET from the 'noarch' or 'common' repos instead).\" 49 90 0 ${ALLITEMSWITHHELP}"
  176. RETVALS2="`eval "$XD1"`"
  177. [ $? -ne 0 ] && exit
  178. yaf-splash -placement center -bg yellow -close never -fontsize large -text "Processing, please wait..." &
  179. YPID=$!
  180. #echo "$RETVALS2"
  181. YESCOMMONNAMES="`echo "$RETVALS2" | tr '|' '\n'`" #generic name on each line.
  182. #echo "YESCOMMONNAMES=$YESCOMMONNAMES" #TEST
  183. xYESCOMMONNAMES="`echo "$YESCOMMONNAMES" | sed -e 's%^%|%' -e 's%$%|%'`"
  184. echo "$xYESCOMMONNAMES" > /tmp/1choosepackages-yescommonnames-enc
  185. # CURRENT_CHOICE=DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  186. #CURRENT_CHOICE file got included above, so we have PKGS_SPECS_TABLE...
  187. #reorganise PKGS_SPECS_TABLE move comments to end of next line...
  188. COMMENTLINE=""
  189. echo -n "" > /tmp/1choosepackages-pkgs-specs-table
  190. if [ "$PKGS_SPECS_TABLE" ];then
  191. echo "$PKGS_SPECS_TABLE" |
  192. while read ONELINE
  193. do
  194. [ "`echo -n "$ONELINE" | grep -E '^#|^yes|^no'`" = "" ] && continue #screen out any invalid lines.
  195. if [ "`echo -n "$ONELINE" | grep '^#'`" != "" ];then
  196. COMMENTLINE="${COMMENTLINE} ${ONELINE}"
  197. else
  198. ONELINE="`echo -n "$ONELINE" | sed -e 's%|$%%'`" #get rid of any trailing |
  199. echo "${ONELINE}|${COMMENTLINE}" >> /tmp/1choosepackages-pkgs-specs-table
  200. COMMENTLINE=""
  201. fi
  202. done
  203. PKGS_SPECS_TABLE="`cat /tmp/1choosepackages-pkgs-specs-table`"
  204. fi
  205. #set yes/no in PKGS_SPECS_TABLE...
  206. HOSTENTRIESMISSING="" ; HOSTENTRIESTURNEDON=""
  207. ALLCOMMONNAMES="`cat /tmp/1choosepackages-allitems-withhelp | cut -f 1 -d ' ' | tr '\n' ' '`"
  208. for ONECOMMON in $ALLCOMMONNAMES
  209. do
  210. ocPTN="^${ONECOMMON}$"
  211. ocPTN1="|${ONECOMMON}|[0-9a-zA-Z]"
  212. FNDENTRY1="`grep "$ocPTN1" /tmp/1choosepackages-pkgs-specs-table`"
  213. ocPTN2="|${ONECOMMON}||"
  214. FNDENTRY2="`grep "$ocPTN2" /tmp/1choosepackages-pkgs-specs-table`"
  215. if [ "`echo "$YESCOMMONNAMES" | grep "$ocPTN"`" = "" ];then
  216. #not chosen
  217. noPTN="s%^yes|${ONECOMMON}||%no|${ONECOMMON}||%"
  218. sed -i -e "$noPTN" /tmp/1choosepackages-pkgs-specs-table
  219. if [ "$FNDENTRY1" ];then
  220. CNT=1
  221. echo "$FNDENTRY1" |
  222. while read ONEENTRY
  223. do
  224. sed -i -e "/${ONEENTRY}/d" /tmp/1choosepackages-pkgs-specs-table
  225. if [ $CNT -eq 1 ];then
  226. #warn if this is being turned on...
  227. if [ "`echo "$ONEENTRY" | grep "^no|"`" != "" ];then
  228. HOSTENTRIESTURNEDON="${HOSTENTRIESTURNEDON}
  229. ${ONEENTRY}"
  230. fi
  231. echo "$ONEENTRY" | sed -e 's%^no|%yes|%' >> /tmp/1choosepackages-pkgs-specs-table #yes 1st found only.
  232. else
  233. echo "$ONEENTRY" | sed -e 's%^yes|%no|%' >> /tmp/1choosepackages-pkgs-specs-table
  234. fi
  235. sync
  236. CNT=`expr $CNT + 1`
  237. done
  238. else
  239. FNDPTNS=""
  240. #find out if an equivalent pkg name already chosen...
  241. for ONEPTN in `cat /tmp/1choosepackages_pkg_name_aliases_patterns2`
  242. do
  243. if [ "`echo "|${ONECOMMON}|" | grep "$ONEPTN"`" ];then
  244. FNDPTNS="`grep "$ONEPTN" /tmp/1choosepackages_pkg_name_aliases_patterns | tr ',' '\n'`"
  245. break
  246. fi
  247. done
  248. if [ "$FNDPTNS" ];then
  249. echo "$FNDPTNS" > /tmp/1choosepackages-fndptns
  250. [ "`grep --file=/tmp/1choosepackages-fndptns /tmp/1choosepackages-yescommonnames-enc`" = "" ] && HOSTENTRIESMISSING="$HOSTENTRIESMISSING $ONECOMMON" #i/p file has format |915resolution| each line.
  251. else
  252. HOSTENTRIESMISSING="$HOSTENTRIESMISSING $ONECOMMON"
  253. fi
  254. fi
  255. else
  256. #chosen
  257. if [ "$FNDENTRY2" ];then
  258. yesPTN="s%^no|${ONECOMMON}||%yes|${ONECOMMON}||%"
  259. sed -i -e "$yesPTN" /tmp/1choosepackages-pkgs-specs-table
  260. else
  261. echo "yes|${ONECOMMON}||exe,dev,doc,nls| #common package" >> /tmp/1choosepackages-pkgs-specs-table
  262. fi
  263. if [ "$FNDENTRY1" ];then
  264. echo "$FNDENTRY1" |
  265. while read ONEENTRY
  266. do
  267. sed -i -e "/${ONEENTRY}/d" /tmp/1choosepackages-pkgs-specs-table
  268. echo "$ONEENTRY" | sed -e 's%^yes|%no|%' >> /tmp/1choosepackages-pkgs-specs-table
  269. sync
  270. done
  271. fi
  272. fi
  273. done
  274. PKGS_SPECS_TABLE="`cat /tmp/1choosepackages-pkgs-specs-table | sort --key=2 --field-separator='|'`"
  275. echo "$PKGS_SPECS_TABLE" > /tmp/1choosepackages-pkgs-specs-table
  276. defaulttexteditor /tmp/1choosepackages-pkgs-specs-table &
  277. ZPID=$!
  278. sleep 1
  279. kill $YPID
  280. ##110609 find missing deps...
  281. ##/tmp/1choosepackages-allitems-withhelp lists all common pkgs, with deps.
  282. #for ONECOMM in $YESCOMMONNAMES #ticked common pkgs, each line ex: 915resolution
  283. #do
  284. # [ "$YESCOMMONNAMES" = "" ] && continue
  285. # yc1PTN="^${ONECOMM} "
  286. # ONEDEPS="`grep "$yc1PTN" /tmp/1choosepackages-allitems-withhelp | grep -o 'DEPENDENCIES:[^ ]*' | sed -e 's%DEPENDENCIES:%%'`"
  287. # for ONEDEP in $ONEDEPS
  288. # do
  289. # done
  290. #
  291. # ycPTN="^${ONECOMM}|"
  292. # grep "^yes|" /tmp/1choosepackages-pkgs-specs-table | grep
  293. #
  294. #done
  295. #checkbox not ticked, so common PET not used, these alternate host entries were previously off, now on...
  296. if [ "$HOSTENTRIESTURNEDON" ];then
  297. XD5="Xdialog --wrap --stdout --left --title \"1choosepackages: host pkgs turned on\" --msgbox \"These packages were not chosen in the PET common repository (checkboxes not ticked), however variable PKGS_SPECS_TABLE has alternative entries for equivalent packages from the host repos. These were previously turned 'off' and they are now 'on':
  298. ${HOSTENTRIESTURNEDON}
  299. This is for your information. If you don't want any of them to be turned on, remove those entries from PKGS_SPECS_TABLE (yes, delete them, so they won't get turned on again next time that you run this script) -- see separate window, and save changes.\" 0 90"
  300. eval "$XD5"
  301. fi
  302. echo "${HOSTENTRIESMISSING}" > /tmp/1choosepackages-common-entries-missing
  303. if [ "$HOSTENTRIESMISSING" ];then
  304. XD3="Xdialog --wrap --stdout --left --title \"1choosepackages: maybe missing common packages\" --msgbox \"These packages were not chosen in the PET common repository (checkboxes not ticked), nor are there entries in PKGS_SPECS_TABLE to use an alternate host package:
  305. ${HOSTENTRIESMISSING}
  306. Just bringing this to your attention. If you think that any of these should be in your Puppy build, either run the 1choosepackages script again and tick the checkbox, or make an entry in PKGS_SPECS_TABLE variable in file ${CURRENT_CHOICE} to use an equivalent package from the host repos.
  307. PKGS_SPECS_TABLE is currently being displayed in a separate window. You can edit that directly now, inserting entries, or it can be done later -- write down any names from above list that you will want to insert later.
  308. Note, the above list has been written to /tmp/1choosepackages-common-entries-missing\" 0 90"
  309. eval "$XD3"
  310. fi
  311. #to do, save...
  312. DATENOW="`date +%Y%m%d%H%M`"
  313. XD4="Xdialog --wrap --stdout --left --title \"1choosepackages: save\" --yesno \"The updated PKGS_SPECS_TABLE variable is displayed in a separate window. If it looks alright, click the 'Yes' button to save it to file '${CURRENT_CHOICE}'.
  314. Note, if you click 'Yes', the original file '${CURRENT_CHOICE}' will be archived as support/HISTORY-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}/${CURRENT_CHOICE}-VERSION${DISTRO_VERSION}-DATE${DATENOW}
  315. IMPORTANT: If you have made any changes to the separate window displaying PKGS_SPECS_TABLE, please save and close it now, before clicking 'Yes' here...\" 0 100"
  316. eval "$XD4"
  317. RETSTATUS=$?
  318. kill $ZPID
  319. if [ $RETSTATUS -eq 0 ];then
  320. PKGS_SPECS_TABLE="`cat /tmp/1choosepackages-pkgs-specs-table`"
  321. #archive...
  322. mkdir -p support/HISTORY-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}/
  323. cp -f ${CURRENT_CHOICE} support/HISTORY-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}/${CURRENT_CHOICE}-VERSION${DISTRO_VERSION}-DATE${DATENOW}
  324. echo "#fallbacks when looking for pet pkgs (space-separated list)...
  325. FALLBACKS_COMPAT_VERSIONS='${FALLBACKS_COMPAT_VERSIONS}'
  326. #PKGS_SPECS_TABLE table format:
  327. #will pkg be in puppy-build.
  328. # Generic name for pkg. Note: PET packages, if exist, use this name.
  329. # Comma-separated list of compatible-distro pkg(s). '-' prefix, exclude.
  330. # Must be exact name-only of pkg, else '*' on end is wildcard to search full name.
  331. # Empty field, then use PET pkg.
  332. # How the package will get split up in woof (optional redirection '>' operator).
  333. # Missing field, it goes into exe. Can also redirect >null, means dump it.
  334. #yes|abiword|iceword,iceword-plugins|exe,dev,doc,nls
  335. #example showing wildcard. finds all full pkg names with 'gcc-4.3*',
  336. #but, exclude any 'gcc-4.3-doc*' matches...
  337. #yes|gcc|gcc,gcc-4.3*,-gcc-4.3-doc*|exe,dev,doc,nls
  338. #101013 have introduced a basic mechanism to choose different pkg for old or new kernel.
  339. #both pkgs need to have 'yes' below, see example 'aufs2-util' and 'aufs2-util-old'
  340. #variable PKG_PREFER_OLDER in file PKGS_MANAGEMENT and 3builddistro will choose one of them.
  341. PKGS_SPECS_TABLE='${PKGS_SPECS_TABLE}'" > ${CURRENT_CHOICE}
  342. fi
  343. echo "...finished"
  344. ###END###