merge2out 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. #!/bin/sh
  2. #BK nov. 2011
  3. #111126 do not copy files from woof-distro to woof-out, symlink only.
  4. #111126 fix symlink to compat-distro pkg download directory.
  5. #111127 make sure host linux system has 'printcols' and 'vercmp' utilities.
  6. #111127 also make sure target build will have 'printcols' and 'vercmp'.
  7. #111203 fixes for rerun of this script.
  8. #120503 i left some EMPTYDIRMARKER files inside /dev.
  9. #120512 remove option to create symlinks in working directory.
  10. #120515 build from "gentoo" binary tarballs (refer support/gentoo).
  11. #130306 arch linux: gz now xz.
  12. #130528 change owner:group of symlink instead of what it points to.
  13. [ ! -d ./woof-arch ] && exit
  14. [ ! -d ./woof-code ] && exit
  15. [ ! -d ./woof-distro ] && exit
  16. CURDIR="`pwd`"
  17. echo
  18. echo 'This script merges woof-arch, woof-code and woof-distro, to ../woof-out_*.
  19. woof-arch: architecture-dependent (x86, arm) files, mostly binary executables.
  20. woof-code: the core of Woof. Mostly scripts.
  21. woof-distro: distro-configuration (Debian, Slackware, etc.) files.
  22. Important: the host architecture is distinct from the target architecture.
  23. The host is the machine you are running Woof on, the target is the machine
  24. in which the Puppy that you build is going to run. Typically, you will build
  25. on a x86 machine, and the target may be x86 or arm.'
  26. echo
  27. CNT=1
  28. for ONEARCH in `find woof-arch -mindepth 1 -maxdepth 1 -type d | sed -e 's%^woof-arch/%%' | sort | tr '\n' ' '`
  29. do
  30. echo "$CNT $ONEARCH"
  31. CNT=$(($CNT + 1))
  32. done
  33. echo -n 'Type number of host architecture: '
  34. read nHOSTARCH
  35. HOSTARCH="`find woof-arch -mindepth 1 -maxdepth 1 -type d | sed -e 's%^woof-arch/%%' | sort | head -n $nHOSTARCH | tail -n 1`"
  36. echo "...ok, $HOSTARCH"
  37. echo
  38. CNT=1
  39. for ONEARCH in `find woof-arch -mindepth 1 -maxdepth 1 -type d | sed -e 's%^woof-arch/%%' | sort | tr '\n' ' '`
  40. do
  41. echo "$CNT $ONEARCH"
  42. CNT=$(($CNT + 1))
  43. done
  44. echo -n 'Type number of target architecture: '
  45. read nTARGETARCH
  46. TARGETARCH="`find woof-arch -mindepth 1 -maxdepth 1 -type d | sed -e 's%^woof-arch/%%' | sort | head -n $nTARGETARCH | tail -n 1`"
  47. echo "...ok, $TARGETARCH"
  48. echo
  49. echo 'Woof builds a Puppy based on the binary packages from another distro.
  50. We sometimes refer to this as the "compat-distro".'
  51. echo
  52. CNT=1
  53. taPTN="s%^woof-distro/${TARGETARCH}/%%"
  54. for ONEDISTRO in `find woof-distro/${TARGETARCH} -mindepth 1 -maxdepth 1 -type d | sed -e "${taPTN}" | sort | tr '\n' ' '`
  55. do
  56. echo "$CNT $ONEDISTRO"
  57. CNT=$(($CNT + 1))
  58. done
  59. echo -n 'Type number of compat-distro: '
  60. read nCOMPATDISTRO
  61. COMPATDISTRO="`find woof-distro/${TARGETARCH} -mindepth 1 -maxdepth 1 -type d | sed -e "${taPTN}" | sort | head -n $nCOMPATDISTRO | tail -n 1`"
  62. echo "...ok, $COMPATDISTRO"
  63. echo
  64. echo 'The compat-distro usually has release versions, unless it is a rolling
  65. release system such as Arch Linux. Please choose which release you want to
  66. obtain the binary packages from.'
  67. CNT=1
  68. for ONECOMPAT in `find woof-distro/${TARGETARCH}/${COMPATDISTRO} -maxdepth 1 -mindepth 1 -type d | rev | cut -f 1 -d '/' | rev | sort | tr '\n' ' '`
  69. do
  70. echo "$CNT $ONECOMPAT"
  71. CNT=$(($CNT + 1))
  72. done
  73. if [ $CNT -eq 1 ];then
  74. echo
  75. echo "Sorry, there are no release directories inside woof-distro/${COMPATDISTRO}."
  76. echo "At least one is required. Quiting."
  77. exit
  78. fi
  79. echo -n 'Type number of release: '
  80. read nCOMPATVERSION
  81. COMPATVERSION="`find woof-distro/${TARGETARCH}/${COMPATDISTRO} -maxdepth 1 -mindepth 1 -type d | rev | cut -f 1 -d '/' | rev | sort | head -n $nCOMPATVERSION | tail -n 1`"
  82. echo "...ok, $COMPATVERSION"
  83. echo
  84. echo 'Choices:'
  85. echo "Host architecture: $HOSTARCH"
  86. echo "Target architecture: $TARGETARCH"
  87. echo "Compatible-distro: $COMPATDISTRO"
  88. echo "Compat-distro version: $COMPATVERSION"
  89. echo
  90. echo -n "If these are ok, press ENTER, other CTRL-C to quit: "
  91. read waitforit
  92. echo
  93. echo "Directory '../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}'
  94. will now be created, if not already, and the contents of 'woof-code' copied
  95. into it. Then, these will also be copied into it:
  96. woof-arch/${HOSTARCH}/build
  97. woof-arch/${TARGETARCH}/target
  98. woof-distro/${TARGETARCH}/${COMPATDISTRO}/${COMPATVERSION} (files all levels)"
  99. echo
  100. echo "Any existing files in '../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}' will be over-ridden."
  101. echo "(Also, if you have any of your own files in folders 'boot', 'kernel-skeleton',
  102. 'packages-templates', 'rootfs-skeleton' or 'support', they will be deleted.)"
  103. echo -n 'Press ENTER to continue: '
  104. read goforit
  105. #111203 as files/dirs could be removed in future woofs, need to wipe entire target dirs first...
  106. rm -r -f ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/boot 2> /dev/null
  107. rm -r -f ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/kernel-skeleton 2> /dev/null
  108. rm -r -f ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/packages-templates 2> /dev/null
  109. rm -r -f ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/rootfs-skeleton 2> /dev/null
  110. rm -r -f ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/support 2> /dev/null
  111. sync
  112. mkdir -p ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}
  113. echo "Copying woof-code/*..."
  114. cp -a -f --remove-destination woof-code/* ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
  115. sync
  116. echo "Copying woof-arch/${HOSTARCH}/build/*..."
  117. cp -a -f --remove-destination woof-arch/${HOSTARCH}/build/* ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
  118. sync
  119. echo "Copying woof-arch/${TARGETARCH}/target/*"
  120. cp -a -f --remove-destination woof-arch/${TARGETARCH}/target/* ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
  121. sync
  122. echo
  123. echo "Copying woof-distro/${COMPATDISTRO}/${COMPATVERSION}/*..."
  124. #copy any top-level files, going down...
  125. #120512 remove this option...
  126. ##111203 script run before, respect previous decision...
  127. #DESTTYPE=''
  128. #ONETOP="`find woof-distro -mindepth 1 -maxdepth 1 -type f | head -n 1`"
  129. #[ ! "$ONETOP" ] && ONETOP="`find woof-distro/${TARGETARCH} -mindepth 1 -maxdepth 1 -type f | head -n 1`"
  130. #[ ! "$ONETOP" ] && ONETOP="`find woof-distro/${TARGETARCH}/${COMPATDISTRO} -mindepth 1 -maxdepth 1 -type f | head -n 1`"
  131. #[ ! "$ONETOP" ] && ONETOP="`find woof-distro/${TARGETARCH}/${COMPATDISTRO}/${COMPATVERSION} -mindepth 1 -maxdepth 1 -type f | head -n 1`"
  132. #if [ "$ONETOP" ];then
  133. # ONEBASE="`basename $ONETOP`"
  134. # if [ -e ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${ONEBASE} ];then
  135. # DESTTYPE='file'
  136. # [ -h ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${ONEBASE} ] && DESTTYPE='symlink'
  137. # fi
  138. #fi
  139. #if [ "$DESTTYPE" = "" ];then
  140. # #111126 don't copy, more convenient if symlink, so only one instance of the file... 111129 offer choice...
  141. # echo
  142. # echo "Press ENTER only to copy files from woof-distro, any other char to symlink
  143. #files back to woof-distro. Latter is a convenience for administrator, for most
  144. #Woof users, please choose former."
  145. # echo -n "Recommend press ENTER only: "
  146. # read choosesymlink
  147. #else
  148. # choosesymlink=''
  149. # [ "$DESTTYPE" = "symlink" ] && choosesymlink='y'
  150. #fi
  151. DESTTYPE='file'
  152. choosesymlink=''
  153. PARENTDIR="`echo -n "$CURDIR" | rev | cut -f 1 -d '/' | rev`" #ex: woof2
  154. for ONETOP in `find woof-distro -mindepth 1 -maxdepth 1 -type f | tr '\n' ' '`
  155. do
  156. if [ "$choosesymlink" = "" ];then
  157. cp -a -f --remove-destination $ONETOP ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
  158. else
  159. ONENAME="`basename $ONETOP`"
  160. ln -snf ../${PARENTDIR}/${ONETOP} ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${ONENAME}
  161. fi
  162. done
  163. for ONETOP in `find woof-distro/${TARGETARCH} -mindepth 1 -maxdepth 1 -type f | tr '\n' ' '`
  164. do
  165. if [ "$choosesymlink" = "" ];then
  166. cp -f -a --remove-destination $ONETOP ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
  167. else
  168. ONENAME="`basename $ONETOP`"
  169. ln -snf ../${PARENTDIR}/${ONETOP} ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${ONENAME}
  170. fi
  171. done
  172. for ONETOP in `find woof-distro/${TARGETARCH}/${COMPATDISTRO} -mindepth 1 -maxdepth 1 -type f | tr '\n' ' '`
  173. do
  174. if [ "$choosesymlink" = "" ];then
  175. cp -f -a --remove-destination $ONETOP ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
  176. else
  177. ONENAME="`basename $ONETOP`"
  178. ln -snf ../${PARENTDIR}/${ONETOP} ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${ONENAME}
  179. fi
  180. done
  181. #lowest level...
  182. #cp -a -f --remove-destination woof-distro/${TARGETARCH}/${COMPATDISTRO}/${COMPATVERSION}/* ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
  183. for ONETOP in `find woof-distro/${TARGETARCH}/${COMPATDISTRO}/${COMPATVERSION} -mindepth 1 -maxdepth 1 -type f | tr '\n' ' '`
  184. do
  185. if [ "$choosesymlink" = "" ];then
  186. cp -f -a --remove-destination $ONETOP ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
  187. else
  188. ONENAME="`basename $ONETOP`"
  189. ln -snf ../${PARENTDIR}/${ONETOP} ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${ONENAME}
  190. fi
  191. done
  192. sync
  193. echo "WOOF_HOSTARCH='$HOSTARCH'
  194. WOOF_TARGETARCH='${TARGETARCH}'
  195. WOOF_COMPATDISTRO='${COMPATDISTRO}'
  196. WOOF_COMPATVERSION='${COMPATVERSION}'" > ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/WOOFMERGEVARS
  197. echo
  198. echo "Now for some housekeeping..."
  199. if [ -f ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/boot/initrd-tree0/bin/bb-create-symlinks ];then
  200. echo
  201. echo "Symlinks being created inside here:"
  202. echo "../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/boot/initrd-tree0/bin"
  203. cd ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/boot/initrd-tree0/bin
  204. for ONESYMLINK in `find . -type l | cut -f 2 -d '/' | tr '\n' ' '`
  205. do
  206. rm -f ${ONESYMLINK}
  207. done
  208. ./bb-create-symlinks
  209. cd $CURDIR #cd ../../../../
  210. fi
  211. #work around limitations of a version control system...
  212. echo
  213. echo "Some things are modified inside 'woof-code' to cater for most Version
  214. Control Systems. Typically, a VCS cannot handle most of these:
  215. 1. Empty directories
  216. 2. Special file/directory permissions/ownership
  217. 3. Device nodes
  218. 4. Symlinks
  219. 5. Special characters (such as [, [[) in file/dir names
  220. 6. Binary files
  221. BK's Bones VCS can handle all six. Fossil VCS can do no.4 & no.6 only (in fact,
  222. most VCSs such as SVN, GIT and Mercurial, can handle no.4 & no.6). Woof has
  223. lots of symlinks and binary files, and you must use a VCS that supports them.
  224. No.5 is solved by avoiding usage of such special characters, except we have
  225. workarounds for case of files named '[' and '[['."
  226. echo
  227. echo "Directory 'woof-code' has workarounds for no.1-3 (& partial 5):
  228. 1. An empty file named 'EMPTYDIRMARKER' inside all empty directories.
  229. 2. A file named VCSMETADATA has permissions/ownerships of special files/dirs.
  230. 3. 'dev' directories are converted to '*DEVDIR.tar.gz' tarball files.
  231. 5. Files named '[' and '[[' renamed 'LEFTSQBRACKETCHAR' 'DBLLEFTSQBRACKETCHAR'."
  232. echo
  233. echo "These workarounds will now be undone in '../woof-out_*'..."
  234. echo -n "Press ENTER to continue: "
  235. read goforit
  236. fossil_fixup_func() { #workarounds for VCS...
  237. #param passed in is directory to fix.
  238. #5: '[' and '[[' files renamed...
  239. for FOSSILFIXFILE in `find ${1} -name LEFTSQBRACKETCHAR | tr '\n' ' '`
  240. do
  241. DIRFFF="`dirname "$FOSSILFIXFILE"`"
  242. mv -f $FOSSILFIXFILE $DIRFFF/[
  243. done
  244. for FOSSILFIXFILE in `find ${1} -name DBLLEFTSQBRACKETCHAR | tr '\n' ' '`
  245. do
  246. DIRFFF="`dirname "$FOSSILFIXFILE"`"
  247. mv -f $FOSSILFIXFILE $DIRFFF/[[
  248. done
  249. #1: empty dirs have file 'EMPTYDIRMARKER' in them...
  250. for FOSSILFIXFILE in `find ${1} -type f -name EMPTYDIRMARKER | tr '\n' ' '`
  251. do
  252. DIRFFF="`dirname "$FOSSILFIXFILE"`"
  253. rm -f $DIRFFF/EMPTYDIRMARKER
  254. done
  255. #3: 'dev' dir made into a tarball and stored in 'woof-arch'...
  256. for DEVFILE in `find ${1} -type f -name DEVDIRMARKER | tr '\n' ' '`
  257. do
  258. xDEVFILE="${CURDIR}/woof-arch/`cat $DEVFILE`"
  259. DIRFFF="`dirname "$DEVFILE"`"
  260. cp -f $xDEVFILE ${DIRFFF}/DEVDIR.tar.gz
  261. FCURRDIR="`pwd`"
  262. cd $DIRFFF
  263. tar -zxf DEVDIR.tar.gz
  264. rm -f DEVDIR.tar.gz
  265. rm -f DEVDIRMARKER
  266. #120503 i left some EMPTYDIRMARKER inside /dev...
  267. for FOSSILFIXFILE in `find dev -type f -name EMPTYDIRMARKER | tr '\n' ' '`
  268. do
  269. DIRFFF="`dirname "$FOSSILFIXFILE"`"
  270. rm -f $DIRFFF/EMPTYDIRMARKER
  271. done
  272. cd $FCURRDIR
  273. done
  274. }
  275. echo
  276. cd ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}
  277. echo "Fixing ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/rootfs-skeleton..."
  278. fossil_fixup_func rootfs-skeleton
  279. echo "Fixing ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/boot/initrd-tree0..."
  280. fossil_fixup_func boot/initrd-tree0
  281. echo "Fixing ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/packages-templates..."
  282. fossil_fixup_func packages-templates
  283. #2: VCSMETADATA permissions/ownership...
  284. if [ -s VCSMETADATA ];then
  285. echo "Fixing file/dir permissions/ownership..."
  286. for ONESPEC in `cat VCSMETADATA | tr '\n' ' '`
  287. do
  288. ONEFILE="`echo -n "$ONESPEC" | cut -f 1 -d ':'`"
  289. [ ! -e $ONEFILE ] && continue
  290. ONEPERM="`echo -n "$ONESPEC" | cut -f 2 -d ':'`"
  291. ONEOWNER="`echo -n "$ONESPEC" | cut -f 3 -d ':'`"
  292. ONEGROUP="`echo -n "$ONESPEC" | cut -f 4 -d ':'`"
  293. echo -n '.' #echo " $ONEFILE $ONEPERM $ONEOWNER $ONEGROUP"
  294. chmod $ONEPERM $ONEFILE
  295. #130528 change owner:group of symlink instead of what it points to...
  296. [ "$ONEOWNER" != "UNKNOWN" ] && chown -h $ONEOWNER $ONEFILE
  297. [ "$ONEOWNER" = "UNKNOWN" ] && chown -h root $ONEFILE
  298. [ "$ONEGROUP" != "UNKNOWN" ] && chgrp -h $ONEGROUP $ONEFILE
  299. [ "$ONEGROUP" = "UNKNOWN" ] && chgrp -h root $ONEFILE
  300. done
  301. echo
  302. fi
  303. cd $CURDIR
  304. sync
  305. #common dir to download pet pkgs to...
  306. mkdir -p ../local-repositories/${TARGETARCH}/packages-pet
  307. [ ! -e ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/packages-pet ] && ln -s ../local-repositories/${TARGETARCH}/packages-pet ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/packages-pet #111203 check exist.
  308. #more links to common download...
  309. if [ -f ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS ];then
  310. . ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS
  311. #111126 code from 2createpackages...
  312. BINARIES='deb' #get them from packages-deb.
  313. [ "$DISTRO_BINARY_COMPAT" = "t2" ] && BINARIES="bz2" #get them from packages-bz2-${DISTRO_COMPAT_VERSION}.
  314. [ "$DISTRO_BINARY_COMPAT" = "slackware" ] && BINARIES="tgz_txz" #download to packages-tgz_txz-${DISTRO_COMPAT_VERSION}.
  315. [ "$DISTRO_BINARY_COMPAT" = "debian" ] && BINARIES="deb" #download to packages-deb-${DISTRO_COMPAT_VERSION}.
  316. [ "$DISTRO_BINARY_COMPAT" = "arch" ] && BINARIES="tar_xz" #download to packages-tar_xz-${DISTRO_COMPAT_VERSION}. 130306
  317. [ "$DISTRO_BINARY_COMPAT" = "puppy" ] && BINARIES="pet" #built entirely from pet pkgs.
  318. [ "$DISTRO_BINARY_COMPAT" = "scientific" ] && BINARIES="rpm" #Iguleder: download to packages-rpm-${DISTRO_COMPAT_VERSION}.
  319. [ "$DISTRO_BINARY_COMPAT" = "mageia" ] && BINARIES="rpm"
  320. [ "$DISTRO_BINARY_COMPAT" = "gentoo" ] && BINARIES="gentoo" #120515 download to packages-gentoo-gap6
  321. [ "$DISTRO_BINARY_COMPAT" = "raspbian" ] && BINARIES="deb_raspbian" #download to packages-deb_raspbian-${DISTRO_COMPAT_VERSION}.
  322. BINARIES="${BINARIES}-${DISTRO_COMPAT_VERSION}"
  323. mkdir -p ../local-repositories/${TARGETARCH}/packages-${BINARIES}
  324. [ ! -e ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/packages-${BINARIES} ] && ln -s ../local-repositories/${TARGETARCH}/packages-${BINARIES} ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/packages-${BINARIES} #111203 check exist.
  325. fi
  326. #record target architecture in DISTRO_SPECS (will end up in /etc/ in Puppy build)...
  327. if [ -f ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS ];then
  328. if [ "`grep '^DISTRO_TARGETARCH' ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS`" = "" ];then
  329. echo "DISTRO_TARGETARCH='${TARGETARCH}'" >> ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS
  330. fi
  331. fi
  332. #until i upgrade the woof scripts... (i was planning to rename Packages-puppy-* to Packages-pet-*, aborted)
  333. for ONEPP in `find ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION} -mindepth 1 -maxdepth 1 -name 'Packages-pet-*' | tr '\n' ' '`
  334. do
  335. BASEPP="`basename $ONEPP`"
  336. NEWBASE="`echo -n $BASEPP | sed -e 's%Packages-pet-%Packages-puppy-%'`"
  337. ln -s $BASEPP ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${NEWBASE}
  338. done
  339. #111127 make sure host puppy has these...
  340. [ ! -f /usr/sbin/printcols ] && cp -af woof-arch/${HOSTARCH}/build/support/printcols /usr/sbin/ #column manipulator.
  341. [ ! -f /bin/vercmp ] && cp -af woof-arch/${HOSTARCH}/target/boot/initrd-tree0/bin/vercmp /bin/ #dotted-version compare utility, see boot/vercmp.c
  342. #111127 make sure target has these...
  343. cp -af woof-arch/${TARGETARCH}/build/support/printcols ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${NEWBASE}/rootfs-skeleton/usr/sbin/
  344. cp -af woof-arch/${TARGETARCH}/target/boot/initrd-tree0/bin/vercmp ../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/${NEWBASE}/rootfs-skeleton/bin/
  345. echo
  346. echo "Directory '../woof-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}'
  347. is now normal, that is, the workarounds have been removed. Note,
  348. ../local-repositories has been created (if not already), to be used as a common
  349. binary package download place. 'packages-pet' and 'packages-${BINARIES}'
  350. have been created that link into it, where pkgs will be downloaded to."
  351. ###END###