0pre 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. #!/bin/sh
  2. #(c) Copyright 2009 Barry Kauler.
  3. #this script is only for T2 developers, not for Woof.
  4. #091106 updated.
  5. #120811 db category field now supports optional subcategory: |category[:subcategory]|
  6. #121102 file DISTRO_SPECS has new variable DISTRO_DB_SUBNAME. ex: for 14.0-based slacko, DISTRO_DB_SUBNAME=slacko14
  7. #121223 keep previous PKGS_HOMEPAGES file.
  8. #121223 reduce deps lists to only existing t2 binary pkgs.
  9. export LANG=C #faster.
  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. . ./DISTRO_COMPAT_REPOS-t2-${DISTRO_COMPAT_VERSION} #has PKG_DOCS_DISTRO_COMPAT
  13. . ./DISTRO_PKGS_SPECS-t2-${DISTRO_COMPAT_VERSION}
  14. FIND_CAT="./support/find_cat"
  15. ONE_PKGLISTS_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | head -n 1`" #see file DISTRO_PKGS_SPECS-t2
  16. #...ex: Packages-t2-${DISTRO_COMPAT_VERSION}-official, which is Packages-t2-puppy5-official
  17. ONE_PKGREPO_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 2 -d '|' | head -n 1`" #see file DISTRO_PKGS_SPECS-t2
  18. #db format:
  19. #pkgname|nameonly|version|pkgrelease|category[;subcategory]|size|path|fullfilename|dependencies|description|
  20. #ex: abiword-1.2.4|abiword|1.2.4|5|Document|999K|slackware/ab|abiword-1.2.4-5-i486.tgz|+aiksausus,+gtk2|a nice wordprocessor|
  21. #optionally on the end: compileddistro|compiledrelease|repo| (fields 11,12,13)
  22. #ex: slackware|12.2|official|
  23. #this is not normally needed, as the name of the file holding the database info, for ex
  24. #'Packages-slackware-12.2-official' identifies this extra information.
  25. echo "This script is for a developer who has compiled with T2."
  26. echo "The T2 build system is local, with compiled binary packages."
  27. echo "This script will read from T2 and create a Puppy standard"
  28. echo "package database. Normally this is then uploaded to the Internet,"
  29. echo "to a location specified by the PKG_DOCS_DISTRO_COMPAT variable"
  30. echo "in file DISTRO_COMPAT_REPOS-t2-${DISTRO_COMPAT_VERSION}."
  31. echo
  32. echo "Please enter the full path to the T2 build system"
  33. echo -n "(ex: /mnt/sdb3/t2-trunk): "
  34. read T2PATH
  35. if [ "$T2PATH" = "" ];then
  36. [ -f /tmp/0pre-t2path ] && T2PATH="`cat /tmp/0pre-t2path`"
  37. fi
  38. echo -n $T2PATH > /tmp/0pre-t2path
  39. [ ! -d $T2PATH ] && exit
  40. [ ! -d $T2PATH/build ] && exit
  41. #get the project directory in the 'build' subdirectory...
  42. echo
  43. echo -n "Enter the name of the directory inside 'build' subdirectory: "
  44. read T2PROFILE
  45. if [ "$T2PROFILE" = "" ];then
  46. [ -f /tmp/0pre-t2profile ] && T2PROFILE="`cat /tmp/0pre-t2profile`"
  47. fi
  48. echo -n $T2PROFILE > /tmp/0pre-t2profile
  49. [ ! -d $T2PATH/build/$T2PROFILE ] && exit
  50. #121223 get the names of all the pkgs, use below to reduce deps lists...
  51. ALLPKGS="$(find ${T2PATH}/build/${T2PROFILE}/var/adm/descs -mindepth 1 -maxdepth 1 -type f | rev | cut -f 1 -d '/' | rev | grep -v -E '^00-dirtree|^linux')"
  52. echo "$ALLPKGS" > /tmp/woof-0pre-allpkgs
  53. #what we want is in $T2PATH/build/$T2PROFILE/var/adm
  54. DB_pkgrelease=""
  55. echo -n "" > $ONE_PKGLISTS_COMPAT
  56. T2DESCS="`find $T2PATH/build/$T2PROFILE/var/adm/descs -maxdepth 1 -type f`"
  57. for ONEDESC in $T2DESCS
  58. do
  59. DB_nameonly="`basename $ONEDESC`"
  60. [ "$DB_nameonly" = "00-dirtree" ] && continue
  61. [ "$DB_nameonly" = "linux" ] && continue #121223
  62. echo -n "$DB_nameonly "
  63. DESC="`cat $ONEDESC | tr '\t' ' ' | tr -s ' '`"
  64. DB_version="`echo "$DESC" | grep '^\[V\]' | head -n 1 | cut -f 2 -d ' '`"
  65. DB_pkgname="${DB_nameonly}-${DB_version}"
  66. DB_description="`echo "$DESC" | grep '^\[I\]' | head -n 1 | cut -f 2-19 -d ' ' | sed -e 's/[^0-9a-zA-Z.+_= ]//g'`"
  67. DB_path="${DISTRO_COMPAT_VERSION}" #puppy5
  68. DB_fullfilename="${DB_pkgname}.tar.bz2"
  69. DB_size=""
  70. if [ -f $T2PATH/build/$T2PROFILE/var/adm/cache/$DB_nameonly ];then
  71. CACHE="`cat $T2PATH/build/$T2PROFILE/var/adm/cache/$DB_nameonly | tr '\t' ' ' | tr -s ' '`"
  72. SIZEM="`echo "$CACHE" | grep '^\[SIZE\]' | head -n 1 | cut -f 2 -d ' '`"
  73. SIZEK=`dc $SIZEM 1024 mul p | cut -f 1 -d '.'`
  74. DB_size="$SIZEK"'K'
  75. fi
  76. #121223...
  77. DEPSALL="`cat $T2PATH/build/$T2PROFILE/var/adm/dependencies/$DB_nameonly | grep "^${DB_nameonly}:" | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' '`"
  78. echo "$DEPSALL" > /tmp/woof-0pre-depsall
  79. DEPS="$(grep -x -f /tmp/woof-0pre-allpkgs /tmp/woof-0pre-depsall)"
  80. DB_dependencies="`echo "$DEPS" | tr '\n' ' ' | tr -s ' ' | sed -e 's% $%%' -e 's% %,+%g' -e 's%^%+%'`"
  81. xDB_description="$DB_description"
  82. [ "$DB_description" = "" ] && xDB_description="nothing"
  83. DB_category="`${FIND_CAT} $DB_nameonly "$xDB_description"`" #120812 see updated find_cat
  84. echo "$DB_pkgname|$DB_nameonly|$DB_version|$DB_pkgrelease|$DB_category|$DB_size|$DB_path|$DB_fullfilename|$DB_dependencies|$DB_description|$DISTRO_BINARY_COMPAT|$DISTRO_COMPAT_VERSION||" >> $ONE_PKGLISTS_COMPAT
  85. done
  86. echo
  87. #sort...
  88. sort --key=1 --field-separator='|' $ONE_PKGLISTS_COMPAT > /tmp/0pre-$ONE_PKGLISTS_COMPAT
  89. mv -f /tmp/0pre-$ONE_PKGLISTS_COMPAT $ONE_PKGLISTS_COMPAT
  90. ##################
  91. #now create a db of pkgs homepages, file PKGS_HOMEPAGES.
  92. #note, file also used in /usr/sbin/indexgen.sh and /usr/local/petget/fetchinfo.sh
  93. HOMEPAGEDB='abiword http://www.abisource.com/
  94. alsa http://www.alsa-project.org/main/index.php/Main_Page
  95. asunder http://littlesvr.ca/asunder/
  96. axel http://wilmer.gaast.net/main.php/axel.html
  97. ayttm http://ayttm.sourceforge.net/
  98. bluefish http://bluefish.openoffice.nl/
  99. chmsee http://chmsee.gro.clinux.org/
  100. chtheme http://plasmasturm.org/code//gtk-chtheme/
  101. cups http://www.cups.org/
  102. dkop http://kornelix.squarespace.com/dkop/
  103. e3 http://www.sax.de/~adlibit
  104. fotox http://kornelix.squarespace.com/fotox/
  105. fotoxx http://kornelix.squarespace.com/fotoxx/
  106. hardinfo http://hardinfo.berlios.de/HomePage
  107. gcolor2 http://gcolor2.sourceforge.net/
  108. gcurl http://www.gnomefiles.org/app.php/gCurl
  109. gexec http://www.cs.berkeley.edu/~bnc/gexec/
  110. gftp http://www.gftp.org/
  111. glipper http://glipper.sourceforge.net/
  112. gnomeppp http://www.gnomefiles.org/app.php?soft_id=41
  113. gnome-ppp http://www.gnomefiles.org/app.php?soft_id=41
  114. gnumeric http://www.gnome.org/projects/gnumeric/
  115. gparted http://gparted.sourceforge.net/
  116. grub http://www.gnu.org/software/grub/
  117. gtkam http://sourceforge.net/projects/gphoto
  118. hardinfo http://hardinfo.berlios.de/
  119. isomaster http://littlesvr.ca/isomaster/
  120. leafpad http://tarot.freeshell.org/leafpad/
  121. mhwaveedit https://gna.org/projects/mhwaveedit/
  122. mtr http://www.BitWizard.nl/mtr
  123. notecase http://notecase.sourceforge.net/
  124. picpuz http://kornelix.squarespace.com/picpuz/
  125. python http://www.python.org/
  126. seamonkey http://www.seamonkey-project.org/
  127. sylpheed http://sylpheed.good-day.net/
  128. sylpheed_portable http://bkhome.org/blog/?viewDetailed=02735
  129. sysprof http://www.daimi.au.dk/~sandmann/sysprof/
  130. tea http://tea-editor.sourceforge.net/
  131. valaide http://www.valaide.org/
  132. valide http://www.valaide.org/
  133. xarchive http://xarchive.sourceforge.net/
  134. xsane http://www.xsane.org/
  135. xsoldier http://www.interq.or.jp/libra/oohara/xsoldier/
  136. zmixer http://zwin.org/projects/zmixer/'
  137. #echo "$HOMEPAGEDB" > PKGS_HOMEPAGES #something to start with. 121223 removed.
  138. echo
  139. echo "$ONE_PKGLISTS_COMPAT has been created."
  140. echo "This needs to be uploaded to: "
  141. echo " $ONE_PKGREPO_COMPAT"
  142. echo "It will also be used locally by the Woof build scripts."
  143. echo "If you run '0setup', it will see local $ONE_PKGLISTS_COMPAT"
  144. echo "and will not download it."
  145. echo "Good to run '0setup' though as it checks validity of some things."
  146. echo
  147. echo -n "Press ENTER to continue: "
  148. read yesgoon
  149. echo
  150. echo "Now building file PKGS_HOMEPAGES ..."
  151. #w480 get full db, will filter later...
  152. ALLDESCS="`find $T2PATH/package -type f -name \*.desc`"
  153. ##no, narrow it down to only those actually compiled...
  154. #ALLDESCS="$T2DESCS"
  155. for ONEDESC in $ALLDESCS
  156. do
  157. NAMEONLY="`basename $ONEDESC .desc`"
  158. echo -n "$NAMEONLY "
  159. HOMEPAGE="`cat $ONEDESC | grep '^\[U\]' | head -n 1 | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' '`"
  160. [ "$HOMEPAGE" != "" ] && echo "$NAMEONLY $HOMEPAGE" >> PKGS_HOMEPAGES
  161. done
  162. echo
  163. #sort... 121223 fix key...
  164. sort --unique --key=1,1 --field-separator=' ' PKGS_HOMEPAGES > /tmp/0pre-PKGS_HOMEPAGES
  165. mv -f /tmp/0pre-PKGS_HOMEPAGES PKGS_HOMEPAGES
  166. echo
  167. echo "The raw binary packages have to be copied from T2 into 'packages-bz2-${DISTRO_COMPAT_VERSION}'."
  168. echo -n "Press ENTER to do this: "
  169. read yesdoit
  170. if [ "$yesdoit" = "" ];then
  171. mkdir -p packages-bz2-${DISTRO_COMPAT_VERSION}
  172. cp -a -f $T2PATH/build/$T2PROFILE/TOOLCHAIN/pkgs/* packages-bz2-${DISTRO_COMPAT_VERSION}/
  173. sync
  174. echo "...done"
  175. fi
  176. rm -f packages-bz2-${DISTRO_COMPAT_VERSION}/00-dirtree*.bz2 #121223
  177. rm -f packages-bz2-${DISTRO_COMPAT_VERSION}/linux-[23]*.bz2 #121223
  178. ###END###