diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2002-02-11 02:50:02 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2002-02-11 02:50:02 +0000 |
commit | b9b339d7250fa8c7f2d22a95d1a72a57ae2750aa (patch) | |
tree | 2f5f2a68285f2b8477d508634a977e5c0887d854 | |
parent | 51d99dad1ebe2b493bb9cb2031f77c943b9df63b (diff) | |
download | ports-b9b339d7250fa8c7f2d22a95d1a72a57ae2750aa.tar.gz ports-b9b339d7250fa8c7f2d22a95d1a72a57ae2750aa.zip |
Notes
-rwxr-xr-x | Tools/portbuild/scripts/dopackages | 114 |
1 files changed, 66 insertions, 48 deletions
diff --git a/Tools/portbuild/scripts/dopackages b/Tools/portbuild/scripts/dopackages index 6118bdfd1eef..06ef14811aca 100755 --- a/Tools/portbuild/scripts/dopackages +++ b/Tools/portbuild/scripts/dopackages @@ -9,7 +9,7 @@ pb=/var/portbuild dummyports="x11/XFree86" # packages that take very long to build -- try to start building these first -quickports="lang/ghc games/civ2demo games/rt2-demo x11/XFree86-4 editors/openoffice" +quickports="lang/ghc games/civ2demo games/rt2-demo x11/XFree86-4 editors/openoffice games/hlserver-cs misc/heyu x11/gnome x11/kde2" status=${pb}/status @@ -19,7 +19,7 @@ errorexit () { } usage () { - echo "usage: [-nobuild] [-noindex] [-noduds] [-nocvsup] [-nocvs] [-norestr] [-noplistcheck] [-nodummy] [-ftp] branch date" + echo "usage: [-nobuild] [-noindex] [-noduds] [-nocvsup] [-nocvs] [-noportscvs] [-norestr] [-noplistcheck] [-nodummy] [-ftp] branch date" errorexit 1 } @@ -30,7 +30,7 @@ makeindex () { branch=$3 user=$4 - cd ${pb}/usr/ports + cd ${pb}/${branch}/ports echo "================================================" echo "generating index" echo "================================================" @@ -42,11 +42,12 @@ makeindex () { cp -p INDEX INDEX-${branch} } -# usage: checkindex pb +# usage: checkindex pb branch checkindex () { pb=$1 + branch=$2 - cd ${pb}/usr/ports + cd ${pb}/${branch}/ports if grep -q non-existent INDEX; then echo "errors in INDEX:" grep -n non-existent INDEX @@ -67,7 +68,7 @@ makeduds () { scripts=$2 branch=$3 - cd ${pb}/usr/ports + cd ${pb}/${branch}/ports echo "================================================" echo "generating duds" echo "================================================" @@ -105,7 +106,7 @@ restrictedlist () { scripts=$2 branch=$3 - cd ${pb}/usr/ports + cd ${pb}/${branch}/ports echo "================================================" echo "creating restricted list" echo "================================================" @@ -124,7 +125,7 @@ cdromlist () { scripts=$2 branch=$3 - cd ${pb}/usr/ports + cd ${pb}/${branch}/ports echo "================================================" echo "creating cdrom list" echo "================================================" @@ -142,10 +143,10 @@ archiveports () { pb=$1 branch=$2 - echo "started archive of /usr/ports at $(date)" - cd ${pb}/usr + echo "started archive of /${branch}/ports at $(date)" + cd ${pb}/${branch} tar --exclude CVS -czf ${pb}/${branch}/tarballs/ports.tar.gz ports - echo "ended archive of /usr/ports at $(date)" + echo "ended archive of /${branch}/ports at $(date)" } # usage: generatemd5 pb branch @@ -162,7 +163,6 @@ generatemd5 () { scripts=${pb}/scripts umask 002 -export PORTSDIR=${pb}/usr/ports me=$(hostname -s) @@ -184,6 +184,7 @@ noindex=0 noduds=0 nocvsup=0 nocvs=0 +noportscvs=0 norestr=0 noplistcheck=0 nodummy=0 @@ -207,6 +208,9 @@ while [ $# -gt 2 ]; do x-nocvs) nocvs=1 ;; + x-noportscvs) + noportscvs=1 + ;; x-norestr) norestr=1 ;; @@ -229,7 +233,7 @@ done # mandatory arguments branch=$1 date=$2 -if [ "x$branch" != x3 -a "x$branch" != x4 -a "x$branch" != x5 ]; then +if [ "x$branch" != x4 -a "x$branch" != x4-exp -a "x$branch" != x5 ]; then usage fi @@ -246,16 +250,20 @@ if [ "$nodummy" = 1 ]; then export XFREE86_VERSION=4 fi -cd ${pb}/usr/ports +export PORTSDIR=${pb}/${branch}/ports + +cd ${pb}/${branch}/ports if [ "$nocvsup" = 0 ]; then # echo "================================================" # echo "running cvsup" # echo "================================================" # su ${user} -c 'cvsup -g -L 0 /etc/supfile.cvsup' - echo "================================================" - echo "running cvs update on /usr/ports" - echo "================================================" - su ${user} -c 'cvs -qR update -d -P' + if [ "$noportscvs" = 0 ]; then + echo "================================================" + echo "running cvs update on /${branch}/ports" + echo "================================================" + su ${user} -c 'cvs -qR update -d -P' + fi date > ${pb}/cvsdone echo "================================================" echo "running make checksubdirs" @@ -276,6 +284,8 @@ if [ "$nocvs" = 0 ]; then su ${user} -c 'cvs -qR update -d -P' fi +export SRCPREFIX=${pb}/${branch}/src + # this one not in background to check return status if [ "$noduds" = 0 ]; then @@ -302,14 +312,14 @@ cdromlist ${pb} ${scripts} ${branch} & wait -checkindex ${pb} +checkindex ${pb} ${branch} echo "all preparation ended at $(date)" -cd ${pb}/usr/ports -make parallel branch=${branch} > ../../${branch}/Makefile +cd ${pb}/${branch}/ports +make parallel branch=${branch} > ${pb}/${branch}/Makefile -cd ${pb}/usr/ports +cd ${pb}/${branch}/ports if [ "$nodummy" = 0 ]; then dummypkgs="" @@ -326,10 +336,10 @@ fi for i in ${quickports}; do if [ -d $i ]; then quickpkg="$(cd $i; make package-name).tgz" - echo "all: dummy1-$quickpkg" >> ../../${branch}/Makefile - echo "dummy1-$quickpkg: dummy2-$quickpkg" >> ../../${branch}/Makefile - echo "dummy2-$quickpkg: dummy3-$quickpkg" >> ../../${branch}/Makefile - echo "dummy3-$quickpkg: $quickpkg" >> ../../${branch}/Makefile + echo "all: dummy1-$quickpkg" >> ${pb}/${branch}/Makefile + echo "dummy1-$quickpkg: dummy2-$quickpkg" >> ${pb}/${branch}/Makefile + echo "dummy2-$quickpkg: dummy3-$quickpkg" >> ${pb}/${branch}/Makefile + echo "dummy3-$quickpkg: $quickpkg" >> ${pb}/${branch}/Makefile else echo "quick port directory \"$i\" does not exist -- skipping" fi @@ -339,12 +349,15 @@ cd ${pb} if [ "$nobuild" = 0 ]; then ### rm -rf bak/distfiles ### mv -f distfiles bak - mkdir -p distfiles - chown -R ${user} distfiles + mkdir -p ${branch}/distfiles + chown -R ${user} ${branch}/distfiles cd ${pb}/${branch}/bak rm -rf errors logs packages old-errors cd ${pb}/${branch} - mv -f errors logs packages old-errors make.* bak + # need to preserve symlinks for packages but not for errorlogs + mv -f packages make.* tarballs/ports.tar.gz bak + cp -rp errors logs old-errors bak + rm -rf errors logs old-errors ###delete old packages -- use when diskspace is scarce # if cd bak/packages/All; then # for i in *.tgz; do @@ -364,15 +377,15 @@ if [ "$nobuild" = 0 ]; then mkdir -p ${pb}/archive/errorlogs/a.${branch}.${date} ln -sf ${pb}/archive/errorlogs/a.${branch}.${date} ${pb}/${branch}/logs ln -sf a.${branch}.${date} ${pb}/archive/errorlogs/a.${branch}.${shortdate} - cp -p ${pb}/cvsdone ${pb}/archive/errorlogs/e.${branch}.${date}/cvsdone - cp -p ${pb}/cvsdone ${pb}/archive/errorlogs/a.${branch}.${date}/cvsdone - cp -p ${pb}/usr/ports/INDEX-${branch} ${pb}/archive/errorlogs/e.${branch}.${date}/INDEX - cp -p ${pb}/usr/ports/INDEX-${branch} ${pb}/archive/errorlogs/a.${branch}.${date}/INDEX chown -RL ${user} errors logs packages echo "error logs in ${pb}/archive/errorlogs/e.${branch}.${date}" + cp -p ${pb}/cvsdone ${pb}/archive/errorlogs/e.${branch}.${date}/cvsdone + cp -p ${pb}/cvsdone ${pb}/archive/errorlogs/a.${branch}.${date}/cvsdone + cp -p ${pb}/${branch}/ports/INDEX-${branch} ${pb}/archive/errorlogs/e.${branch}.${date}/INDEX + cp -p ${pb}/${branch}/ports/INDEX-${branch} ${pb}/archive/errorlogs/a.${branch}.${date}/INDEX if [ "$nodummy" = 0 ]; then for dir in ${dummyports}; do - cp -p tarballs/$(cd ${pb}/usr/ports/$dir; make package-name).tgz packages/All + cp -p tarballs/$(cd ${pb}/${branch}/ports/$dir; make package-name).tgz packages/All done fi @@ -392,7 +405,7 @@ if [ "$nobuild" = 0 ]; then echo "phase 1 took $(date -u -j -r $(($phase1end - $phase1start)) | awk '{print $4}')" echo $(echo $(ls -1 ${pb}/${branch}/packages/All | wc -l) - 2 | bc) "packages built" echo $(echo $(du -sk ${pb}/${branch}/packages | awk '{print $1}') / 1024 | bc) "MB of packages" - echo $(echo $(du -sk ${pb}/distfiles | awk '{print $1}') / 1024 | bc) "MB of distfiles" + echo $(echo $(du -sk ${pb}/${branch}/distfiles | awk '{print $1}') / 1024 | bc) "MB of distfiles" cd ${pb}/${branch} if grep -qE '(ptimeout|pnohang): killing' make.0; then echo "The following port(s) timed out:" @@ -431,21 +444,21 @@ if [ "$nobuild" = 0 ]; then if [ "$nodummy" = 0 ]; then rm ${dummypkgs} fi - ${pb}/scripts/chopindex ${pb}/usr/ports/INDEX-${branch} ${pb}/${branch}/packages > \ + ${pb}/scripts/chopindex ${pb}/${branch}/ports/INDEX-${branch} ${pb}/${branch}/packages > \ ${pb}/${branch}/packages/INDEX echo $(ls -1 ${pb}/${branch}/packages/All | wc -l) "packages built" echo $(cat ${pb}/${branch}/packages/INDEX | wc -l) "lines in INDEX" echo $(echo $(du -sk ${pb}/${branch}/packages | awk '{print $1}') / 1024 | bc) "MB of packages" - echo $(echo $(du -sk ${pb}/distfiles | awk '{print $1}') / 1024 | bc) "MB of distfiles" + echo $(echo $(du -sk ${pb}/${branch}/distfiles | awk '{print $1}') / 1024 | bc) "MB of distfiles" if [ "$norestr" = 0 ]; then echo "deleting restricted ports" sh ${pb}/${branch}/restricted.sh - ${pb}/scripts/chopindex ${pb}/usr/ports/INDEX ${pb}/${branch}/packages > \ + ${pb}/scripts/chopindex ${pb}/${branch}/ports/INDEX ${pb}/${branch}/packages > \ ${pb}/${branch}/packages/INDEX echo $(ls -1 ${pb}/${branch}/packages/All | wc -l) "packages built" echo $(cat ${pb}/${branch}/packages/INDEX | wc -l) "lines in INDEX" echo $(echo $(du -sk ${pb}/${branch}/packages | awk '{print $1}') / 1024 | bc) "MB of packages" - echo $(echo $(du -sk ${pb}/distfiles | awk '{print $1}') / 1024 | bc) "MB of distfiles" + echo $(echo $(du -sk ${pb}/${branch}/distfiles | awk '{print $1}') / 1024 | bc) "MB of distfiles" fi rm -rf ${pb}/${branch}/bad mkdir -p ${pb}/${branch}/bad @@ -527,15 +540,20 @@ if [ "$nobuild" = 0 ]; then echo "================================================" echo "started at $(date)" cd ${pb} - rm -rf bak/distfiles - mv -f distfiles bak - su ${user} -c ${scripts}/cpdistfiles > ${pb}/cpdistfiles.log 2>&1 </dev/null & - if [ "$ftp" = 1 ]; then - echo "ended at $(date)" - echo "================================================" - echo "copying packages" - echo "================================================" - su ${user} -c "${scripts}/docppackages ${branch}" + rm -rf ${branch}/bak/distfiles + mv -f ${branch}/distfiles ${branch}/bak + ${scripts}/dodistfiles ${pb}/${branch}/bak/distfiles + rm -rf ${pb}/${branch}/bak/distfiles/.btmp + rm -f ${pb}/${branch}/bak/distfiles/.done + if [ "$branch" != "4-exp" ]; then + su ${user} -c "${scripts}/cpdistfiles ${branch} > ${pb}/${branch}/cpdistfiles.log 2>&1 </dev/null" & + if [ "$ftp" = 1 ]; then + echo "ended at $(date)" + echo "================================================" + echo "copying packages" + echo "================================================" + su ${user} -c "${scripts}/docppackages ${branch}" + fi fi fi endtime=$(date +%s) |