[Midnightbsd-cvs] mports: Tools/portbuild: Magus meets pointyhat.
ctriv at midnightbsd.org
ctriv at midnightbsd.org
Mon Sep 22 17:22:32 EDT 2008
Log Message:
-----------
Magus meets pointyhat.
Magus and pointyhat come to fisticuffs
Pointyhat goes away.
Removed Files:
-------------
mports/Tools/portbuild:
README
mlist
portbuild.conf
mports/Tools/portbuild/4:
mkbindist.conf
mports/Tools/portbuild/4/bindist:
README
delete
dirlist
mports/Tools/portbuild/4/bindist/files/usr/bin:
uname
mports/Tools/portbuild/5:
mkbindist.conf
mports/Tools/portbuild/5/bindist/files/usr/bin:
uname
mports/Tools/portbuild/scripts:
allgohans
bothlogs
buildenv
buildfailure
buildscript
buildsuccess
checkmachines
checkmachines.sh
chopindex
claim-chroot
clean-chroot
cleanup-chroots
comparelogs
cpdistfiles
cppackages
docppackages
dodistfiles
dologs
dopackages
dopackages.wrapper
dopackages2
dopackagestats
dosetupnode
flushsquid
getmachine
keeprestr
makeduds
makeindex
makeparallel
makerestr
makeworld
mkbindist
pdispatch
pnohang.c
pollmachine
portbuild
processfail
processlogs
processlogs2
processonelog
prunebad
prunefailure
prunepkgs
ptimeout.c
releasemachine
reportload
reportload.sh
setupnode
showrunning
stats
updatefailure
-------------- next part --------------
--- Tools/portbuild/4/mkbindist.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-rel=4-LATEST
-ftpserver=current.jp.freebsd.org
-ftpdists="bin/bin dict/dict games/games manpages/manpages compat22/compat22 compat3x/compat3x crypto/crypto crypto/krb4"
-kernel=CLUSTER
-ftp=1
-useworld=0
--- Tools/portbuild/4/bindist/dirlist
+++ /dev/null
@@ -1,9 +0,0 @@
-tmp/depends
-tmp/distfiles
-tmp/packages
-usr/X11R6
-usr/local
-usr/opt/doc
-usr/opt/www
-usr/ports
-usr/src
--- Tools/portbuild/4/bindist/delete
+++ /dev/null
@@ -1,64 +0,0 @@
-compat
-dev
-tmp
-usr/games/adventure
-usr/games/arithmetic
-usr/games/atc
-usr/games/backgammon
-usr/games/battlestar
-usr/games/bcd
-usr/games/bs
-usr/games/caesar
-usr/games/canfield
-usr/games/cfscores
-usr/games/cribbage
-usr/games/dm
-usr/games/factor
-usr/games/fish
-usr/games/fortune
-usr/games/grdc
-usr/games/hack
-usr/games/hangman
-usr/games/hide
-usr/games/larn
-usr/games/mille
-usr/games/morse
-usr/games/number
-usr/games/phantasia
-usr/games/piano
-usr/games/pig
-usr/games/pom
-usr/games/ppt
-usr/games/primes
-usr/games/quiz
-usr/games/rain
-usr/games/random
-usr/games/robots
-usr/games/rogue
-usr/games/rot13
-usr/games/sail
-usr/games/snake
-usr/games/snscore
-usr/games/teachgammon
-usr/games/trek
-usr/games/unstr
-usr/games/wargames
-usr/games/worm
-usr/games/worms
-usr/games/wump
-usr/lib/lib*_p.a
-usr/lib/aout/lib*_p.a
-usr/share/calendar
-usr/share/doc
-usr/share/examples
-usr/share/games
-usr/share/info/*.info.gz
-usr/share/isdn
-usr/share/locale
-usr/share/man
-usr/share/nls
-usr/share/perl/man
-usr/share/zoneinfo
-usr/sbin/sysctl
-var/games
-var/run
--- Tools/portbuild/4/bindist/README
+++ /dev/null
@@ -1,31 +0,0 @@
-(1) Copy the following files to under the "files" subdirectory:
-
- Copy the following files from a running 4.0 system:
-
- /dev/{bpf0,kmem,lkm,mem,null,random,stderr,stdin,stdout,tty,zero}
- /dev/fd/[0-9]
- /etc/resolv.conf
-
- /usr/bin/openssl
- /usr/include/openssl/evp.h
- /usr/include/openssl/rsa.h
- /usr/include/openssl/rsaref.h
- /usr/lib/libRSAglue.a
- /usr/lib/libRSAglue.so.1
- /usr/lib/libcrypto.a
- /usr/lib/libcrypto.so.1
- /usr/lib/libssl.a
- /usr/lib/libssl.so.1
-
- Copy the following files from a running 4-current system or a
- 2.2-stable system. In the latter case, it will be in /usr/lib.
-
- /usr/lib/aout/c++rt0.o
-
- Copy the following files from a very recent 4.0 system or source tree:
-
- /usr/share/info/dir
-
-(2) Run "sh mkbindist". Note the first time you should set "ftp=1".
-
-(3) Copy "tarballs/bindist.tar" to the same directory in all the build machines.
--- Tools/portbuild/4/bindist/files/usr/bin/uname
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-# "sed -e 's/\(.\)/ -\1/g'" can be used to convert "abc" to "-a -b -c"
-
-a=0
-m=0
-n=0
-r=0
-s=0
-v=0
-
-if [ $# = 0 ]; then
- s=1
-else
- set $(printf "%s\n" "$*" | sed -e 's/-//g' -e 's/\([a-z]\)/ \1/g')
- while [ $# -gt 0 ]; do
- eval $1=1
- shift
- done
-fi
-
-if [ "$a" = 1 ]; then
- m=1
- n=1
- r=1
- s=1
- v=1
-fi
-
-printed=0
-
-if [ -f /usr/bin/UNAME_VERSION ]; then
- VERSION=$(cat /usr/bin/UNAME_VERSION)
-else
- VERSION=4.5-RELEASE #XXX Perhaps make it the same as the host version?
-fi
-
-if [ "$s" = 1 ]; then
- echo -n "FreeBSD"
- printed=1
-fi
-
-printsp () {
- if [ $1 = 1 ]; then
- echo -n " "
- fi
-}
-
-if [ "$n" = 1 ]; then
- printsp $printed
- echo -n $(hostname)
- printed=1
-fi
-
-if [ "$r" = 1 ]; then
- printsp $printed
- echo -n "${VERSION}"
- printed=1
-fi
-
-if [ "$v" = 1 ]; then
- printsp $printed
- echo -n "FreeBSD ${VERSION} #0: Sun Apr 1 02:34:56 PST 2002 asami at bento.freebsd.org:/usr/src/sys/compile/BENTO"
- printed=1
-fi
-
-if [ "$m" = 1 ]; then
- printsp $printed
- echo -n "i386"
- printed=1
-fi
-
-echo
--- Tools/portbuild/5/mkbindist.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-rel=5-LATEST
-ftpserver=snapshots.jp.freebsd.org
-ftpdists="bin/bin dict/dict games/games compat22/compat22 compat3x/compat3x compat4x/compat4x crypto/crypto crypto/krb4"
-kernel=CLUSTER
-ftp=1
-useworld=0
--- Tools/portbuild/5/bindist/files/usr/bin/uname
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-# "sed -e 's/\(.\)/ -\1/g'" can be used to convert "abc" to "-a -b -c"
-
-a=0
-m=0
-n=0
-r=0
-s=0
-v=0
-
-if [ $# = 0 ]; then
- s=1
-else
- set $(printf "%s\n" "$*" | sed -e 's/-//g' -e 's/\([a-z]\)/ \1/g')
- while [ $# -gt 0 ]; do
- eval $1=1
- shift
- done
-fi
-
-if [ "$a" = 1 ]; then
- m=1
- n=1
- r=1
- s=1
- v=1
-fi
-
-printed=0
-
-if [ "$s" = 1 ]; then
- echo -n "FreeBSD"
- printed=1
-fi
-
-printsp () {
- if [ $1 = 1 ]; then
- echo -n " "
- fi
-}
-
-if [ "$n" = 1 ]; then
- printsp $printed
- echo -n $(hostname)
- printed=1
-fi
-
-if [ "$r" = 1 ]; then
- printsp $printed
- echo -n "5.0-CURRENT"
- printed=1
-fi
-
-if [ "$v" = 1 ]; then
- printsp $printed
- echo -n "FreeBSD 5.0-CURRENT #0: Sun Mar 18 03:47:56 PST 2000 asami at bento.freebsd.org:/usr/src/sys/compile/BENTO"
- printed=1
-fi
-
-if [ "$m" = 1 ]; then
- printsp $printed
- echo -n "i386"
- printed=1
-fi
-
-echo
--- Tools/portbuild/portbuild.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-# $MidnightBSD: mports/Tools/portbuild/portbuild.conf,v 1.2 2006/10/01 17:40:09 laffer1 Exp $
-# $FreeBSD: ports/Tools/portbuild/portbuild.conf,v 1.2 2000/12/18 04:43:46 asami Exp $
-
-# sample configuration file for package build
-
-arch=i386
-domain=MidnightBSD.org
-ftpsite=ftp.$domain
-distfiledir=w/mports/distfiles
-packagedir=w/mports/${arch}/tmp
-master=bento
-pb=/var/portbuild
-user=laffer1
-mailto=$user@$domain
-scratchdir=/x/tmp
-
-#
-# add your own variables down here to avoid CVS merge conflicts
-#
--- Tools/portbuild/mlist
+++ /dev/null
@@ -1,2 +0,0 @@
-paddock 3
-builder 2
--- Tools/portbuild/README
+++ /dev/null
@@ -1,94 +0,0 @@
-This is the parallelized package building system. Many thanks to
-Steve Price for helping me put this together.
-
- - Satoshi
-
-In the following, ${branch} is either "2.2" or "3.0" depending on
-which packages you intend to build.
-
-Note that this system is still under development. It will require a
-substantial amount of effort to set up initially, and the following is
-probably missing a lot of stuff. Please let me know of any warts you
-find.
-
- (1) One of the machines are to be designated as the "master". It is
- defined in the portbuild script. There is also a "buildroot"
- directory where everything should reside on the master machine.
- It is defined in ports/Makefile and the portbuild script. Copy
- everything under this directory there and make necessary changes.
-
- (2) On the master, check out the ports tree under
- ${buildroot}/usr/ports, the appropriate source tree under
- ${buildroot}/${branch}/src and the doc tree under
- ${buildroot}/usr/opt/doc. These directories have to be NFS
- exported to the build machines. (Hint: you should probably add
- "-alldirs" to /etc/exports.)
-
- (3) Setup ssh for root between the build machines and the master. It
- has to work in both directions.
-
- (4) Put the list of machines you have in "mlist". There is a sample
- provided in this directory. Each line should have two entries,
- "hostname" and "power". The "hostname" is self-explanatory; the
- "power" entry generally describes how many compilations that
- machine can run in parallel. This number is used by the checkmachines
- script to work out which machines should be handed new jobs, by
- dividing the number of running jobs on the client by its weight and
- taking the integer part, and choosing all clients with minimal value.
- Because it takes the integer value this algorithm will select machines
- with loads in a certain range, not just the single least loaded machine.
-
- Note that you can put the master here as well, but our experience
- is that our NFS is likely to act up when the master is too busy.
- Even with a two-processor P6-200, we had to refrain from running
- any compilations on the master to get NFS to work reliably.
-
- (5) Go to ${branch}/bindist and follow the instructions in the README
- files there to create the bindist tarball.
-
- (6) Generate an XFree86 tarball in ports/x11/XFree86. Use
- PLIST.stripped to create a smaller version. (You can use it by
- setting 'PLIST=${PKGDIR}/PLIST.stripped'.) Put it in
- ${branch}/tarballs.
-
- (7) If you have Motif, generate a Motif tarball by using
- ports/x11-toolkits/Motif-dummy. Put it in ${branch}/tarballs.
-
- (8) Copy ${branch}/tarballs and ${buildroot}/portbuild to same
- directories on the build machines. Create a directory
- ${branch}/chroot on the build machines.
-
- (9) Create the directory ${buildroot}/{distfiles,loads},
- ${branch}/{errors,logs} and ${branch}/packages/All on the master.
- Copy the XFree86 and Motif tarballs to the latter directory.
-
-(10) Run the "reportload" script on the build machines in the
- background (you can put reportload.sh in /usr/local/etc/rc.d to
- run it automatically upon reboot), and then run the
- "checkmachines" script on the master, again in the background.
- This will check all the machines listed in "mlist" periodically
- and print the list of least-loaded machines to "ulist".
-
-(11) Run the "makeduds" script at ${buildroot}/usr/ports. The one
- supplied is for building 2.2 packages on a 3.0 machines. For
- 3.0, you can replace it with just two lines:
-
- unset DISPLAY
- PARALLEL_PACKAGE_BUILD=t make ignorelist ECHO_MSG=true > ../../3.0/duds
-
-(12) Run the "makeindex" script at ${buildroot}/usr/ports. The one
- supplied is for building 2.2 packages on a 3.0 machines. For
- 3.0, you can replace it with just one line:
-
- PORTSDIR=$(pwd) PARALLEL_PACKAGE_BUILD=t make index
-
-(13) Run "make parallel > ../../${branch}/Makefile" in
- ${buildroot}/usr/ports to generate the Makefile.
-
-(14) Go to ${branch}/packages/All on the master and type "make -k
- -j<whatever> -f ../../Makefile &". Then wait. :)
-
-(15) Note that the new scheme will not clean up the chroot dirs under
- ${buildroot}/${branch}/chroot on the build machines, but will
- instead reuse them during the course of the build. Make sure you
- delete them all when your bindist.tar changes.
--- Tools/portbuild/scripts/portbuild
+++ /dev/null
@@ -1,326 +0,0 @@
-#!/bin/sh
-
-# usage: $0 ARCH BRANCH [-noclean] [-norestr] [-noplistcheck] [-distfiles] [-fetch-original] [-trybroken] PKGNAME.tgz DIRNAME [DEPENDENCY.tgz ...]
-
-mount_fs()
-{
- fs=$1
- mntpt=$2
- master=$3
-
- if [ ${disconnected} = 1 ]; then
- mount -t nullfs -r ${fs} ${mntpt}
- else
- mount_nfs -o ro -3 -i ${master}:${fs} ${mntpt}
- fi
-}
-
-copypkg()
-{
- pb=$1
- host=$2
- from=$3
- to=$4
- http_proxy=$5
-
- if [ ${host} = $(hostname) ]; then
- cp ${pb}/${arch}/${branch}/packages/All/${from} ${to}
- else
- if [ ! -z "${http_proxy}" ]; then
- env HTTP_PROXY=${http_proxy} fetch -m -o ${to} http://${host}/errorlogs/${arch}-${branch}-packages-latest/All/${from}
- else
- fetch -m -o ${to} http://${host}/errorlogs/${arch}-${branch}-packages-latest/All/${from}
- fi
- fi
-}
-
-bailout()
-{
- chroot=$1
- clean=$2
- error=$3
- pkgname=$4
-
- echo -n "$pkgname failed unexpectedly on $(hostname) at "
- date
-
- exit $error
-}
-
-# configurable variables
-pb=/var/portbuild
-
-arch=$1
-shift
-
-# Default niceness value
-nice=0
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/${arch}/portbuild.$(hostname)
-. ${pb}/scripts/buildenv
-
-buildroot=${scratchdir}
-error=0
-
-branch=$1
-chroot=$2
-shift 2
-
-clean=1
-if [ "x$1" = "x-noclean" ]; then
- clean=0
- shift
-fi
-norestr=0
-if [ "x$1" = "x-norestr" ]; then
- norestr=1
- export NO_RESTRICTED=1
- shift
-fi
-noplistcheck=0
-if [ "x$1" = "x-noplistcheck" ]; then
- noplistcheck=1
- export NOPLISTCHECK=1
- shift
-fi
-nodistfiles=1
-if [ "x$1" = "x-distfiles" ]; then
- export ALWAYS_KEEP_DISTFILES=1
- nodistfiles=0
- shift
-fi
-if [ "x$1" = "x-fetch-original" ]; then
- export FETCH_ORIGINAL=1
- shift
-fi
-if [ "x$1" = "x-trybroken" ]; then
- export TRYBROKEN=1
- shift
-fi
-
-ED=$1
-PD=$2
-FD=$3
-BD=$4
-RD=$5
-
-buildenv ${pb} ${arch} ${branch}
-
-# Want to use the /etc/make.conf in the chroot
-unset __MAKE_CONF
-
-pkgname=$(basename $6 ${PKGSUFFIX})
-dirname=$7
-shift 2
-
-echo $pkgname
-echo $dirname
-
-export WRKDIRPREFIX=/work
-export DISTDIR=/tmp/distfiles
-export PACKAGES=/tmp/packages
-
-# to catch missing dependencies
-#export DEPENDS_TARGET=/usr/bin/true
-
-# don't pass -j, -k etc. to sub-makes
-unset MAKEFLAGS
-unset PORTSDIR
-export SRCBASE=/usr/src
-
-# wait 1 hour before killing build with no output
-export TIMEOUT=7200
-
-# to prevent runaway processes -- 300 meg file size limit, one hour CPU limit
-ulimit -f 614400
-ulimit -t 3600
-
-# directories to clean
-cleandirs="${LOCALBASE} ${X11BASE} /compat /var/db/pkg"
-
-# 15 minutes
-export FTP_TIMEOUT=900
-export HTTP_TIMEOUT=900
-
-export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${LOCALBASE}/sbin:${LOCALBASE}/bin:${X11BASE}/bin
-
-echo "building $pkgname in $chroot"
-
-bakdir=${pb}/${arch}/${branch}/tarballs
-bindist=${buildroot}/${branch}/tarballs/bindist.tar
-bindistlocal=${buildroot}/${branch}/tarballs/bindist-$(hostname).tar
-packages=${pb}/${arch}/${branch}/packages
-
-if [ -f ${chroot}/.notready ]; then
- tar -C ${chroot} -xpf ${bindist}
- if [ -f ${bindistlocal} ]; then
- tar -C ${chroot} -xpf ${bindistlocal}
- fi
-
- # to be able to run ps and killall inside chroot area
- if [ "${branch}" = "4" -o "${branch}" = "4-exp" ]; then
- mkdir -p ${chroot}/libexec
- mkdir -p ${chroot}/lib
- if [ "${arch}" = "i386" ]; then
- cp -p /sbin/mount_linprocfs /sbin/mount /sbin/umount ${chroot}/sbin
- cp -p /lib/libufs.so.2 ${chroot}/lib
- fi
- cp -p /libexec/ld-elf.so.1 ${chroot}/libexec
- cp -p /lib/libkvm.so.2 /lib/libm.so.3 ${chroot}/lib
- if [ -f /lib/libc.so.6 ]; then
- cp -p /lib/libc.so.6 ${chroot}/lib
- else
- cp -p /lib/libc.so.5 ${chroot}/lib
- fi
- elif [ "${branch}" = "6" ]; then
- cp -p /lib/libc.so.5 ${chroot}/lib
- fi
- cp -p /rescue/ps ${chroot}/bin
- cp -p /usr/bin/killall ${chroot}/usr/bin
- rm ${chroot}/.notready
- touch ${chroot}/.ready
-fi
-
-if [ "${use_jail}" = "1" ]; then
- # Figure out jail IP addr
- chrootpid=$(basename ${chroot})
- ip1=$(($chrootpid /(256*256)))
- ip2=$((($chrootpid - ($ip1*256*256)) /256))
- ip3=$((($chrootpid - ($ip1*256*256) - ($ip2*256))))
-fi
-
-# Set up desired uname version
-echo ${OSREL}-${BRANCH} > ${chroot}/usr/bin/UNAME_VERSION
-
-trap "bailout ${chroot} ${clean} ${error} ${pkgname}" 1 2 3 9 10 11 15
-
-rm -rf ${chroot}/tmp/*
-cd ${chroot}/tmp
-mkdir -p depends distfiles packages
-
-echo "building ${pkgname} on $(hostname)" | tee ${chroot}/tmp/${pkgname}.log
-echo "in directory ${chroot}" | tee -a ${chroot}/tmp/${pkgname}.log
-
-# intentionally set up ${PORTSDIR} with symlink to catch broken ports
-mkdir -p ${chroot}/a/ports
-rm -rf ${chroot}/usr/ports
-
-# Don't build in a world-writable standard directory because some ports
-# hardcode this path and try to load things from it at runtime, which is
-# bad for user security
-rm -rf ${chroot}/${WRKDIRPREFIX}
-mkdir -p ${chroot}/${WRKDIRPREFIX}
-
-if [ ! -z "${ccache_dir}" ]; then
- mkdir -p ${chroot}/root/.ccache/
- mount -o rw -t nullfs ${ccache_dir} ${chroot}/root/.ccache/
-fi
-
-mount_fs ${pb}/${arch}/${branch}/ports ${chroot}/a/ports ${master}
-ln -sf ../a/ports ${chroot}/usr/ports
-
-mkdir -p ${chroot}/usr/src
-
-mount_fs ${pb}/${arch}/${branch}/src ${chroot}/usr/src ${master}
-
-mount -t devfs foo ${chroot}/dev
-
-umount -f ${chroot}/compat/linux/proc > /dev/null 2>&1
-
-# just in case...
-for dir in ${cleandirs}; do
- if ! rm -rf ${chroot}${dir} >/dev/null 2>&1; then
- chflags -R noschg ${chroot}${dir}
- rm -rf ${chroot}${dir} >/dev/null 2>&1
- fi
-done
-
-rm -rf ${chroot}/var/db/pkg/*
-
-mtree -deU -f ${chroot}/usr/src/etc/mtree/BSD.root.dist -p ${chroot} \
- >/dev/null 2>&1
-mtree -deU -f ${chroot}/usr/src/etc/mtree/BSD.var.dist -p ${chroot}/var \
- >/dev/null 2>&1
-mtree -deU -f ${chroot}/usr/src/etc/mtree/BSD.usr.dist -p ${chroot}/usr \
- >/dev/null 2>&1
-mkdir -p ${chroot}${LOCALBASE}
-mtree -deU -f ${chroot}/usr/src/etc/mtree/BSD.local.dist -p ${chroot}${LOCALBASE} \
- >/dev/null 2>&1
-
-mkdir -p ${chroot}${X11BASE}
-if [ $X_WINDOW_SYSTEM = "xfree86-3" ]; then
- mtree -deU -f ${chroot}/usr/src/etc/mtree/BSD.x11.dist -p ${chroot}${X11BASE} \
- >/dev/null 2>&1
-else
- mtree -deU -f ${chroot}/usr/src/etc/mtree/BSD.x11-4.dist -p ${chroot}${X11BASE} \
- >/dev/null 2>&1
-fi
-
-if [ ${arch} = "i386" -o ${arch} = "amd64" ]; then
- # JDK ports need linprocfs :(
- mkdir -p ${chroot}/compat/linux/proc
- chroot ${chroot} mount_linprocfs linprocfs /compat/linux/proc
-fi
-
-_ldconfig_dirs="/lib /usr/lib /usr/lib/compat"
-ldconfig_dirs=""
-for i in ${_ldconfig_dirs}; do
- if [ -d ${chroot}/${i} ]; then
- ldconfig_dirs="${ldconfig_dirs} ${i}"
- fi
-done
-chroot ${chroot} /sbin/ldconfig ${ldconfig_dirs}
-if [ ${arch} = "i386" ]; then
- chroot ${chroot} /sbin/ldconfig -aout /usr/lib/aout /usr/lib/compat/aout
-fi
-
-set x $ED $FD $PD $BD $RD
-shift 1
-while [ $# -gt 0 ]; do
- if [ ! -f ${chroot}/tmp/depends/$1 ]; then
- echo "copying package $1 for ${pkgname}"
- copypkg ${pb} ${master} $1 ${chroot}/tmp/depends "${http_proxy}"
-
- # Test for copy failure and bail
- if [ ! -f ${chroot}/tmp/depends/$1 ]; then
- echo "ERROR: Couldn't copy $1"
- bailout ${chroot} ${clean} 255 ${pkgname}
- fi
- fi
- shift
-done
-
-cp -p ${pb}/scripts/buildscript ${chroot}
-cp -p ${pb}/scripts/pnohang.${arch} ${chroot}/pnohang
-
-# phase 1, make checksum
-# Needs to be chroot not jail so that port can be fetched
-chroot ${chroot} /buildscript ${dirname} 1 "$ED" "$PD" "$FD" "$BD" "$RD" 2>&1 | tee -a ${chroot}/tmp/${pkgname}.log
-if [ -f ${chroot}/tmp/status ]; then
- error=$(cat ${chroot}/tmp/status)
-else
- error=255
-fi
-
-if [ "${error}" = 0 ]; then
-# make checksum succeeded
-# phase 2, make package
- ln -sf ${pkgname}.log2 ${chroot}/tmp/make.log
-
- if [ "${use_jail}" = 1 ]; then
- ifconfig lo0 alias 127.${ip1}.${ip2}.${ip3}/32
- jail -J ${chroot}/tmp/jail.id ${chroot} jail-${chrootpid} 127.${ip1}.${ip2}.${ip3} /usr/bin/env HTTP_PROXY=${http_proxy} /usr/bin/nice -n $nice /buildscript ${dirname} 2 "$ED" "$PD" "$FD" "$BD" "$RD" > ${chroot}/tmp/${pkgname}.log2 2>&1
- ifconfig lo0 delete 127.${ip1}.${ip2}.${ip3}
- else
- chroot ${chroot} /usr/bin/nice -n $nice /buildscript ${dirname} 2 "$ED" "$PD" "$FD" "$BD" "$RD" > ${chroot}/tmp/${pkgname}.log2 2>&1
- fi
-
- grep pnohang ${chroot}/tmp/${pkgname}.log2
- cat ${chroot}/tmp/${pkgname}.log2 >> ${chroot}/tmp/${pkgname}.log
- rm ${chroot}/tmp/${pkgname}.log2
- error=$(cat ${chroot}/tmp/status)
-fi
-
-rm -rf ${chroot}/${WRKDIRPREFIX}
-exit $error
--- Tools/portbuild/scripts/cleanup-chroots
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-#
-# To be run on the client, this script looks for chroot directories that have not been
-# used in 20 minutes, as well as directories listed as 'in use' that have not been touched
-# in 24 hours (corresponding to port builds that have timed out or shut down uncleanly)
-# and prunes them to reclaim space.
-
-kill_procs()
-{
- dir=$1
-
- pids="XXX"
- while [ ! -z "${pids}" ]; do
- pids=$(fstat -f "$dir" | tail +2 | awk '{print $3}' | sort -u)
- if [ ! -z "${pids}" ]; then
- echo "Killing off pids in ${dir}"
- ps -p $pids
- kill -KILL ${pids} 2> /dev/null
- sleep 2
- fi
- done
-}
-
-cleanup_mount() {
- chroot=$1
- mount=$2
-
- if [ -d ${chroot}${mount} ]; then
- mdir=$(fstat -f ${chroot}${mount} | head -2 | tail -1 | awk '{print $5}')
- if [ "${mdir}" = "MOUNT" ]; then
- umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!"
- fi
- if [ "${mdir}" = "${chroot}${mount}" ]; then
- kill_procs ${chroot}${mount}
- umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!"
- fi
- fi
-}
-
-pb=/var/portbuild
-arch=$(cat /etc/arch)
-
-. ${pb}/${arch}/portbuild.conf
-
-old=$(find ${scratchdir}/*/chroot/* -prune -mmin +20 2> /dev/null)
-
-if [ -z "${old}" ]; then
- exit 0
-fi
-
-# Prune out chroots with active builds
-for i in ${old}; do
- if [ ! -d ${i}/used ]; then
- old2="${i} ${old2}"
- # Also remove "in use" chroots that were set up more than 48 hours ago
- elif [ ! -z "`find $i/used -prune -mmin +2880`" ]; then
- echo "cleanup-chroots: Found old files on `hostname`:"
- ls -l ${i}/tmp ${i}/used
- echo "${i} allegedly in use but >48 hours old"
- old2="${i} ${old2}"
- fi
-done
-
-if [ -z "${old2}" ]; then
- exit 0
-fi
-
-# cleanup old NFS and devfs mounts
-for i in ${old2}; do
- mounts=$(mount | grep $i | awk '{print $3}')
- if [ ! -z "${mounts}" ]; then
- for j in ${mounts}; do
- umount ${j} || cleanup_mount ${j}
- done
- umount ${i}/compat/linux/proc || cleanup_mount ${i}/compat/linux/proc
- fi
- if [ "${use_md_swap}" = "1" ]; then
- chrootnum=$(basename $i)
- umount -f /dev/md${i}
- mdconfig -d -u ${chrootnum}
- fi
-done
-
-mkdir -p ${scratchdir}/old
-mv ${old2} ${scratchdir}/old
-rm -rf ${scratchdir}/old 2> /dev/null
-chflags -R noschg ${scratchdir}/old
-rm -rf ${scratchdir}/old
--- Tools/portbuild/scripts/pnohang.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* pnohang: executes command ($4-) with output in file ($3)
- * kills command if no output with $1 seconds with message in $2
- * usage: pnohang timeout file command args ...
- */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <unistd.h>
-#include <time.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-int
-main(int argc, char *argv[])
-{
- int timeout, status, i, result, ofd;
- char *command, *outfile, *message, args[MAXPATHLEN + 1];
- char logstr[BUFSIZ + 1];
- pid_t pid, pid1, pid2, child;
- time_t now;
- struct stat st;
- struct sigaction sv;
-
- if (argc < 3) {
- printf("usage: %s timeout outfile message command [args...]\n",
- argv[0]);
- exit(1);
- }
-
- timeout = atoi(argv[1]);
- outfile = argv[2];
- message = argv[3];
- command = argv[4];
-
- bzero(args, MAXPATHLEN + 1);
- for (i = 4; i < argc; i++) {
- strlcat(args, argv[i], MAXPATHLEN - strlen(args));
- strlcat(args, " ", MAXPATHLEN - strlen(args));
- }
-
- pid = getpid();
-
- /*printf("timeout is %d\n", timeout);
- printf("outfile is %s\n", outfile);
- printf("message is %s\n", message);
- printf("arguments are %s", args);*/
-
- if ((ofd = open(outfile, O_CREAT|O_TRUNC|O_WRONLY, 0600)) == -1)
- err(1, "open");
-
- if (dup2(ofd, STDOUT_FILENO) == -1)
- err(1, "dup2 stdout");
- if (dup2(ofd, STDERR_FILENO) == -1)
- err(1, "dup2 stderr");
-
- if ((pid1 = fork()) > 0) {
- if ((pid2 = fork()) > 0) {
- sv.sa_handler = SIG_IGN;
- sigemptyset(&sv.sa_mask);
- sv.sa_flags = 0;
- sigaction(SIGTERM, &sv, 0);
-
- /* parent */
- child = wait(&status);
- /*printf("exited child is %d, status is %d\n", child, status);*/
-
- if (pid1 = child) {
- /*printf("killing process %d (second child)\n", pid2);*/
- kill(pid2, SIGTERM);
- } else {
- /*printf("killing process %d (first child)\n", pid1);*/
- kill(pid1, SIGTERM);
- }
- /* exit status in upper 8 bits, killed signal (if any) in
- * lower 8 bits
- */
- exit((status >> 8) | (status & 0xff));
- } else {
- /* second child */
- for (;;) {
- sleep(timeout/10);
- now = time(NULL);
- stat(outfile, &st);
- if ((now - st.st_mtime) > timeout) {
- /*snprintf(logstr, BUFSIZ, "logger -t %s killing %s %s, pid %d since no output in %d seconds", argv[0], args, message, pid, timeout);
- system(logstr);*/
- printf("%s: killing %s (%s, pid %d and %d) since no output in %d seconds since %s", argv[0], args, message, pid1, pid, timeout, ctime(&now));
- printf("ps jgx before the singal\n");
- system("ps jgxww");
- sleep(1); /* give it a chance to output the message */
- kill(pid1, SIGTERM);
- sleep(1);
- kill(pid, SIGTERM);
- sleep(1);
- system("ps jgxww");
- exit(1);
- }
- }
- }
- } else {
- /* first child */
- /*printf("executing %s\n", args);*/
- result = execvp(command, argv + 4);
- if (result < 0) {
- printf("Failed to exec %s: %s\n", args, strerror(errno));
- exit(1);
- }
- }
-
- return 0;
-}
--- Tools/portbuild/scripts/docppackages
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-if [ $# != 1 ]; then
- echo "usage: $0 branch"
- exit 1
-fi
-echo /var/portbuild/scripts/cppackages $1 | at + 1 minute
-atq
--- Tools/portbuild/scripts/buildfailure
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-#
-# buildfailure <arch> <branch> <pkgname>
-
-cleanup() {
- echo "Problem writing new failure file!"
- rm -f failure.new
- exit 1
-}
-
-# configurable variables
-pb=/var/portbuild
-arch=$1
-shift 1
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-branch=$1
-pkgname=$2
-shift 2
-
-buildenv ${pb} ${arch} ${branch}
-
-# Don't pick up installed packages from the host
-export LOCALBASE=/nonexistentlocal
-export X11BASE=/nonexistentx
-
-index=${PORTSDIR}/${INDEXFILE}
-
-portloc=$(grep "^$pkgname|" ${index} | cut -f 2 -d \| | sed s,/usr/ports/,,)
-pkgbase=$(cd ${pb}/${arch}/${branch}/ports/${portloc}/ && make -V PKGBASE)
-
-cd ${pb}/${arch}/${branch}
-entry=$(grep "^${portloc}|" failure)
-date=$(date +%s)
-IFS='|'
-if [ ! -z "$entry" ]; then
- count=$(echo $entry | cut -f 6 -d \ )
- olddate=$(echo $entry | cut -f 4 -d \ )
- (grep -v "^${portloc}|" failure > failure.new) || cleanup
-
- (echo "${portloc}|${pkgbase}|${pkgname}|${olddate}|${date}|$((${count}+1))" >> failure.new) || cleanup
- mv failure.new failure
-else
- (echo "${portloc}|${pkgbase}|${pkgname}|${date}|${date}|1" >> failure) || cleanup
-fi
-
-link=${pb}/${arch}/${branch}/latest/${portloc}
-mkdir -p $(dirname ${link})
-errorloc=$(realpath ${pb}/${arch}/${branch}/errors/${pkgname}.log)
-ln -sf ${errorloc} ${link}
--- Tools/portbuild/scripts/dopackages.wrapper
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-cleanup() {
- lock=$1
- error=$2
-
- rm -f ${lock}
-
- exit ${error}
-}
-
-# configurable variables
-pb=/var/portbuild
-arch=$1
-branch=$(echo $(basename $0) | cut -d'.' -f2)
-shift
-
-. ${pb}/${arch}/portbuild.conf
-
-lock=${pb}/${arch}/${branch}/lock
-status=${pb}/${arch}/status
-date=$(date '+%Y%m%d%H')
-shortdate=$(date '+%Y%m%d')
-
-if [ -e ${lock} ]; then
- echo "Already locked."
- exit 1
-fi
-
-touch ${lock}
-rm -f ${status}
-mkdir -p ${pb}/${arch}/archive/buildlogs
-
-trap "cleanup ${lock} 1" 1 2 3 9 10 11 15
-
-dorun() {
- branch=$1
- shift 1
-
- ln -sf ${pb}/${arch}/archive/buildlogs/log.${branch}.${date} ${pb}/${arch}/${branch}/build.log
- ln -sf log.${branch}.${date} ${pb}/${arch}/archive/buildlogs/log.${branch}.${shortdate}
- ${pb}/scripts/dopackages ${arch} $@ ${branch} ${date} 2>&1 \
- > ${pb}/${arch}/archive/buildlogs/log.${branch}.${date}
- if [ -f ${status} ]; then
- error=$(cat ${status})
- cleanup ${lock} ${error}
- fi
-
-}
-
-dorun ${branch} $@ &
-wait
-
-cleanup ${lock} 0
--- Tools/portbuild/scripts/makeparallel
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-pb=/var/portbuild
-
-if [ $# -ne 2 ]; then
- echo "usage: makeparallel arch branch"
- exit 1
-fi
-
-arch=$1
-branch=$2
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-buildenv ${pb} ${arch} ${branch}
-
-# packages that take a long time to build or have very deep dependency
-# trees and tend to stall the rest of the cluster waiting for them.
-# We try to start these as early as possible.
-
-quickports="lang/ghc x11/XFree86-4 x11/xorg x11/gnome2 x11/kde3 java/jdk15 java/jdk14 editors/openoffice.org-1.0 editors/openoffice.org-1.1-devel editors/openoffice.org-2.0-devel editors/openoffice.org-1.1 editors/openoffice.org-2.0"
-
-cd ${PORTSDIR}
-subdir=$(make -V SUBDIR)
-makefile=${pb}/${arch}/${branch}/Makefile
-rm ${makefile}
-
-SUBDIR=$(make -V SUBDIR)
-(for dir in ${SUBDIR}; do
- [ -r ${dir}/Makefile ] && echo "all: ${dir}-all" || true
-done
-env arch=${arch} branch=${branch} awk -F '|' '{me=$1; here=$2; bdep=$8; rdep=$9
- edep=$11; pdep=$12; fdep=$13
- sufx=ENVIRON["PKGSUFFIX"]
- arch=ENVIRON["arch"]
- branch=ENVIRON["branch"]
- split(here, tmp, "/")
- if (edep != "") { gsub("$", sufx, edep); gsub(" ", sufx " ", edep) }
- if (pdep != "") { gsub("$", sufx, pdep); gsub(" ", sufx " ", pdep) }
- if (fdep != "") { gsub("$", sufx, fdep); gsub(" ", sufx " ", fdep) }
- if (bdep != "") { gsub("$", sufx, bdep); gsub(" ", sufx " ", bdep) }
- if (rdep != "") { gsub("$", sufx, rdep); gsub(" ", sufx " ", rdep) }
- print tmp[4] "-all: " me sufx
- print me ": " me sufx
- print me sufx ": " edep " " pdep " " fdep " " bdep " " rdep
- printf("\t@/usr/bin/env XXX=\"\" ")
- if (edep != "") printf(" ED=\"%s\"", edep)
- if (pdep != "") printf(" PD=\"%s\"", pdep)
- if (fdep != "") printf(" FD=\"%s\"", fdep)
- if (bdep != "") printf(" BD=\"%s\"", bdep)
- if (rdep != "") printf(" RD=\"%s\"", rdep)
- printf(" /var/portbuild/scripts/pdispatch %s %s /var/portbuild/scripts/portbuild %s%s %s\n",
- arch, branch, me, sufx, here)
- }' < ${INDEXFILE}) > ${makefile}
-
-for i in ${quickports}; do
- if [ -d $i ]; then
- quickpkg="$(cd $i; make package-name)${PKGSUFFIX}"
- echo "quickports: $quickpkg" >> ${makefile}
- else
- echo "quick port directory \"$i\" does not exist -- skipping"
- fi
-done
--- Tools/portbuild/scripts/checkmachines.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-#
-# Start the checkmachines script in the background, at system startup.
-
-s=/var/portbuild/scripts/checkmachines
-
-if [ -x $s ]; then
- $s &
- echo -n ' checkmachines'
-fi
--- Tools/portbuild/scripts/setupnode
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-#
-# Script run on the clients, to set them up in preparation for building
-# packages. This includes setting up parts of the /var/portbuild
-# directory hierarchy, the portbuild script and the bindist.tar file
-# for populating the build chroots.
-
-nocopy=0
-if [ "x$1" = "x-nocopy" ]; then
- nocopy=1
- shift
-fi
-
-if [ $# != 7 ]; then
- echo "usage: $0 [-nocopy] master portbuilddir arch branch tmpdir md5 disconnected"
- exit 1
-fi
-
-master=$1
-pb=$2
-arch=$3
-branch=$4
-tmpdir=$5
-md5master=$6
-disconnected=$7
-
-mkdir -p ${tmpdir}/${branch}/chroot
-mkdir -p ${tmpdir}/${branch}/tarballs
-cd ${tmpdir}
-if [ "$nocopy" = 0 ]; then
- if [ -f ${tmpdir}/${branch}/tarballs/bindist.tar ]; then
- md5=$(/sbin/md5 ${tmpdir}/${branch}/tarballs/bindist.tar | awk '{print $4}')
- fi
- if [ "${md5}" = "${md5master}" ]; then
- echo "not copying bindist to $(hostname) since it is already up to date"
- else
- echo "copying bindist to $(hostname)"
- if [ ${disconnected} = 0 ]; then
- cp -p ${pb}/${arch}/${branch}/tarballs/bindist.tar ${tmpdir}/${branch}/tarballs
- fi
- fi
- cp -p ${pb}/${arch}/${branch}/tarballs/bindist-$(hostname).tar ${tmpdir}/${branch}/tarballs
- if [ ${disconnected} = 1 ]; then
- # Prepare all directories, they will be populated by a rsync push from the master
- mkdir -p ${pb}/scripts ${pb}/${arch}/${branch}/ports ${pb}/${arch}/${branch}/src ${pb}/${arch}/${branch}/src ${pb}/${arch}/${branch}/tarballs
- # bindist is a local file, so we don't have to worry about whether nfs caches it
- # This symlink will dangle until the rsync comes along and fills in the destination.
- ln -sf ${pb}/${arch}/${branch}/tarballs/bindist.tar ${tmpdir}/${branch}/tarballs
- ln -sf ${pb}/${arch}/${branch}/tarballs/bindist-$(hostname).tar ${tmpdir}/${branch}/tarballs
- fi
-fi
-
-# Clean up the tmpdir
-for i in ${tmpdir}/${branch}/chroot/*; do
- ${pb}/scripts/clean-chroot ${arch} ${branch} ${i} 2
-done
--- Tools/portbuild/scripts/releasemachine
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-buildroot=/var/portbuild
-
-i=$1
-m=$2
-
-. ${buildroot}/${i}/portbuild.conf
-if [ -f ${buildroot}/${i}/portbuild.${m} ]; then
- . ${buildroot}/${i}/portbuild.${m}
-fi
-
-q=${buildroot}/${i}/queue/$m
-if [ -f ${q} ]; then
- num=$(cat $q)
-else
- num=${maxjobs}
-fi
-
-if [ "$num" -gt 0 ]; then
- echo $((${num}-1)) > $q
-fi
-
-chown ports-${i} ${q}
-exit 0
--- Tools/portbuild/scripts/processlogs
+++ /dev/null
@@ -1,302 +0,0 @@
-#!/bin/sh
-# echo 'processlogs: at '`date`', begin'
-
-# establish which directory the logfiles live in (leave out for
-# backwards compatibility)
-buildlogdir=$(realpath .)
-if [ "$2" != "" ]; then buildlogdir="$2"; fi
-
-baselogdir=$(basename ${buildlogdir})
-
-# establish which directory INDEX lives in (leave out for
-# backwards compatibility)
-indexlogdir=$(realpath .)
-if [ "$3" != "" ]; then indexlogdir="$3"; fi
-
-# allow this script to be run from anywhere in the tree
-scriptdir=$(dirname $0)
-errorscript=$scriptdir/processonelog
-
-# Figure out which arch we're building for
-pb=/var/portbuild
-rpb=$(realpath ${pb} | sed -e "s,/$,," )
-
-arch=$(echo ${buildlogdir} | sed -e "s,${rpb}/,," | cut -f 1 -d /)
-. ${pb}/${arch}/portbuild.conf
-
-# create a name for the tempfile
-of=.index.html
-
-# if there are no new logfiles, there is nothing to do here.
-if [ -e .stamp -a $(echo $(find -f $buildlogdir -maxdepth 1 -newer .stamp -type f -name '*.log' 2>/dev/null | wc -l)) = "0" ]; then exit; fi
-
-touch .stamp
-
-# get the list of buildlogs.
-set $buildlogdir/*.log
-> .logs
-
-#
-# Read the log-files and write summaries to .logs in the format
-# $filename|$portname|$affected|$logsize|$dir|$maintainer|\
-# $reason|$tag|$broken|$datetime
-#
-
-# echo 'processlogs: at '`date`', begin processing log files'
-
-if [ $# != 1 -o "x$1" != "x`dirname $1`/*.log" ]; then
- while [ ! -z "$1" ]; do
- filename=$(basename $1)
- #echo 'processlogs: at '`date`', examining '$filename'
-
- $errorscript $filename $indexlogdir >> .logs
- shift
- done
-fi
-# echo 'processlogs: at '`date`', end processing log files'
-
-# XXX Sometimes log entries get doubled up for some reason
-uniq .logs > .logs2
-mv .logs2 .logs
-
-num=$(wc -l < .logs)
-
-header() {
- echo "<html><head><title>Package building errors</title>" >$of
- echo "</head><body><h1>Package building errors</h1>" >>$of
- echo "<p>View by " >>$of
- echo "[ <a href=\"index.html\">port</a> " >>$of
- echo "| <a href=\"index-maintainer.html\">maintainer</a> " >>$of
- echo "| <a href=\"index-category.html\">category</a> " >>$of
- echo "| <a href=\"index-reason.html\">error</a> " >>$of
- echo "| <a href=\"index-builddate.html\">builddate</a> " >>$of
- echo "]</p>" >>$of
-
- if [ $num = "0" ]; then
- echo "No errors (yet)" >>$of
- else
- if [ -s cvsdone ]; then
- echo "CVS update finished at: $(cat cvsdone)<br>" >> $of
- fi
- latest=$(cd $buildlogdir; ls -rtTl *.log | tail -1 | awk '{printf("%s %s %s %s\n",$6,$7,$8,$9)}';)
- echo "Timestamp of newest log: $latest<br><br>" >> $of
- echo "\"Aff.\" is number of ports that depend on this one<br>" >> $of
- echo "\"<font color=\"red\">[B]</font>\" indicates port is marked BROKEN<br><br>" >> $of
- echo "<p>$num errors</p>" >> $of
- echo "<table border=1>" >>$of
- echo "<tr>$1</tr>" >>$of
- fi
-}
-
-footer() {
- echo "</table>" >>$of
- echo "</body>" >>$of
- echo "</html>" >>$of
-}
-
-# Now reread the .logs file and create the reports. If the .logs file
-# has blanks in any field, this code won't work. Therefore, the
-# code above has to guarantee that that won't happen, and the code
-# below has to catch the metatoken.
-
-# echo 'processlogs: at '`date`', create default output'
-#
-# Create "default" output, sorted on portname
-#
-header "<th>Port</th><th>Aff.</th><th>Size</th><th>CVS</th><th>Maintainer</th><th>Reason</th><th>Build date</th>"
-
-for i in `cat .logs | sort`; do
- set $(echo "$i" | tr \| " " | sed -e "s at NONE@\\ @g")
- mailto="$6"
- if [ "$6" != " " ] ; then
- mailto="<a href=\"mailto:$6\">$6</a>"
- fi
-
- echo "<tr>" >> $of
-
- echo "<td><a href=\"http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$1\">$2</a></td>" >> $of
-
- affby=$3
- test $affby = "0" -o $affby = "-1" && affby=" "
- echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
- echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
- echo "<td>$mailto</td>" >> $of
- echo "<td>" >> $of
-
- test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
- reason=$(echo $7 | tr '_' ' ')
- echo "<a href=\"http://pointyhat.freebsd.org/#$8\">$reason</a>" >> $of
- echo "</td>" >> $of
-
- date=$(echo ${10} | tr '_' ' ')
- echo "<td>$date</td>" >> $of
-
- echo "</tr>" >> $of
-done
-footer ""
-mv -f $of index.html
-
-# echo 'processlogs: at '`date`', create output sorted by category'
-#
-# Create output by category
-#
-header "<th>CVS</th><th>Aff.</th><th>Size</th><th>Port</th><th>Maintainer</th><th>Reason</th><th>Build date</th>"
-
-for i in `cat .logs | sort -t \\| +4`; do
- set $(echo "$i" | tr \| " " | sed -e "s at NONE@\\ @g")
- mailto="$6"
- if [ "$6" != " " ] ; then
- mailto="<a href=\"mailto:$6\">$6</a>"
- fi
-
- echo "<tr>" >> $of
-
- echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
-
- affby=$3
- test $affby = "0" -o $affby = "-1" && affby=" "
- echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
- echo "<td><a href=\"http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$1\">$2</a></td>" >> $of
- echo "<td>$mailto</td>" >> $of
-
- echo "<td>" >> $of
- test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
- reason=$(echo $7 | tr '_' ' ')
- echo "<a href=\"http://pointyhat.freebsd.org/#$8\">$reason</a>" >> $of
- echo "</td>" >> $of
-
- date=$(echo ${10} | tr '_' ' ')
- echo "<td>$date</td>" >> $of
-
- echo "</tr>" >> $of
-done
-footer ""
-mv -f $of index-category.html
-
-# echo 'processlogs: at '`date`', create output sorted by maintainer'
-#
-# Create output by maintainer
-#
-header "<th>Maintainer</th><th>Port</th><th>Aff.</th><th>Size</th><th>CVS</th><th>Reason</th><th>Build date</th>"
-
-for i in `cat .logs | sort -t \\| +5`; do
- set $(echo "$i" | tr \| " " | sed -e "s at NONE@\\ @g")
- mailto="$6"
- if [ "$6" != " " ] ; then
- mailto="<a href=\"mailto:$6\">$6</a>"
- fi
-
- echo "<tr>" >> $of
-
- echo "<td>$mailto</td>" >> $of
- echo "<td><a href=\"http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$1\">$2</a></td>" >> $of
-
- affby=$3
- test $affby = "0" -o $affby = "-1" && affby=" "
- echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
- echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
-
- echo "<td>" >> $of
- test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
- reason=$(echo $7 | tr '_' ' ')
- echo "<a href=\"http://pointyhat.freebsd.org/#$8\">$reason</a>" >> $of
- echo "</td>" >> $of
-
- date=$(echo ${10} | tr '_' ' ')
- echo "<td>$date</td>" >> $of
-
- echo "</tr>" >> $of
-done
-footer ""
-mv -f $of index-maintainer.html
-
-# echo 'processlogs: at '`date`', create output sorted by error'
-#
-# Create output by error
-#
-header "<th>Reason</th><th>Port</th><th>Aff.</th><th>Size</th><th>CVS</th><th>Maintainer</th><th>Build date</th>"
-
-for i in `cat .logs | sort -t \\| +7`; do
- set $(echo "$i" | tr \| " " | sed -e "s at NONE@\\ @g")
- mailto="$6"
- if [ "$6" != " " ] ; then
- mailto="<a href=\"mailto:$6\">$6</a>"
- fi
-
- echo "<tr>" >> $of
-
- echo "<td>" >> $of
- test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
- reason=$(echo $7 | tr '_' ' ')
- echo "<a href=\"http://pointyhat.freebsd.org/#$8\">$reason</a>" >> $of
- echo "</td>" >> $of
-
- echo "<td><a href=\"http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$1\">$2</a></td>" >> $of
-
- affby=$3
- test $affby = "0" -o $affby = "-1" && affby=" "
- echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
- echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
- echo "<td>$mailto</td>" >> $of
-
- date=$(echo ${10} | tr '_' ' ')
- echo "<td>$date</td>" >> $of
-
- echo "</tr>" >> $of
-done
-footer ""
-mv -f $of index-reason.html
-
-# echo 'processlogs: at '`date`', create output sorted by builddate'
-#
-# Create output by builddate
-#
-header "<th>Build date</th><th>Port</th><th>Aff.</th><th>Size</th><th>CVS</th><th>Maintainer</th><th>Reason</th>"
-
-for i in `cat .logs | sort -t \\| +9`; do
- set $(echo "$i" | tr \| " " | sed -e "s at NONE@\\ @g")
- mailto="$6"
- if [ "$6" != " " ] ; then
- mailto="<a href=\"mailto:$6\">$6</a>"
- fi
-
- echo "<tr>" >> $of
-
- date=$(echo ${10} | tr '_' ' ')
- echo "<td>$date</td>" >> $of
-
- echo "<td><a href=\"http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$1\">$2</a></td>" >> $of
-
- affby=$3
- test $affby = "0" -o $affby = "-1" && affby=" "
- echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
- echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
- echo "<td>$mailto</td>" >> $of
-
- echo "<td>" >> $of
- test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
- reason=$(echo $7 | tr '_' ' ')
- echo "<a href=\"http://pointyhat.freebsd.org/#$8\">$reason</a>" >> $of
- echo "</td>" >> $of
-
- echo "</tr>" >> $of
-done
-footer ""
-mv -f $of index-builddate.html
-
-# echo 'processlogs: at '`date`', create maintainer list'
-#
-# Get list of maintainers.
-#
-for i in `cat .logs | sort -t \\| +9`; do
- set $(echo "$i" | tr \| " " | sed -e "s at NONE@\\ @g")
- mailto="$6"
- if [ "$6" != " " ] ; then
- mailto="<a href=\"mailto:$6\">$6</a>"
- fi
-
- maints="$maints $6"
-done
-
-echo $maints | sed -e 's/ /\
-/g' | sort -fu > maintainers
--- Tools/portbuild/scripts/processonelog
+++ /dev/null
@@ -1,306 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/Tools/portbuild/scripts/processonelog,v 1.11 2006/08/20 18:38:08 linimon Exp $
-#
-# Read a single errorlogfile and output a line of the format
-# $filename|$portname|$affected|$logsize|$dir|$maintainer|\
-# $reason|$tag|$broken|$datetime
-#
-# Originally factored out of: ports/Tools/portbuild/scripts/processlogs
-
-filename=$1
-indexdir=.
-errordir=.
-if [ "$2" != "" ]; then indexdir=$2; fi
-if [ "$3" != "" ]; then errordir=$3; fi
-indexdir=$(realpath $indexdir)
-errordir=$(realpath $errordir)
-indexfilename=$indexdir/INDEX
-
-portname=$(basename $filename .log)
-affected=$(($(grep -cF $portname < $indexfilename) -1))
-logsize=$(/bin/ls -sk $errordir/$filename | awk '{print $1}')
-dir=$(sed -n -e '4p' $errordir/$filename | grep '^port directory:' | awk '{print $3}' | \
- sed -e 's,^/[^/]*/[^/]*/,,')
-maintainer=$(sed -n -e '3p' $errordir/$filename | grep '^maintained by' | awk '{print $3}')
-datetime=$(sed -n -e '5p' $errordir/$filename | grep '^build started at' | \
- sed -e 's/build started at ...//' | tr ' ' '_' )
-
-# now try to classify the type of error found in the file.
-# the first case handles failures to even try to build any
-# port (i.e. HTML file no longer there, pointyhat being unable
-# to fetch any file, pointyhat being able to build any port, etc.)
-if [ -z "$dir" -o -z "$datetime" ]; then
- reason="cluster"; tag="cluster"
-elif grep -q 'list of extra files and directories' $1; then
- reason="mtree"; tag="mtree"
-elif grep -q "See <URL:http://gcc.gnu.org/bugs.html> for instructions." $1; then
- reason="gcc_bug"; tag="gcc-bug"
-elif grep -q "See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions." $1; then
- reason="gcc_bug"; tag="gcc-bug"
-elif grep -q 'Checksum mismatch' $1; then
- reason="checksum"; tag="checksum"
-elif grep -qE '/usr/local/bin/(perl|perl5.6.1):.*(not found|No such file or directory)' $1; then
- reason="perl"; tag="perl"
-elif grep -qE 'perl(.*): Perl is not installed, try .pkg_add -r perl.' $1; then
- reason="perl"; tag="perl"
-elif grep -q 'cannot find -lc_r' $1; then
- reason="threads"; tag="threads"
-elif grep -q "checking for.*lc_r\.\.\. no" $1; then
- reason="threads"; tag="threads"
-elif grep -qE '(No checksum recorded for|(Maybe|Either) .* is out of date, or)' $1; then
- reason="distinfo_update"; tag="distinfo"
-elif grep -q "checking whether apxs works.*apxs: not found" $1; then
- reason="apxs"; tag="apxs"
-# note: must run before the configure_error check
-elif grep -qE "Configuration .* not supported" $1; then
- reason="arch"; tag="arch"
-elif grep -qE '(configure: error:|Script.*configure.*failed unexpectedly|script.*failed: here are the contents of)' $1; then
- if grep -qE "configure: error: cpu .* not supported" $1; then
- reason="arch"; tag="arch"
- elif grep -qE "configure: error: (This program requires STL to compile|One or more.*STL headers are missing)" $1; then
- reason="stl"; tag="stl"
- elif grep -qE "configure: error: [Pp]erl (5.* required|version too old)" $1; then
- reason="perl"; tag="perl"
- else
- reason="configure_error"; tag="configure"
- fi
-elif grep -q "Couldn't fetch it - please try" $1; then
- reason="fetch"; tag="fetch"
-elif grep -q "out of .* hunks .*--saving rejects to" $1; then
- reason="patch"; tag="patch"
-elif grep -q 'Error: category .* not in list of valid categories' $1; then
- reason="CATEGORIES"; tag="categories"
-elif grep -qi 'read-only file system' $1; then
- reason="WRKDIR"; tag="wrkdir"
-elif grep -q "Error: shared library \".*\" does not exist" $1; then
- reason="LIB_DEPENDS"; tag="libdepends"
-elif grep -q ".*\.h: No such file" $1; then
- if grep -qE "(X11/.*|Xosdefs)\.h: No such file" $1; then
- if grep -q "XFree86-.*\.tgz" $1; then
- reason="missing_header"; tag="header"
- else
- reason="USE_XLIB"; tag="usexlib"
- fi
- else
- reason="missing_header"; tag="header"
- fi
-elif grep -q "pnohang: killing make checksum" $1; then
- reason="fetch_timeout"; tag="fetch-timeout"
-elif grep -qE "USER PID PPID PGID.*JOBC STAT TT TIME COMMAND" $1; then
- reason="runaway_process"; tag="runaway"
-elif grep -q "pnohang: killing make package" $1; then
- reason="runaway_process"; tag="runaway"
-elif grep -qE "pkg_(add|create):.*(can't find enough temporary space|projected size of .* exceeds available free space)" $1; then
- reason="disk_full"; tag="df"
-elif grep -qE '(parse error|too (many|few) arguments to|argument.*doesn.*prototype|incompatible type for argument|conflicting types for|undeclared \(first use (in |)this function\)|incorrect number of parameters|has incomplete type and cannot be initialized|error: storage size.* isn.t known)' $1; then
- reason="compiler_error"; tag="cc"
-elif grep -qE '(ANSI C.. forbids|is a contravariance violation|changed for new ANSI .for. scoping|[0-9]: passing .* changes signedness|discards qualifiers|lacks a cast|redeclared as different kind of symbol|invalid type .* for default argument to|wrong type argument to unary exclamation mark|duplicate explicit instantiation of|incompatible types in assignment|assuming . on overloaded member function|call of overloaded .* is ambiguous|declaration of C function .* conflicts with|initialization of non-const reference type|using typedef-name .* after|[0-9]: implicit declaration of function|[0-9]: size of array .* is too large|fixed or forbidden register .* for class|assignment of read-only variable|error: label at end of compound statement|error:.*(has no|is not a) member|error:.*is (private|protected)|error: uninitialized member|error: unrecognized command line option)' $1; then
- reason="new_compiler_error"; tag="newgcc"
-elif grep -qE '(syntax error before|ISO C\+\+ forbids|friend declaration|no matching function for call to|.main. must return .int.|invalid conversion from|cannot be used as a macro name as it is an operator in C\+\+|is not a member of type|after previous specification in|no class template named|because worst conversion for the former|better than worst conversion|no match for.*operator|no match for call to|undeclared in namespace|is used as a type, but is not|error: array bound forbidden|error: class definition|error: expected constructor|error: there are no arguments|error:.*cast.*loses precision|ISO C\+\+ does not support)' $1; then
- reason="bad_C++_code"; tag="badc++"
-elif grep -qE '(/usr/libexec/elf/ld: cannot find|undefined reference to|cannot open -l.*: No such file)' $1; then
- reason="linker_error"; tag="ld"
-elif grep -qE 'chown:.*[Ii]nvalid argument' $1; then
- reason="chown"; tag="chown"
-#elif grep -qE 'cp:.*Invalid argument' $1; then
-# reason="munmap"; tag="munmap"
-elif grep -q 'install: .*: No such file' $1; then
- if grep -q 'install: /usr/local/www/cgi-bin.*No such file or directory' $1; then
- reason="cgi-bin"; tag="cgi-bin"
- else
- reason="install_error"; tag="install"
- fi
-elif grep -q "/usr/.*/man/.*: No such file or directory" $1; then
- reason="manpage"; tag="manpage"
-elif grep -qE "(Can't|unable to) open display" $1; then
- reason="DISPLAY"; tag="display"
-elif grep -q "conflicts with installed package" $1; then
- reason="depend_object"; tag="dependobj"
-elif grep -q " is already installed - perhaps an older version" $1; then
- reason="depend_object"; tag="dependobj"
-elif grep -q "You may wish to ..make deinstall.. and install this port again" $1; then
- reason="depend_object"; tag="dependobj"
-elif grep -q "error in dependency .*, exiting" $1; then
- reason="depend_package"; tag="dependpkg"
-elif grep -q "core dumped" $1; then
- reason="coredump"; tag="coredump"
-elif grep -q "Segmentation fault" $1; then
- reason="segfault"; tag="segfault"
-elif grep -q "initializer element is not constant" $1; then
- reason="stdio"; tag="stdio"
-elif grep -q "structure has no member named" $1; then
- reason="struct_changes"; tag="struct"
-elif grep -q "Error: alignment not a power of 2" $1; then
- reason="alignment"; tag="alignment"
-elif grep -qE "bin.apxs:(.)(not found|No such file or directory)" $1; then
- reason="apxs"; tag="apxs"
-elif grep -qE "failed to exec .*bin/apxs" $1; then
- reason="apxs"; tag="apxs"
-elif grep -q ".s: Assembler messages:" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "Cannot (determine .* target|find the byte order) for this architecture" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "^cc1: bad value.*for -mcpu.*switch" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "^cc1: invalid option " $1; then
- reason="arch"; tag="arch"
-elif grep -q "could not read symbols: File in wrong format" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "[Ee]rror: [Uu]nknown opcode" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "error.*Unsupported architecture" $1; then
- reason="arch"; tag="arch"
-elif grep -q "ENDIAN must be defined 0 or 1" $1; then
- reason="arch"; tag="arch"
-elif grep -q "failed to merge target-specific data" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "(file not recognized|failed to set dynamic section sizes): File format not recognized" $1; then
- reason="arch"; tag="arch"
-elif grep -q "impossible register constraint" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "inconsistent operand constraints in an .asm" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "Invalid configuration.*unknown.*machine.*unknown not recognized" $1; then
- reason="arch"; tag="arch"
-elif grep -q "invalid lvalue in asm statement" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "is only for.*, and you are running" $1; then
- reason="arch"; tag="arch"
-elif grep -q "not a valid 64 bit base/index expression" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "relocation R_X86_64_32.*can not be used when making a shared object" $1; then
- reason="arch"; tag="arch"
-elif grep -q "relocation truncated to fit: " $1; then
- reason="arch"; tag="arch"
-elif grep -q "shminit failed: Function not implemented" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "The target cpu, .*, is not currently supported." $1; then
- reason="arch"; tag="arch"
-elif grep -q "This architecture seems to be neither big endian nor little endian" $1; then
- reason="arch"; tag="arch"
-elif grep -q "unknown register name" $1; then
- reason="arch"; tag="arch"
-elif grep -q "Unable to correct byte order" $1; then
- reason="arch"; tag="arch"
-elif grep -q "Unsupported platform, sorry" $1; then
- reason="arch"; tag="arch"
-elif grep -q "won't run on this architecture" $1; then
- reason="arch"; tag="arch"
-elif grep -qE "#error .Cannot compile:" $1; then
- reason="assert"; tag="assert"
-elif grep -qE "autoconf(.*): not found" $1; then
- reason="autoconf"; tag="autoconf"
-elif grep -qE "autoconf(.*): No such file or directory" $1; then
- reason="autoconf"; tag="autoconf"
-elif grep -q "autoheader: not found" $1; then
- reason="autoheader"; tag="autoheader"
-elif grep -qE "automake(.*): not found" $1; then
- reason="automake"; tag="automake"
-elif grep -q "/usr/local/www/cgi-bin does not exist" $1; then
- reason="cgi-bin"; tag="cgi-bin"
-elif grep -q "Shared object \"libc.so.6\" not found, required by" $1; then
- reason="compat6x"; tag="compat6x"
-elif grep -q "Cannot open /dev/tty for read" $1; then
- reason="DISPLAY"; tag="display"
-elif grep -q "RuntimeError: cannot open display" $1; then
- reason="DISPLAY"; tag="display"
-elif grep -q "You must run this program under the X-Window System" $1; then
- reason="DISPLAY"; tag="display"
-elif grep -qE "Member name contains .\.\." $1; then
- reason="fetch"; tag="fetch"
-elif grep -q "fetch: transfer timed out" $1; then
- reason="fetch_timeout"; tag="fetch-timeout"
-elif grep -q "fetch: transfer timed out" $1; then
- reason="fetch_timeout"; tag="fetch-timeout"
-elif grep -q 'Run-time system build failed for some reason' $1; then
- reason="install_error"; tag="install"
-elif grep -q 'tar: Error opening archive: Failed to open.*No such file or directory' $1; then
- reason="install_error"; tag="install"
-elif grep -q "cc: .*libintl.*: No such file or directory" $1; then
- reason="linker_error"; tag="ld"
-elif grep -qE "cc: ndbm\.so: No such file or directory" $1; then
- reason="linker_error"; tag="ld"
-elif grep -q "error: The X11 shared library could not be loaded" $1; then
- reason="linker_error"; tag="ld"
-elif grep -q "libtool: link: cannot find the library" $1; then
- reason="linker_error"; tag="ld"
-elif grep -q "relocation against dynamic symbol" $1; then
- reason="linker_error"; tag="ld"
-elif grep -q "Shared object.*not found, required by" $1; then
- reason="linker_error"; tag="ld"
-elif grep -q "Could not create Makefile" $1; then
- reason="makefile"; tag="makefile"
-elif grep -v "regression-test.continuing" $1 | grep -qE "make.*(cannot open [Mm]akefile|don.t know how to make|fatal errors encountered|No rule to make target|built-in)"; then
- reason="makefile"; tag="makefile"
-elif grep -qE "(Error: mtree file ./etc/mtree/BSD.local.dist. is missing|error in pkg_delete|filesystem was touched prior to .make install|list of files present before this port was installed|list of filesystem changes from before and after)" $1; then
- reason="mtree"; tag="mtree"
-elif grep -qE "cp:.*site_perl: No such file or directory" $1; then
- reason="perl"; tag="perl"
-elif grep -q "Perl .* required--this is only version" $1; then
- reason="perl"; tag="perl"
-elif grep -q 'BEGIN failed--compilation aborted at ..Makefile.PL line' $1; then
- reason="perl5"; tag="perl5"
-elif grep -q "Abort trap" $1; then
- reason="process_failed"; tag="process"
-elif grep -q "Bus error" $1; then
- reason="process_failed"; tag="process"
-elif grep -q "Signal 11" $1; then
- reason="process_failed"; tag="process"
-elif grep -q "python: not found" $1; then
- reason="python"; tag="python"
-elif grep -q ': The -pthread option is deprecated' $1; then
- reason="threads"; tag="threads"
-elif grep -q "Error: pthreads are required to build this package" $1; then
- reason="threads"; tag="threads"
-elif grep -q "Please install/update your POSIX threads (pthreads) library" $1; then
- reason="threads"; tag="threads"
-elif grep -qE "requires.*thread support" $1; then
- reason="threads"; tag="threads"
-elif grep -q "/usr/bin/ld: cannot find -lpthread" $1; then
- reason="threads"; tag="threads"
-elif grep -q "/usr/bin/ld: cannot find -lXThrStub" $1; then
- reason="threads"; tag="threads"
-elif grep -q "<varargs.h> is obsolete with this version of GCC" $1; then
- reason="varargs"; tag="varargs"
-
-# Although these can be fairly common, and thus in one sense ought to be
-# earlier in the evaluation, in practice they are most often secondary
-# types of errors, and thus need to be evaluated after all the specific
-# cases.
-
-elif grep -qE '(gmake:.*Error [12]|tar: Error exit delayed from previous errors)' $1; then
- reason="install_error"; tag="install"
-elif grep -q "Cannot stat: " $1; then
- reason="configure_error"; tag="configure"
-elif grep -q "/usr/bin/ld: cannot find -l" $1; then
- reason="linker_error"; tag="ld"
-elif grep -q "cd: can't cd to" $1; then
- reason="NFS"; tag="nfs"
-elif grep -q "pkg_create: make_dist: tar command failed with code" $1; then
- reason="PLIST"; tag="plist"
-
-else
- reason="???"; tag="unknown"
-fi
-
-# XXX MCL perhaps segfault, coredump should be unified into process failed?
-
-# clean up some error cases -- the way .logs works, it expects that
-# every field in it MUST be nonblank, so we insert a metatoken here.
-# See below.
-if [ -z "$dir" ]; then
- dir="NONE"
-fi
-if [ -z "$maintainer" ]; then
- maintainer="NONE"
-fi
-if [ -z "$datetime" ]; then
- datetime="NONE"
-fi
-
-broken="no"
-if grep -q "Trying build of .* even though it is marked BROKEN" $1; then
- broken="broken"
-fi
-
-echo "$filename|$portname|$affected|$logsize|$dir|$maintainer|$reason|$tag|$broken|$datetime|$errordir"
--- Tools/portbuild/scripts/claim-chroot
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-
-# usage: claim-chroot ${arch} ${branch} ${pkgname}
-
-# This script cannot output anything except the name of the successfully
-# claimed chroot. In case of error, just exit.
-
-# XXX Return the string "chroot=*" and look for that in pdispatch to make
-# this more robust
-
-# configurable variables
-pb=/var/portbuild
-
-arch=$1
-shift
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/${arch}/portbuild.$(hostname)
-. ${pb}/scripts/buildenv
-
-buildroot=${scratchdir}
-
-branch=$1
-shift
-
-buildenv ${pb} ${arch} ${branch}
-
-pkgname=$(basename $1 ${PKGSUFFIX})
-
-chrootdir=${buildroot}/${branch}/chroot
-
-# Perform initial sanity check
-
-if [ ! -z "${squid_dir}" ]; then
- /usr/local/sbin/squid -k check 2> /dev/null
- status=$?
- if [ "${status}" != "0" ]; then
- touch ${scratchdir}/.squid
- /usr/local/etc/rc.d/squid start > /dev/null &
- exit 1
- else
- rm -f ${scratchdir}/.squid
- fi
-fi
-
-# Check for enough disk space
-df=$(df -k ${scratchdir} | tail -1 | awk '{print $4}')
-
-if [ ${df} -lt 102400 ]; then
- touch ${scratchdir}/.disk
- exit 1
-else
- rm -f ${scratchdir}/.disk
-fi
-
-found=0
-# Look for pre-existing chroot directories that are populated and unused
-for dir in ${chrootdir}/*; do
- if [ -f ${dir}/.ready -o -f ${dir}/.dirty ]; then
- # Atomically claim the directory
- mkdir ${dir}/used 2>/dev/null || continue
- touch ${dir}/used/${pkgname}
- if [ -f ${dir}/.dirty ]; then
- ${pb}/scripts/clean-chroot ${arch} ${branch} ${dir} 2 &
- continue
- fi
- found=1
- chroot=${dir}
- break
- fi
-done
-
-chrootnum=$$
-# If we didn't find a pre-existing directory, create and claim a new one.
-while [ ${found} != 1 ]; do
- if [ "${use_md_swap}" = "1" ]; then
- unit=$(mdconfig -a -t swap -s ${md_size})
- newfs /dev/${unit} > /dev/null
- chrootnum=$(echo ${unit} | sed 's,md,,')
- chroot=${chrootdir}/${chrootnum}
- mkdir -p ${chroot}/used 2>/dev/null || continue
- # Need to make sure that used/ is also present after mounting the fresh md so as to not leave open any races
- mount -o async /dev/${unit} ${chroot}/used
- mkdir ${chroot}/used/used
- touch ${chroot}/used/used/${pkgname}
- umount ${chroot}/used
- mount -o async /dev/${unit} ${chroot}/
- else
- chrootnum=$(($chrootnum+1))
- chroot=${chrootdir}/${chrootnum}
- mkdir -p ${chroot} 2>/dev/null || continue
- mkdir ${chroot}/used 2>/dev/null || continue
- fi
- touch ${chroot}/used/${pkgname}
- touch ${chroot}/.notready
- found=1
-done
-
-echo ${chroot}
--- Tools/portbuild/scripts/cppackages
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-# configurable variables
-pb=/var/portbuild
-
-. ${pb}/portbuild.conf
-
-lock=${pb}/cppackages.lock
-
-unset DISPLAY
-
-echo "Subject: package copying logs"
-echo
-echo "Called with arguments: "${1+"$@"}
-echo "Started at $(date)"
-
-if [ $# != 1 ]; then
- echo "usage: $0 branch"
- exit 1
-fi
-
-if [ -e ${lock} ]; then
- echo "Skipped since lock file exists"
- exit 1
-fi
-
-touch ${lock}
-
-cd $pb
-tar -cf - $1/packages | ssh $ftpsite -l $user tar -C $packagedir -xvf - 2>&1 | tail -100
-
-echo "Ended at $(date)"
-
-rm -f ${lock}
--- Tools/portbuild/scripts/showrunning
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/Tools/portbuild/scripts/showrunning,v 1.2 2006/07/09 19:02:14 linimon Exp $
-#
-# show currently running builds in terse format
-#
-ps axww | \
- grep "/var/portbuild/scripts/pdispatch" | \
- grep -v "grep /var/portbuild/scripts/pdispatch" | \
- sed -e "s at .*pdispatch @@;s@/var/portbuild/scripts/portbuild .*/usr/ports/@@;s@^ @@g;s@ @-@" | \
- sort
--- Tools/portbuild/scripts/reportload.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# For use on the client. Start the load reporting service at system
-# boot time.
-
-if [ "$1" != "start" ]; then exit; fi
-
-pb=/var/portbuild
-arch=$(cat /etc/arch)
-s=$pb/scripts/reportload
-
-if [ -x $s ]; then
- $s ${arch} &
- echo -n ' reportload'
-fi
--- Tools/portbuild/scripts/flushsquid
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-arch=$(cat /etc/arch)
-pb=/var/portbuild
-. ${pb}/${arch}/portbuild.conf
-
-host=$(hostname)
-test -f ${pb}/${arch}/portbuild.${host} && . ${pb}/${arch}/portbuild.${host}
-
-if [ ! -z "${squid_dir}" ] ; then
- /usr/local/etc/rc.d/squid stop
- /usr/local/etc/rc.d/squid poll
- echo "" > ${squid_dir}/cache/swap.state
- /usr/local/etc/rc.d/squid start
-fi
--- Tools/portbuild/scripts/buildenv
+++ /dev/null
@@ -1,102 +0,0 @@
-# Set up the build variables which are used by a given build
-#
-# Code fragment used by other scripts for commonality
-
-buildenv () {
- pb=$1
- arch=$2
- branch=$3
-
- export X11BASE=/usr/X11R6
- export LOCALBASE=/usr/local
- case "x$branch" in
- x4)
- export PKGSUFFIX=.tgz
- export PKGZIPCMD=gzip
- export INDEXFILE=INDEX
- export X_WINDOW_SYSTEM=xfree86-4
- ;;
- x4-exp)
- export PKGSUFFIX=.tgz
- export PKGZIPCMD=gzip
- export PORTS_AUDIT=1
- export INDEXFILE=INDEX
- export X_WINDOW_SYSTEM=xfree86-4
- ;;
- x5)
- export PKGSUFFIX=.tbz
- export PKGZIPCMD=bzip2
- export INDEXFILE=INDEX-5
- export X_WINDOW_SYSTEM=xorg
- ;;
- x5-exp)
- export PKGSUFFIX=.tbz
- export PKGZIPCMD=bzip2
- export INDEXFILE=INDEX-5
- export X_WINDOW_SYSTEM=xorg
- ;;
- x6)
- export PKGSUFFIX=.tbz
- export PKGZIPCMD=bzip2
- export INDEXFILE=INDEX-6
- export X_WINDOW_SYSTEM=xorg
- ;;
- x6-exp)
- export PKGSUFFIX=.tbz
- export PKGZIPCMD=bzip2
- export INDEXFILE=INDEX-6
- export X_WINDOW_SYSTEM=xorg
- ;;
- x7)
- export PKGSUFFIX=.tbz
- export PKGZIPCMD=bzip2
- export INDEXFILE=INDEX-7
- export X_WINDOW_SYSTEM=xorg
- ;;
- *)
- echo "buildenv: invalid branch"
- exit 1
- ;;
- esac
-
- export ARCH=${arch}
- export MACHINE_ARCH=${arch}
-
- # Have to use realpath because 'make index' doesn't deal with symlinks in PORTSDIR
- # - kk 020311
- export PORTSDIR=$(realpath ${pb}/${arch}/${branch}/ports)
- export SRCBASE=$(realpath ${pb}/${arch}/${branch}/src)
- export SRCPREFIX=${SRCBASE} #XXX Which one is canonical?
-
- export OSVERSION=$(awk '/^#define __FreeBSD_version/ {print $3}' < ${SRCBASE}/sys/sys/param.h)
- export OSREL=$(awk 'BEGIN {FS="\""}; /^REVISION/ {print $2}' < ${SRCBASE}/sys/conf/newvers.sh)
- export BRANCH=$(awk 'BEGIN {FS="\""}; /^BRANCH/ {print $2}' < ${SRCBASE}/sys/conf/newvers.sh)
-
- export __MAKE_CONF=${pb}/${arch}/make.conf
-
- export DISTDIR=${pb}/${arch}/${branch}/distfiles
- export PACKAGES=${pb}/${arch}/${branch}/packages
-
- # Don't pick up host OPTIONS
- export PORT_DBDIR=/nonexistent
-
- export UNAME_m=${ARCH}
- export UNAME_n=freebsd.org
- export UNAME_p=${ARCH}
- export UNAME_r=${OSREL}-${BRANCH}
- export UNAME_s=FreeBSD
- export UNAME_v="FreeBSD ${OSREL}-${BRANCH} #0: $(date) kris at freebsd.org:/usr/src/sys/magic/kernel/path"
-
- export BATCH=1
- export PACKAGE_BUILDING=1
-
- export USA_RESIDENT=yes
-
- # Old and mouldy?
- export PORTOBJFORMAT=elf
- export PARALLEL_PACKAGE_BUILD=1
- export HAVE_MOTIF=1
-
- export FTP_PASSIVE_MODE=yes
- #export FETCH_BEFORE_ARGS=-vvv
-}
--- Tools/portbuild/scripts/keeprestr
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-arch=$1
-branch=$2
-
-cd /var/portbuild/${arch}/${branch}
-
-rm -rf bak/restricted
-mkdir -p bak/restricted
-
-tar cvf - `tr ';' '\n' < restricted.sh | grep "/bin/rm -f" | awk '{print $3}' | grep packages/ | sed -e "s,/var/portbuild/${arch}/${branch}/,," -e 's,)$,,' ` | tar xfCP - bak/restricted/
--- Tools/portbuild/scripts/buildscript
+++ /dev/null
@@ -1,420 +0,0 @@
-#!/bin/sh
-
-# usage: $0 DIRNAME PHASE
-# PHASE is 1 (checksum) or 2 (package)
-
-mountprocfs() {
- arch=$1
-
- if [ ${arch} = "i386" -o ${arch} = "amd64" ]; then
- # JDK ports need linprocfs :(
- mkdir -p /compat/linux/proc
- mount_linprocfs linprocfs /compat/linux/proc
- fi
-}
-
-umountprocfs() {
- arch=$1
-
- if [ ${arch} = "i386" -o ${arch} = "amd64" ]; then
- umount -f /compat/linux/proc 2> /dev/null > /dev/null
- fi
-}
-
-cleanup() {
- status=$1
-
- # Don't keep distfiles if 'make checksum' failed
- if [ ${status} -ne 1 ]; then
- cd ${dir}
- keep_distfiles=$(make -V ALWAYS_KEEP_DISTFILES)
- distdir=$(make -V DISTDIR)
- if [ -z "${keep_distfiles}" -a ! -z "${distdir}" ]; then
- rm -rf ${distdir}/*
- fi
- fi
-
- if [ -e ${dir}/.keep ]; then
- cd ${dir}
- objdir=$(make -V WRKDIR)
- tar cfjC /tmp/work.tbz ${objdir}/.. work
- fi
-
- if [ ${status} -gt 0 ]; then
- cat /tmp/make.log${status}
- fi
-
- echo 1 > /tmp/status
- touch /.dirty
- echo "================================================================"
- echo -n "build of ${dir} ended at "
- date
-
- exit 0
-}
-
-add_pkg() {
- pkgs=$*
-
- echo add_pkg $pkgs
- cd /tmp/depends
- export PKG_PATH=/tmp/depends
- if [ ! -z "${pkgs}" ]; then
- arch=$(uname -m)
- umountprocfs ${arch}
- echo "adding dependencies"
- for i in $pkgs; do
- echo "pkg_add $i"
- base=$(basename $i .tgz)
- base=$(basename $base .tbz)
- if pkg_info -q -e $base; then
- echo "skipping $base, already added"
- else
- if ! pkg_add $i; then
- echo "error in dependency $i, exiting"
- cleanup 0
- fi
- fi
- done
- mountprocfs ${arch}
- fi
-}
-
-del_pkg() {
- pkgs=$*
-
- cd /tmp/depends
- export PKG_PATH=/tmp/depends
- if [ ! -z "${pkgs}" ]; then
- recursion=1
- dellist=""
- while [ $recursion -eq 1 ]; do
- unset delpkg nextpkg
- recursion=0
- for i in $pkgs; do
- base=$(basename $i .tgz)
- base=$(basename $base .tbz)
- if [ -s /var/db/pkg/${base}/+REQUIRED_BY ]; then
- recursion=1
- nextpkg="${base} ${nextpkg}"
- elif [ -d /var/db/pkg/${base}/ ]; then
- delpkg="${base} ${delpkg}"
- fi
- done
- pkgs="${nextpkg}"
- if [ "$dellist" != "" -a "$dellist" = "$delpkg" ]; then
- echo "deleted list =\""$dellist"\", packages to delete ="\"$delpkg\"
- echo "The following packages were left behind (perhaps your dependency list is incomplete):"
- ls /var/db/pkg
- echo "error in pkg_delete, exiting"
- cleanup 0
- else
- for j in ${delpkg}; do
- echo "Deleting ${j}"
- if ! (pkg_delete -f $j); then
- echo "--> error in pkg_delete, exiting"
- cleanup 0
- fi
- done
- dellist=$delpkg
- fi
- done
- fi
-}
-
-dir=$1
-phase=$2
-
-ED=$3
-PD=$4
-FD=$5
-BD=$6
-RD=$7
-
-export PATH=/pkg/libexec/ccache/:$PATH
-export CCACHE_PATH=/usr/bin:/usr/local/bin
-export MALLOC_OPTIONS=AJ
-
-L=`echo ${LOCALBASE} | sed 's,^/,,'`
-X=`echo ${X11BASE} | sed 's,^/,,'`
-
-if [ $phase = 1 ]; then
-
- cd $dir || exit 1
- echo "maintained by: $(make maintainer)"
- echo "port directory: ${dir}"
- echo "build started at $(date)"
-
- echo "FETCH_DEPENDS=${FD}"
- echo "PATCH_DEPENDS=${PD}"
- echo "EXTRACT_DEPENDS=${ED}"
- echo "BUILD_DEPENDS=${BD}"
- echo "RUN_DEPENDS=${RD}"
-
- echo "prefixes: LOCALBASE=${L} X11BASE=${X}"
-
- #Allow ports to notice they're being run on bento
- export PACKAGE_BUILDING=1
-
- # Files we do not care about changing between pre-build and post-cleanup
- cat > /tmp/mtree.preexclude <<EOF
-./root/*
-./var/*
-./tmp/*
-./etc/make.conf.bak
-./etc/make.conf
-./work/*
-./compat/linux/proc
-./usr/share/man/cat*/*
-./usr/local/etc/apache
-./usr/local/etc/apache2
-./usr/local/news
-./usr/local/share/xml
-EOF
- # Record a "pristine" mtree.
- mtree -X /tmp/mtree.preexclude -xcn -k uid,gid,mode -p / > /tmp/mtree.pristine
-
- add_pkg $FD
-
- cd $dir || exit 1
- pkgname=$(make package-name)
- echo "================================================================"
- echo "====================<phase 1: make checksum>===================="
-
- if /pnohang $TIMEOUT /tmp/make.log1 ${pkgname} make checksum; then
- cat /tmp/make.log1
- echo "0" > /tmp/status
- else
- cleanup 1
- fi
-
-else
-
- cd $dir || exit 1
- pkgname=$(make package-name)
-
- echo "================================================================"
- echo "====================<phase 2: make extract>===================="
-
- add_pkg ${ED}
- cd $dir
- /pnohang $TIMEOUT /tmp/make.log2 ${pkgname} make extract || cleanup 2
- cat /tmp/make.log2
- del_pkg ${ED}
-
- # Fetch depends still need to be here for 'make extract' since that target
- # always reruns 'make fetch' due to the lack of fetch cookie (and no place
- # to put it since WRKDIR isn't created by 'make fetch')
- del_pkg $FD
-
- echo "================================================================"
- echo "====================<phase 3: make patch>===================="
- add_pkg ${PD}
- cd $dir
- /pnohang $TIMEOUT /tmp/make.log3 ${pkgname} make patch || cleanup 3
- cat /tmp/make.log3
- del_pkg ${PD}
-
- echo "================================================================"
- echo "====================<phase 4: make build>===================="
-
- add_pkg ${BD}
-
- # Files we do not care about changing between pre-build and post-cleanup
- cat > /tmp/mtree.buildexclude <<EOF
-./var/log/*
-./tmp/*
-./work/*
-./compat/linux/proc
-./root/*
-./var/mail/*
-./var/tmp/*
-./usr/share/man/cat*/*
-./usr/local/etc/apache
-./usr/local/etc/apache2
-./usr/local/news
-./usr/local/share/xml
-EOF
- # Record a "pristine" mtree.
- mtree -X /tmp/mtree.buildexclude -xcn -k uid,gid,mode -p / > /tmp/mtree.prebuild
-
- xvfb=0
- if which -s Xvfb; then
- xvfb=1
- pid=$(echo $$ % 32768 | bc)
- X11BASE=$(which Xvfb | sed -e 's./bin/Xvfb..')
- Xvfb :${pid} -fp ${X11BASE}/lib/X11/fonts/misc &
- DISPLAY=:${pid}
- export DISPLAY
- fi
-
- cd $dir
- /pnohang $TIMEOUT /tmp/make.log4 ${pkgname} make build || cleanup 4
- cat /tmp/make.log4
-
- echo "================================================================"
- echo "====================<phase 5: make test>===================="
- cd $dir
- /pnohang $TIMEOUT /tmp/make.log5 ${pkgname} make -k regression-test
- cat /tmp/make.log5
-
- mtree -X /tmp/mtree.buildexclude -x -f /tmp/mtree.prebuild -p / | egrep -v "^(${L}/var|${X}/lib/X11/xserver/SecurityPolicy|${L}/share/nls/POSIX|${L}/share/nls/en_US.US-ASCII|etc/services|compat |${X} |etc/manpath.config|etc/.*.bak|${L}/info/dir|${X}/lib/X11/fonts/.*/fonts\.|usr/(X11R6|local)/man/..( |/man. )|${X}/lib/X11/fonts/TrueType )" > /tmp/list.preinstall
-
- if [ -s /tmp/list.preinstall ]; then
- echo "================================================================"
- echo "Fatal error: filesystem was touched prior to 'make install' phase"
- cat /tmp/list.preinstall
- echo "================================================================"
- cleanup 0
- fi
-
- echo "================================================================"
- echo "====================<phase 6: make install>===================="
-
- add_pkg ${RD}
-
- cat > /tmp/mtree.exclude <<EOF
-./root/*
-./var/*
-./tmp/*
-./etc/make.conf.bak
-./etc/make.conf
-./work/*
-./compat/linux/proc
-EOF
- mtree -X /tmp/mtree.exclude -xcn -k uid,gid,mode -p / > /tmp/mtree
-
- cd $dir
- if /pnohang $TIMEOUT /tmp/make.log6 ${pkgname} make install; then
- cat /tmp/make.log6
- echo "0" > /tmp/status
- else
- cleanup 6
- fi
-
- echo "================================================================"
- echo "====================<phase 7: make package>===================="
- cd $dir
- if /pnohang $TIMEOUT /tmp/make.log7 ${pkgname} make package; then
- cat /tmp/make.log7
- echo "0" > /tmp/status
- prefix=$(make -V PREFIX)
- del_pkg ${pkgname}
- else
- cleanup 7
- fi
-
- mtree -X /tmp/mtree.exclude -x -f /tmp/mtree -p / | egrep -v "^(${L}/var|${X}/lib/X11/xserver/SecurityPolicy|${L}/share/nls/POSIX|${L}/share/nls/en_US.US-ASCII|etc/services|compat |${X} |etc/manpath.config|etc/.*.bak|${L}/info/dir|${X}/lib/X11/fonts/.*/fonts\.|usr/(X11R6|local)/man/..( |/man. )|${X}/lib/X11/fonts/TrueType )" > /tmp/list3
-
- # Compare the state of the filesystem now to before the 'make install' phase
- dirty=0
- if [ -s /tmp/list3 ]; then
- cd /
- grep ' extra$' /tmp/list3 | awk '{print $1}' | xargs -J % find % -ls > /tmp/list4
- grep ' missing$' /tmp/list3 > /tmp/list5
- grep -vE ' (extra|missing)$' /tmp/list3 > /tmp/list6
- if [ "x${NOPLISTCHECK}" = "x" ]; then
- if grep -vqE "($X|$L)/etc/" /tmp/list4; then
- echo "1" > /tmp/status
- dirty=1
- fi
- if [ -s /tmp/list5 -o -s /tmp/list6 ]; then
- echo "1" > /tmp/status
- dirty=1
- fi
- fi
- echo "================================================================"
- fi
-
- echo
- echo "=== Checking filesystem state"
-
- if [ -s /tmp/list4 ]; then
- echo "list of extra files and directories in / (not present before this port was installed but present after it was deinstalled)"
- cat /tmp/list4
- fi
- if [ -s /tmp/list5 ]; then
- echo "list of files present before this port was installed but missing after it was deinstalled)"
- cat /tmp/list5
- fi
- if [ -s /tmp/list6 ]; then
- echo "list of filesystem changes from before and after port installation and deinstallation"
- cat /tmp/list6
- fi
- if [ "${dirty}" = 1 ]; then
- cleanup 0
- fi
-
- # BUILD_DEPENDS and RUN_DEPENDS are both present at install-time (e.g. gmake)
- # Concatenate and remove duplicates
- BRD=$(echo $BD $RD | tr ' ' '\n' | sort -u | tr '\n' ' ')
- del_pkg ${BRD}
- cd /var/db/pkg
- if [ $(echo $(echo * | wc -c)) != 2 ]; then
- echo "leftover packages:" *
- del_pkg *
- echo "1" > /tmp/status
- cleanup 0
- fi
-
- # Compare the state of the filesystem now to clean system (should again be clean)
- mtree -X /tmp/mtree.preexclude -x -f /tmp/mtree.pristine -p / | egrep -v "^(${L}/var|${X}/lib/X11/xserver/SecurityPolicy|${L}/share/nls/POSIX|${L}/share/nls/en_US.US-ASCII|etc/services|compat |${X} |etc/manpath.config|etc/.*.bak|${L}/info/dir|${X}/lib/X11/fonts/.*/fonts\.|usr/(X11R6|local)/man/..( |/man. )|${X}/lib/X11/fonts/TrueType )" > /tmp/list3
-
- echo
- echo "=== Checking filesystem state after all packages deleted"
-
- if [ -s /tmp/list3 ]; then
- cd /
- grep ' extra$' /tmp/list3 | awk '{print $1}' | xargs -J % find % -ls > /tmp/list4
- grep ' missing$' /tmp/list3 > /tmp/list5
- grep -vE ' (extra|missing)$' /tmp/list3 > /tmp/list6
- if [ "x${NOPLISTCHECK}" = "x" ]; then
- if grep -vqE "($X|$L)/etc/" /tmp/list4; then
- #echo "1" > /tmp/status
- fi
- if [ -s /tmp/list5 ]; then
- #echo "1" > /tmp/status
- fi
- fi
- echo "================================================================"
-
- if [ -s /tmp/list4 ]; then
- echo "list of extra files and directories in / (not present on clean system but present after everything was deinstalled)"
- cat /tmp/list4
- touch /.dirty
- fi
- if [ -s /tmp/list5 ]; then
- echo "list of files present on clean system but missing after everything was deinstalled)"
- cat /tmp/list5
- touch /.dirty
- fi
- if [ -s /tmp/list6 ]; then
- echo "list of filesystem changes from before and after all port installation/deinstallation"
- cat /tmp/list6
- touch /.dirty
- fi
- fi
-
- if [ ${xvfb} = 1 ]; then
- kill $(jobid %1)
- fi
-
- cd ${dir}
- keep_distfiles=$(make -V ALWAYS_KEEP_DISTFILES)
- distdir=$(make -V DISTDIR)
- if [ -z "${keep_distfiles}" -a ! -z "${distdir}" ]; then
- rm -rf ${distdir}/*
- fi
-
- if [ -e ${dir}/.keep ]; then
- cd ${dir}
- objdir=$(make -V WRKDIR)
- tar cfjC /tmp/work.tbz ${objdir}/.. work
- fi
-
- echo "================================================================"
- echo -n "build of ${dir} ended at "
- date
-fi
-
-exit 0
--- Tools/portbuild/scripts/prunefailure
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Prune the failure files of stale entries
-#
-# This must be called via:
-#
-# lockf -k ${pb}/${arch}/${branch}/failure.lock ${pb}/scripts/prunefailure ${arch} ${branch}
-#
-# to avoid racing with any package builds in progress that might try to append to
-# these files.
-
-# configurable variables
-pb=/var/portbuild
-
-cleanup() {
- echo "Problem writing new failure file!"
- rm -f failure.new
- exit 1
-}
-
-if [ $# -ne 2 ]; then
- echo "prunefailure <arch> <branch>"
- exit 1
-fi
-
-arch=$1
-branch=$2
-shift 2
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-buildenv ${pb} ${arch} ${branch}
-
-home=${pb}/${arch}/${branch}
-cd $home
-
-pkgdir=$home/packages/All
-index=${PORTSDIR}/${INDEXFILE}
-
-if [ "`wc -l $index | awk '{print $1}'`" -lt 9000 ]; then
- echo "INDEX is corrupted, terminating!"
- exit 1
-fi
-
-echo "===> Pruning old failure file"
-
-rm -f failure.new
-IFS='|'
-while read dir name ver olddate date count; do
-
- if [ -z "$dir" -o -z "$name" -o -z "$ver" -o -z "$olddate" -o -z "$date" -o -z "$count" ]; then
- echo Malformed entry "$dir|$name|$ver|$olddate|$date|$count"
- # Clean up the 'latest error log' symlink
- rm -f ${pb}/${arch}/${branch}/latest/${dir}
- continue
- fi
-
- entry=$(grep "|/usr/ports/$dir|" $index)
- if [ -z "$entry" ]; then
- echo $dir not in index
- rm -f ${pb}/${arch}/${branch}/latest/${dir}
- continue
- fi
-
- newver=$(echo $entry | awk '{print $1}')
-
- if [ -e "$home/packages/All/$newver${PKGSUFFIX}" ]; then
- echo "$newver package exists, should not still be here!"
- rm -f ${pb}/${arch}/${branch}/latest/${dir}
- continue
- fi
-
- if grep -qxF $newver $home/duds.full; then
- echo "$newver listed in duds, should not be here"
- rm -f ${pb}/${arch}/${branch}/latest/${dir}
- continue
- fi
-
- (echo "$dir|$name|$newver|$olddate|$date|$count" >> $home/failure.new) || cleanup
-done < $home/failure
-
-mv failure.new failure
--- Tools/portbuild/scripts/comparelogs
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-# prints out logs that are in dir1 but not in dir2
-
-if [ $# -ne 3 ]; then
- echo "usage: $0 arch dir1 dir2"
- exit 1
-fi
-
-here=$(pwd)
-arch=$1
-dir1=$2
-dir2=$3
-fdir1=$here/${arch}-$dir1
-fdir2=$here/${arch}-$dir2
-ldir2=$(cd $fdir2; pwd | sed -e 's/e\./a./')
-
-of=$here/$arch-$dir1-$dir2.html
-
-echo "<html><head><title>Logs that are in $dir1 but not in $dir2</title>" >$of
-echo "<h1>Logs that are in $dir1 but not in $dir2</h1>" >>$of
-echo "</head><body>" >>$of
-
-cd $fdir1
-logs=$(find . -name \*.log -o -name \*.log.bz2 | sed -e 's/\.log\.bz2/\.log/g')
-nlogs=$(echo $logs | wc -w)
-
-if [ $nlogs -eq 0 ]; then
- echo "No errors" >>$of;
-else
- num=0
- echo "<table border=1>" >>$of
- echo "<tr><th>Log</th></tr>" >>$of
- for i in $logs; do
- if [ -f ${fdir2}/${i}.bz2 -o -f ${fdir2}/${i} ]; then
- # foo
- else
- fname1=$(basename $i .bz2)
- fname=$(basename $fname1 .log)
- echo -n "<tr><td>" >>$of
- echo -n "<a href=\"$arch-$dir1/index.html#$fname\">" >>$of
- echo -n $fname >>$of
- echo -n "</a>" >>$of
- echo "</td></tr>" >>$of
- num=$(($num + 1))
- fi
- done
- echo "</table><br>" >> $of
- echo "$num errors<br>" >> $of
-fi
-
-echo "<hr>" >> $of
-echo "<a href=\"../\">back to top</a>" >> $of
-
-echo "</body></html>" >>$of
--- Tools/portbuild/scripts/processfail
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-#
-# processfail <arch> <branch>
-
-arch=$1
-branch=$2
-
-pb=/var/portbuild
-
-of=/usr/local/www/data/errorlogs/.${arch}-${branch}-failure.html
-
-cd ${pb}/${arch}/${branch}
-
-if [ -e .newfailure.stamp -a $(echo $(find . -maxdepth 1 -newer .newfailure.stamp -name newfailure 2>&1 /dev/null | wc -l)) = "0" ]; then exit; fi
-
-touch .newfailure.stamp
-
-newfailure=${pb}/${arch}/${branch}/newfailure
-num=$(wc -l ${newfailure} | awk '{print $1}')
-
-header() {
- echo "<html><head><title>New package building errors</title>" >$of
- echo "</head><body><h1>New package building errors</h1>" >>$of
-
- if [ "$num" -eq "0" ]; then
- echo "No errors (yet)" >>$of
- else
- echo "<table border=1>" >>$of
- echo "<tr>$1</tr>" >>$of
- fi
-}
-
-footer() {
- echo "</table>" >>$of
- echo "</body>" >>$of
- echo "</html>" >>$of
-}
-
-#
-# Create "default" output, sorted on portname
-#
-header "<th>Port</th><th>Package</th><th>Broken</th><th>Last</th><th>#</th>"
-
-sort -r -n -k 4 -t \| failure > newfailure
-IFS='|'
-while read dir name ver date last count; do
- echo "<tr>" >> $of
- echo "<td><a href=\"http://cvsweb.freebsd.org/ports/$dir\">$dir</a></td>" >> $of
- if [ -L ${pb}/${arch}/${branch}/latest/${dir} ]; then
- err=$(readlink ${pb}/${arch}/${branch}/latest/${dir})
- echo "<td><a href=\"${arch}-errorlogs/$(basename $(dirname ${err}))/$(basename ${err})\">$ver</a></td>" >> $of
- else
- echo "<td><a href=\"${arch}-${branch}-latest/$ver.log\">$ver</a></td>" >> $of
- fi
-
-# echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
-# echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
-# echo "<td><a href=\"mailto:$6\">$6</a></td>" >> $of
-# echo "<td>" >> $of
-
- alphadate=$(date -jf %s ${date} "+%F %T")
- alphalast=$(date -jf %s ${last} "+%F %T")
- echo "<td>${alphadate}</td>" >> $of
- echo "<td>${alphalast}</td>" >> $of
- echo "<td>$count</td>" >> $of
-
- echo "</tr>" >> $of
-done < newfailure
-footer ""
-mv -f $of /usr/local/www/data/errorlogs/${arch}-${branch}-failure.html
--- Tools/portbuild/scripts/dopackages
+++ /dev/null
@@ -1,596 +0,0 @@
-#!/bin/sh
-
-# configurable variables
-pb=/var/portbuild
-
-arch=$1
-shift
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-status=${pb}/${arch}/status
-scripts=${pb}/scripts
-
-errorexit () {
- echo "$1" > ${status}
- exit $1
-}
-
-usage () {
- echo "usage: [-continue] [-incremental] [-restart] [-nofinish] [-finish] [-ftp] [-cdrom] [-nobuild] [-noindex] [-noduds] [-norestr] [-nocvs] [-noportscvs] [-noplistcheck] [-distfiles] [-fetch-original] [-trybroken] branch date"
- errorexit 1
-}
-
-# usage: makeindex pb arch scripts branch
-makeindex () {
- pb=$1
- arch=$2
- scripts=$3
- branch=$4
-
- cd ${pb}/${arch}/${branch}/ports
- echo "================================================"
- echo "generating index"
- echo "================================================"
- echo "index generation started at $(date)"
- ${scripts}/makeindex ${arch} ${branch} || errorexit 1
- echo "index generation ended at $(date)"
- echo $(wc -l <${INDEXFILE}) "lines in INDEX"
-}
-
-# usage: checkindex pb arch branch
-# Perform some sanity checks on the INDEX so we don't blow up later on
-checkindex () {
- pb=$1
- arch=$2
- branch=$3
-
- cd ${pb}/${arch}/${branch}/ports
- if grep -q non-existent ${INDEXFILE}; then
- echo "errors in INDEX:"
- grep -n non-existent ${INDEXFILE}
- errorexit 1
- fi
- if ! awk -F '|' '{if (NF != 13) { error=1; printf("line %d: %s\n", NR, $0)}} END {if (error == 1) exit(1)}' ${INDEXFILE}; then
- echo "error in INDEX"
- errorexit 1
- fi
-}
-
-# usage: makeduds pb arch scripts branch
-makeduds () {
- pb=$1
- arch=$2
- scripts=$3
- branch=$4
-
- cd ${pb}/${arch}/${branch}/ports
- echo "================================================"
- echo "generating duds"
- echo "================================================"
- echo "duds generation started at $(date)"
- if ! ${scripts}/makeduds ${arch} ${branch}; then
- echo "error(s) detected, exiting script at $(date). Failed duds list was:"
- cat ${pb}/${arch}/${branch}/duds
- errorexit 1
- fi
- echo "duds generation ended at $(date)"
- echo $(wc -l < ${pb}/${arch}/${branch}/duds) "items in duds"
- echo "duds diff:"
- diff ${pb}/${arch}/${branch}/duds.old ${pb}/${arch}/${branch}/duds
- cp -p ${pb}/${arch}/${branch}/duds ${pb}/${arch}/${branch}/duds.old
- cp -p ${pb}/${arch}/${branch}/duds ${pb}/${arch}/${branch}/duds.orig
-}
-
-# usage: restrictedlist pb scripts branch
-restrictedlist () {
- pb=$1
- arch=$2
- scripts=$3
- branch=$4
-
- cd ${pb}/${arch}/${branch}/ports
- echo "================================================"
- echo "creating restricted list"
- echo "================================================"
- echo "restricted list generation started at $(date)"
- ${scripts}/makerestr ${arch} ${branch} || errorexit 1
- echo "restricted list generation ended at $(date)"
- echo $(grep -c '^#' ${pb}/${arch}/${branch}/restricted.sh) "ports in ${pb}/${arch}/${branch}/restricted.sh"
-}
-
-# usage: cdromlist pb scripts branch
-cdromlist () {
- pb=$1
- branch=$2
- scripts=$3
- branch=$4
-
- cd ${pb}/${arch}/${branch}/ports
- echo "================================================"
- echo "creating cdrom list"
- echo "================================================"
- echo "cdrom list generation started at $(date)"
- make ECHO_MSG=/usr/bin/true clean-for-cdrom-list \
- | sed -e "s./usr/ports/distfiles/./distfiles/.g" \
- -e "s./usr/ports/./${branch}/.g" \
- > ${pb}/${arch}/${branch}/cdrom.sh
- echo "cdrom list generation ended at $(date)"
- echo $(grep -c '^#' ${pb}/${arch}/${branch}/cdrom.sh) "ports in ${pb}/${arch}/${branch}/cdrom.sh"
-}
-
-# usage: archiveports pb branch
-archiveports () {
- pb=$1
- arch=$2
- branch=$3
-
- echo "started archive of ${pb}/${arch}/${branch}/ports at $(date)"
- cd ${pb}/${arch}/${branch}
- tar --exclude CVS -czf ${pb}/${arch}/${branch}/tarballs/ports.tar.gz ports
- echo "ended archive of ${pb}/${arch}/${branch}/ports at $(date)"
-}
-
-# usage: generatemd5 pb branch
-generatemd5 () {
- pb=$1
- arch=$2
- branch=$3
-
- echo "started generating CHECKSUM.MD5 at $(date)"
- cd ${pb}/${arch}/${branch}/packages/All
- find . -name '*.t[bg]z' | sort | sed -e 's/^..//' | xargs md5 > CHECKSUM.MD5
- echo "ended generating CHECKSUM.MD5 at $(date)"
-}
-
-umask 002
-
-me=$(hostname)
-
-echo "Subject: $me package building logs"
-echo
-echo "Called with arguments: "${1+"$@"}
-echo "Started at $(date)"
-
-starttime=$(date +%s)
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
-
-if [ $# = 0 ]; then
- usage
-fi
-
-nobuild=0
-noindex=0
-noduds=0
-nocvs=0
-noportscvs=0
-norestr=0
-noplistcheck=0
-cdrom=0
-ftp=0
-restart=0
-cont=0
-finish=0
-nofinish=0
-dodistfiles=0
-fetch_orig=0
-trybroken=0
-incremental=0
-
-# optional arguments
-while [ $# -gt 2 ]; do
- case "x$1" in
- x-nobuild)
- nobuild=1
- ;;
- x-noindex)
- noindex=1
- ;;
- x-noduds)
- noduds=1
- ;;
- x-cdrom)
- cdrom=1
- ;;
- x-nocvs)
- nocvs=1
- ;;
- x-noportscvs)
- noportscvs=1
- ;;
- x-norestr)
- norestr=1
- ;;
- x-noplistcheck)
- noplistcheck=1
- ;;
- x-ftp)
- ftp=1
- ;;
- x-distfiles)
- dodistfiles=1
- ;;
- x-fetch-original)
- fetch_orig=1
- ;;
- x-trybroken)
- trybroken=1
- ;;
- x-continue)
- cont=1
- ;;
- x-restart)
- restart=1
- ;;
- x-nofinish)
- nofinish=1
- ;;
- x-finish)
- nobuild=1
- finish=1
- ;;
- x-incremental)
- incremental=1
- ;;
- *)
- usage
- ;;
- esac
- shift
-done
-
-if [ "$restart" = 1 -o "$cont" = 1 -o "$finish" = 1 ]; then
- skipstart=1
-else
- skipstart=0
-fi
-
-# mandatory arguments
-branch=$1
-date=$2
-
-if [ "x$branch" != x4 -a "x$branch" != x4-exp -a "x$branch" != x5 -a "x$branch" != x5-exp -a "x$branch" != x6 -a "x$branch" != x6-exp -a "x$branch" != x7 ]; then
- usage
-fi
-
-# Set up our environment variables
-buildenv ${pb} ${arch} ${branch}
-
-if [ "$dodistfiles" = 1 ]; then
- export WANT_DISTFILES=1
-fi
-
-if [ "$noplistcheck" = 1 ]; then
- export NOPLISTCHECK=1
-fi
-
-if [ "$cdrom" = 1 ]; then
- export FOR_CDROM=1
-fi
-
-if [ "$fetch_orig" = 1 ]; then
- export FETCH_ORIGINAL=1
-fi
-
-if [ "$trybroken" = 1 ]; then
- export TRYBROKEN=1
-fi
-
-# Start setting up build environment
-
-if [ "$incremental" = 1 ]; then
- cd ${PORTSDIR}
- cp ${INDEXFILE} ${INDEXFILE}.old
-fi
-
-if [ "$skipstart" = 0 ]; then
- if [ "$noportscvs" = 0 ]; then
- echo "================================================"
- echo "running cvs update -PAd on ${PORTSDIR}"
- echo "================================================"
- cd ${PORTSDIR}
- cvs -qR update -PAd
- # XXX Check for conflicts
- fi
- date > ${pb}/${arch}/${branch}/cvsdone
-
- if [ "$nocvs" = 0 ]; then
- echo "================================================"
- echo "running cvs update on ${SRCBASE}"
- echo "================================================"
- cd ${SRCBASE}
- cvs -qR update -Pd
- # XXX Check for conflicts
- fi
-
- echo "================================================"
- echo "running make checksubdirs"
- echo "================================================"
- cd ${PORTSDIR}
- make checksubdirs
-
- # this one not run in background to check return status
- if [ "$noduds" = 0 ]; then
- makeduds ${pb} ${arch} ${scripts} ${branch}
- fi
-
- echo "================================================"
- echo "pruning stale entries from the failed ports list"
- echo "================================================"
- # Adding BROKEN ports to duds causes this to remove everything from failure list
- #lockf -k ${pb}/${arch}/${branch}/failure.lock ${scripts}/prunefailure ${arch} ${branch}
-
- if [ "$noindex" = 0 ]; then
- makeindex ${pb} ${arch} ${scripts} ${branch}
- fi
- checkindex ${pb} ${arch} ${branch}
-fi
-
-if [ "$nobuild" = 0 -a "$finish" = 0 ]; then
- echo "================================================"
- echo "setting up nodes"
- echo "================================================"
- for node in $(cat ${pb}/${arch}/mlist); do
- ${scripts}/dosetupnode ${arch} ${branch} ${node} &
- done
-fi
-
-if [ "$skipstart" = 0 ]; then
- if [ "$norestr" = 0 ]; then
- restrictedlist ${pb} ${arch} ${scripts} ${branch} &
- fi
-
- if [ "$cdrom" = 1 ]; then
- cdromlist ${pb} ${arch} ${scripts} ${branch} &
- fi
-
- ${scripts}/makeparallel ${arch} ${branch}
-
- cd ${pb}/${arch}
- mkdir -p ${pb}/${arch}/${branch}/bak
- cd ${pb}/${arch}/${branch}/bak
- rm -rf errors logs packages old-errors
- cd ${pb}/${arch}/${branch}
- mv make.* tarballs/ports.tar.gz bak
-
- cd ${pb}/${arch}/${branch}
- cp -rp errors logs old-errors bak
-
- shortdate=$(echo ${date} | sed -e 's/..$//')
-
- if [ "$incremental" = 1 ]; then
- # need to preserve symlinks for packages
- #tar cf - packages | tar xfC - bak
-
- cd ${PORTSDIR}
-
- # Identify the ports that have changed and need to be removed before rebuilding
- cut -f 1,2,3,8,9,11,12,13 -d \| ${INDEXFILE}.old | sort > ${INDEXFILE}.old1
- cut -f 1,2,3,8,9,11,12,13 -d \| ${INDEXFILE} | sort > ${INDEXFILE}.1
- comm -2 -3 ${INDEXFILE}.old1 ${INDEXFILE}.1 | cut -f 1 -d \| > ${pb}/${arch}/${branch}/.oldports
-
- echo "Removing $(wc -l ${pb}/${arch}/${branch}/.oldports) packages in preparation for incremental build"
- rm ${INDEXFILE}.old1 ${INDEXFILE}.1
-
- cd ${PACKAGES}/All
- sed "s,$,${PKGSUFFIX}," ${pb}/${arch}/${branch}/.oldports | xargs rm -f
- ${scripts}/prunepkgs ${PORTSDIR}/${INDEXFILE} ${PACKAGES}
-
- cd ${pb}/${arch}/${branch}/errors/
- sed "s,\$,.log," ${pb}/${arch}/${branch}/.oldports | xargs rm -f
- sed "s,\$,.log.bz2," ${pb}/${arch}/${branch}/.oldports | xargs rm -f
- find . -name \*.log.bz2 | xargs bunzip2 -f
-
- cd ${pb}/${arch}/${branch}/logs/
- sed 's,$,.log,' ${pb}/${arch}/${branch}/.oldports | xargs rm -f
- sed 's,$,.log.bz2,' ${pb}/${arch}/${branch}/.oldports | xargs rm -f
- find . -name \*.log.bz2 | xargs bunzip2 -f
- else
- # need to preserve symlinks for packages
- #mv -f packages bak
-
- # Already copied the logs above
- rm -rf errors logs old-errors
-
- cd ${pb}/${arch}/${branch}
- mkdir -p packages/All
-
- rm -rf distfiles/
- mkdir -p distfiles/
-
- mkdir -p ${pb}/${arch}/archive/errorlogs
- rm -rf ${pb}/${arch}/archive/errorlogs/e.${branch}.${date} ${pb}/${arch}/archive/errorlogs/e.${branch}.${shortdate}
- mkdir -p ${pb}/${arch}/archive/errorlogs/e.${branch}.${date}
- ln -sf ${pb}/${arch}/archive/errorlogs/e.${branch}.${date} ${pb}/${arch}/${branch}/errors
- ln -sf e.${branch}.${date} ${pb}/${arch}/archive/errorlogs/e.${branch}.${shortdate}
- mkdir -p ${pb}/${arch}/${branch}/errors/old-errors
- rm -rf ${pb}/${arch}/archive/errorlogs/a.${branch}.${date} ${pb}/${arch}/archive/errorlogs/a.${branch}.${shortdate}
- mkdir -p ${pb}/${arch}/archive/errorlogs/a.${branch}.${date}
- ln -sf ${pb}/${arch}/archive/errorlogs/a.${branch}.${date} ${pb}/${arch}/${branch}/logs
- ln -sf a.${branch}.${date} ${pb}/${arch}/archive/errorlogs/a.${branch}.${shortdate}
-
- echo "error logs in ${pb}/${arch}/archive/errorlogs/e.${branch}.${date}"
- cp -p ${pb}/${arch}/${branch}/cvsdone ${pb}/${arch}/archive/errorlogs/e.${branch}.${date}/cvsdone
- cp -p ${pb}/${arch}/${branch}/cvsdone ${pb}/${arch}/archive/errorlogs/a.${branch}.${date}/cvsdone
- cp -p ${pb}/${arch}/${branch}/ports/${INDEXFILE} ${pb}/${arch}/archive/errorlogs/e.${branch}.${date}/INDEX
- cp -p ${pb}/${arch}/${branch}/ports/${INDEXFILE} ${pb}/${arch}/archive/errorlogs/a.${branch}.${date}/INDEX
-
- fi
-fi
-
-wait
-
-if [ "$nobuild" = 0 ]; then
- cd ${pb}/${arch}/${branch}
-
- if [ "$cont" = 1 ]; then
- find errors/ -name \*.log | sed -e 's,\.log$,,' -e 's,^errors/,,' >> duds.errors
- cat duds duds.errors | sort -u > duds.new
- mv duds.new duds
- else
- cp duds.orig duds
- fi
-
- count=0
- for i in `cat ${pb}/${arch}/mlist`; do
- . ${pb}/${arch}/portbuild.conf
- test -f ${pb}/${arch}/portbuild.${i} && . ${pb}/${arch}/portbuild.${i}
- count=$((${count}+${maxjobs}))
- done
- cd ${pb}/${arch}/${branch}/packages/All
- ln -sf ../../Makefile .
-
- echo "================================================"
- echo "building packages (phase 1)"
- echo "================================================"
- echo "started at $(date)"
- phase1start=$(date +%s)
- make -k -j$count quickports all > ../../make.0 2>&1 </dev/null
- echo "ended at $(date)"
- phase1end=$(date +%s)
- echo "phase 1 took $(date -u -j -r $(($phase1end - $phase1start)) | awk '{print $4}')"
- echo $(echo $(ls -1 ${pb}/${arch}/${branch}/packages/All | wc -l) - 2 | bc) "packages built"
- echo $(echo $(du -sk ${pb}/${arch}/${branch}/packages | awk '{print $1}') / 1024 | bc) "MB of packages"
- echo $(echo $(du -sk ${pb}/${arch}/${branch}/distfiles | awk '{print $1}') / 1024 | bc) "MB of distfiles"
-
- cd ${pb}/${arch}/${branch}
- if grep -qE '(ptimeout|pnohang): killing' make.0; then
- echo "The following port(s) timed out:"
- grep -E '(ptimeout|pnohang): killing' make.0 | sed -e 's/^.*ptimeout:/ptimeout:/' -e 's/^.*pnohang:/pnohang:/'
- fi
-
- ls -asFlrt ${pb}/${arch}/${branch}/packages/All > ${pb}/${arch}/${branch}/logs/ls-lrt-1
- cp -rp errors old-errors
- cd ${pb}/${arch}/${branch}/old-errors
- ${scripts}/processlogs
-
- echo "================================================"
- echo "setting up nodes"
- echo "================================================"
- for node in $(cat ${pb}/${arch}/mlist); do
- ${scripts}/dosetupnode ${arch} ${branch} ${node} -norsync &
- sleep 2
- done
-
- wait
-
- echo "setting up of nodes ended at $(date)"
-
- count=0
- for i in `cat ${pb}/${arch}/mlist`; do
- . ${pb}/${arch}/portbuild.conf
- test -f ${pb}/${arch}/portbuild.${i} && . ${pb}/${arch}/portbuild.${i}
- count=$((${count}+${maxjobs}))
- done
- cd ${pb}/${arch}/${branch}/packages/All
- echo "================================================"
- echo "building packages (phase 2)"
- echo "================================================"
- echo "started at $(date)"
- phase2start=$(date +%s)
- make -k -j$count quickports all > ../../make.1 2>&1 </dev/null
- echo "ended at $(date)"
- phase2end=$(date +%s)
- echo "phase 2 took $(date -u -j -r $(($phase2end - $phase2start)) | awk '{print $4}')"
-
- echo $(ls -1 ${pb}/${arch}/${branch}/packages/All | wc -l) "packages built"
- echo $(cat ${pb}/${arch}/${branch}/packages/INDEX | wc -l) "lines in INDEX"
- echo $(echo $(du -sk ${pb}/${arch}/${branch}/packages | awk '{print $1}') / 1024 | bc) "MB of packages"
- echo $(echo $(du -sk ${pb}/${arch}/${branch}/distfiles | awk '{print $1}') / 1024 | bc) "MB of distfiles"
-fi
-
-cd ${pb}/${arch}/${branch}
-if grep -qE '(ptimeout|pnohang): killing' make.1; then
- echo "The following port(s) timed out:"
- grep -E '(ptimeout|pnohang): killing' make.1 | sed -e 's/^.*ptimeout:/ptimeout:/' -e 's/^.*pnohang:/pnohang:/'
-fi
-
-# Clean up temporary duds file
-if [ "$cont" = 1 ]; then
- cp duds.orig duds
-fi
-
-cd ${pb}/${arch}/${branch}/packages/All
-if [ "$nofinish" = 0 ]; then
- rm -f Makefile
-
- # Always delete restricted packages/distfiles since they're published on the
- # website
- echo "deleting restricted ports"
- sh ${pb}/${arch}/${branch}/restricted.sh
-
- if [ "$cdrom" = 1 ]; then
- echo "deleting cdrom restricted ports"
- sh ${pb}/${arch}/${branch}/cdrom.sh
- fi
-
- # Remove packages not listed in INDEX
- ${scripts}/prunepkgs ${pb}/${arch}/${branch}/ports/${INDEXFILE} ${pb}/${arch}/${branch}/packages
-fi
-
-#rm -rf ${pb}/${arch}/${branch}/bad
-#mkdir -p ${pb}/${arch}/${branch}/bad
-#echo "checking packages"
-#for i in *${PKGSUFFIX}; do
-# if ! ${PKGZIPCMD} -t $i; then
-# echo "Warning: package $i is bad, moving to ${pb}/${arch}/${branch}/bad"
-# # the latest link will be left behind...
-# mv $i ${pb}/${arch}/${branch}/bad
-# rm ../*/$i
-# fi
-#done
-
-if [ "$nofinish" = 0 ]; then
- # Remove INDEX entries for packages that do not exist
- ${scripts}/chopindex ${pb}/${arch}/${branch}/ports/${INDEXFILE} ${pb}/${arch}/${branch}/packages > ${pb}/${arch}/${branch}/packages/INDEX
-
- cd ${pb}/${arch}/${branch}/old-errors
- for i in *.log; do
- cp -p ${i} ${pb}/${arch}/${branch}/errors/old-errors;
- done
-
- #archiveports ${pb} ${arch} ${branch} &
- generatemd5 ${pb} ${arch} ${branch} &
- wait
-
- ls -asFlrt ${pb}/${arch}/${branch}/packages/All > ${pb}/${arch}/${branch}/logs/ls-lrt
- cp -p ${pb}/${arch}/${branch}/make.[01] ${pb}/${arch}/${branch}/logs
-
- echo "================================================"
- echo "copying distfiles"
- echo "================================================"
- echo "started at $(date)"
- cd ${pb}/${arch}
- ${scripts}/dodistfiles ${pb}/${arch}/${branch}/distfiles
- rm -rf ${pb}/${arch}/${branch}/distfiles/.pbtmp
- rm -f ${pb}/${arch}/${branch}/distfiles/.done
-
- # Always delete restricted distfiles
- echo "deleting restricted distfiles"
- sh ${pb}/${arch}/${branch}/restricted.sh
-
- if [ "$cdrom" = 1 ]; then
- echo "deleting cdrom restricted distfiles"
- sh ${pb}/${arch}/${branch}/cdrom.sh
- fi
-
- if [ "$branch" != "4-exp" ]; then
- # Currently broken - kk
- #su ${user} -c "${scripts}/cpdistfiles ${branch} > ${pb}/${arch}/${branch}/cpdistfiles.log 2>&1 </dev/null" &
- if [ "$ftp" = 1 ]; then
- echo "ended at $(date)"
- echo "================================================"
- echo "copying packages"
- echo "================================================"
- ${scripts}/docppackages ${arch} ${branch}
- fi
- fi
-fi
-
-endtime=$(date +%s)
-echo "================================================"
-echo "all done at $(date)"
-echo "entire process took $(date -u -j -r $(($endtime - $starttime)) | awk '{print $4}')"
-echo "================================================"
--- Tools/portbuild/scripts/makeworld
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-
-pb=/var/portbuild
-
-if [ $# -lt 2 ]; then
- echo "usage: makeworld arch branch [args]"
- exit 1
-fi
-
-arch=$1
-branch=$2
-shift 2
-
-. ${pb}/${arch}/portbuild.conf
-
-export TARGET_ARCH=${arch}
-
-client=0
-nocvs=0
-
-# optional arguments
-while [ $# -gt 0 ]; do
- case "x$1" in
- x-client)
- client=1
- ;;
- x-nocvs)
- nocvs=1
- ;;
- *)
- break
- ;;
- esac
- shift
-done
-
-if [ "$client" = "1" ]; then
- cd ${pb}/${arch}/src-client
- shift 1
-else
- cd ${pb}/${arch}/${branch}/src
- export __MAKE_CONF=/dev/null
-fi
-
-if [ "$nocvs" = "0" ]; then
- echo "==> Updating source tree"
- cvs -Rq update -Pd
- error=$?
- if [ "$error" != "0" ]; then
- exit 1
- fi
-fi
-
-env
-
-echo "==> Starting make buildworld"
-make buildworld $*
-error=$?
-if [ "$error" != "0" ]; then
- exit $error
-fi
-
-echo "==> Cleaning up chroot"
-rm -rf /var/chroot/
-chflags -R noschg /var/chroot/
-rm -rf /var/chroot/
-mkdir /var/chroot/
-
-echo "==> Starting make installworld"
-if [ "$client" = "0" ]; then
- export NEWSPARC_TIMETYPE=__int64_t
- make installworld DESTDIR=/var/chroot
- error=$?
- if [ "$error" != "0" ]; then
- exit $error
- fi
-
- echo "==> Starting make distribute"
- cd etc
- make obj
- make all
- make distribute DISTRIBUTION=/var/chroot/
- error=$?
- if [ "$error" != "0" ]; then
- exit $error
- fi
-else
- echo "==> Not doing installworld of client source tree"
-fi
--- Tools/portbuild/scripts/dopackages2
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-
-# configurable variables
-pb=/var/portbuild
-
-. ${pb}/portbuild.conf
-
-lock=${pb}/lock
-status=${pb}/status
-date=$(date '+%Y%m%d%H')
-shortdate=$(date '+%Y%m%d')
-
-if [ -e ${lock} ]; then
-# echo "Skipped package build since lock file exists" | sendmail $mailto
- exit 1
-fi
-
-touch ${lock}
-rm -f ${status}
-mkdir -p ${pb}/archive/buildlogs
-
-if [ -f ${pb}/scripts/dopackages.new ]; then
- mv -f ${pb}/scripts/dopackages.new ${pb}/scripts/dopackages
-fi
-ln -sf ${pb}/archive/buildlogs/log.4.${date} ${pb}/4/build.log
-ln -sf log.4.${date} ${pb}/archive/buildlogs/log.4.${shortdate}
-${pb}/scripts/dopackages $@ 4 ${date} 2>&1 \
- | tee ${pb}/archive/buildlogs/log.4.${date} \
- | sendmail $mailto
-if [ -f ${status} ]; then
- rm -f ${lock}
- exit "$(cat ${status})"
-fi
-
-if [ -f ${pb}/scripts/dopackages.new ]; then
- mv -f ${pb}/scripts/dopackages.new ${pb}/scripts/dopackages
-fi
-ln -sf ${pb}/archive/buildlogs/log.5.${date} ${pb}/5/build.log
-ln -sf log.5.${date} ${pb}/archive/buildlogs/log.5.${shortdate}
-${pb}/scripts/dopackages -nocvsup $@ 5 ${date} 2>&1 \
- | tee ${pb}/archive/buildlogs/log.5.${date} \
- | sendmail $mailto
-if [ -f ${status} ]; then
- rm -f ${lock}
- exit "$(cat ${status})"
-fi
-
-if [ -f ${pb}/scripts/dopackages.new ]; then
- mv -f ${pb}/scripts/dopackages.new ${pb}/scripts/dopackages
-fi
-ln -sf ${pb}/archive/buildlogs/log.3.${date} ${pb}/3/build.log
-ln -sf log.3.${date} ${pb}/archive/buildlogs/log.3.${shortdate}
-${pb}/scripts/dopackages -nocvsup $@ 3 ${date} 2>&1 \
- | tee ${pb}/archive/buildlogs/log.3.${date} \
- | sendmail $mailto
-if [ -f ${status} ]; then
- rm -f ${lock}
- exit "$(cat ${status})"
-fi
-
-cd ${pb}/archive/errorlogs/e.3.${date} && ${pb}/scripts/processlogs
-cd ${pb}/archive/errorlogs/e.4.${date} && ${pb}/scripts/processlogs
-cd ${pb}/archive/errorlogs/e.5.${date} && ${pb}/scripts/processlogs
-cd ${pb}/archive/errorlogs
-${pb}/scripts/comparelogs e.3.${date} e.4.${date}
-${pb}/scripts/comparelogs e.4.${date} e.3.${date}
-${pb}/scripts/comparelogs e.5.${date} e.4.${date}
-${pb}/scripts/comparelogs e.4.${date} e.5.${date}
-${pb}/scripts/bothlogs e.3.${date} e.4.${date} e.5.${date}
-
-rm -f ${lock}
--- Tools/portbuild/scripts/reportload
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# This is run on the clients to report their loads to the server.
-
-# configurable variables
-pb=/var/portbuild
-arch=$1
-
-. ${pb}/${arch}/portbuild.conf
-if [ -f ${pb}/${arch}/portbuild.$(hostname) ]; then
- . ${pb}/${arch}/portbuild.$(hostname)
-fi
-
-# Look for exceptional conditions
-error=0
-for i in squid disk; do
- if [ -f ${scratchdir}/.${i} ]; then
- error=1
- fi
-done
-
-if [ ${error} = 0 ]; then
- num=$(echo $(ls -1d ${scratchdir}/*/chroot/*/used 2>/dev/null| wc -l))
-else
- num=ERR
-fi
-
-echo -n "$num "
-uptime
--- Tools/portbuild/scripts/chopindex
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-if [ $# != 2 ]; then
- echo "usage: chopindex <indexfile> <pkgdir>"
- return 1
-fi
-index=$1
-pkgdir=$2
-tmpindex=/tmp/index.$$
-
-# make a list of all pkgnames that don't have corresponding packages
-missing=$(/usr/bin/awk -v FS="|" -v pkgdir=$pkgdir '{
- if (system(sprintf("test -e %s/All/%s.t[bg]z\n", pkgdir, $1)))
- print $1 ;
-}' $index)
-
-# make an index for only the ports that have packages
-/usr/bin/awk -v FS="|" -v pkgdir=$pkgdir '{
- if (system(sprintf("test ! -e %s/All/%s.t[bg]z\n", pkgdir, $1)))
- print $0 ;
-}' $index > $tmpindex
-
-# find missing ports still in the index as a dependency
-delete=""
-sed=""
-for i in $missing; do
- if grep -q "[ |]$i[ |]" $tmpindex; then
- delete="$delete $i"
- sed="$sed -e s/$(echo $i | sed -e 's/\./\\./g')//g"
- fi
-done
-
-# delete them
-if [ "$delete" != "" ]; then
- echo "chopindex: deleting" $delete 1>&2
-fi
-
-sed $sed -e 's/ */ /g' -e 's/| /|/g' -e 's/ |/|/g' $tmpindex
-
-/bin/rm -f $tmpindex
--- Tools/portbuild/scripts/buildsuccess
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# buildsuccess <arch> <branch> <pkgname>
-
-# configurable variables
-pb=/var/portbuild
-arch=$1
-shift
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-branch=$1
-pkgname=$2
-shift 2
-
-buildenv ${pb} ${arch} ${branch}
-
-# Don't pick up installed packages from the host
-export LOCALBASE=/nonexistentlocal
-export X11BASE=/nonexistentx
-
-index=${PORTSDIR}/${INDEXFILE}
-
-portloc=$(grep "^$pkgname|" ${index} | cut -f 2 -d \| | sed s,/usr/ports/,,)
-
-cd ${pb}/${arch}/${branch}
-if grep -q "^${portloc}|" failure; then
- echo | mail -s "${pkgname} now builds on ${arch} ${branch}" ${mailto}
- grep -v "^${portloc}|" failure > failure.new
- mv failure.new failure
-fi
-
-if [ -L ${pb}/${arch}/${branch}/latest/${portloc} ]; then
- rm -f ${pb}/${arch}/${branch}/latest/${portloc}
-fi
--- Tools/portbuild/scripts/dodistfiles
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-distdir=$1
-if cd ${distdir}/.pbtmp >/dev/null 2>&1; then
- set *
- while [ $# -gt 0 ]; do
- if [ -e $1/.done ]; then
- rm -f $1/.done
- tar -C $1 -cf - . | tar -C ${distdir} -xpf -
- rm -rf $1
- fi
- shift
- done
-fi
--- Tools/portbuild/scripts/pollmachine
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-buildroot=/var/portbuild
-
-i=$1
-m=$2
-if [ "$3" = "-queue" ]; then
- queue=1
-else
- queue=0
-fi
-
-infoseek_port=infoseek
-. ${buildroot}/${i}/portbuild.conf
-if [ -f ${buildroot}/${i}/portbuild.${m} ]; then
- . ${buildroot}/${i}/portbuild.${m}
-fi
-if [ -z "${infoseek_host}" ]; then
- infoseek_host=$m
-fi
-if (/usr/local/bin/nc -w 15 ${infoseek_host} ${infoseek_port} > ${buildroot}/${i}/loads/$m < /dev/null); then
- if [ "${queue}" = 1 ]; then
- num=$(awk '{print $1}' ${buildroot}/${i}/loads/$m)
- if [ "$num" -lt "${maxjobs}" ]; then
- echo ${num} > ${buildroot}/${i}/queue/$m
- chown ports-${i} ${buildroot}/${i}/queue/$m
- else
- rm -f ${buildroot}/${i}/queue/$m
- fi
- fi
-else
- rm -f ${buildroot}/${i}/queue/$m
- exit 1
-fi
-exit 0
--- Tools/portbuild/scripts/dopackagestats
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/Tools/portbuild/scripts/dopackagestats,v 1.11 2006/07/13 03:52:28 linimon Exp $
-#
-# create HTML showing numbers of packages vs errors. Run this in a directory
-# accessible to the web server.
-#
-
-# alpha is obsolete
-SUPPORTED_ARCHS="amd64 i386 ia64 sparc64"
-ROOT_DIRECTORY=/var/portbuild
-
-OUTFILE=`basename $0 | sed -e "s/^do//"`".html"
-TMPFILE=.${OUTFILE}
-
-# stylesheet seems like overkill for something this simple
-TABLEBGCOLOR="#F0F0F0"
-THCOLOR="#E0E0FF"
-TDCOLOR_DONE="lightgreen"
-TDCOLOR_NOT_DONE="lightyellow"
-
-# subroutines
-
-write_header () {
- echo "<html>" > ${TMPFILE}
- echo "<head>" >> ${TMPFILE}
- echo "<title>FreeBSD package building statistics</title>" >> ${TMPFILE}
- echo "</head>" >> ${TMPFILE}
-
- echo "<body>" >> ${TMPFILE}
- echo "<h1>FreeBSD package building statistics</h1>" >> ${TMPFILE}
- echo "<p>as of `date`</p>" >> ${TMPFILE}
-}
-
-write_table_begin () {
- echo "<table border='1' cellpadding='4' cellspacing='1' bgcolor='$TABLEBGCOLOR'>" >> ${TMPFILE}
- echo "<tr>" >> ${TMPFILE}
- echo "<td align='left' width='80' bgcolor='$TABLEBGCOLOR'> </td>" >> ${TMPFILE}
- echo "<th width='60' bgcolor='$THCOLOR'>cvs date</th>" >> ${TMPFILE}
- echo "<th width='60' bgcolor='$THCOLOR'>latest log</th>" >> ${TMPFILE}
- echo "<th bgcolor='$THCOLOR'>INDEX</th>" >> ${TMPFILE}
- echo "<th bgcolor='$THCOLOR'>packages</th>" >> ${TMPFILE}
- echo "<th bgcolor='$THCOLOR'>errors</th>" >> ${TMPFILE}
- echo "<th bgcolor='$THCOLOR'>skipped</th>" >> ${TMPFILE}
- echo "<th bgcolor='$THCOLOR'>missing</th>" >> ${TMPFILE}
- echo "<th bgcolor='$THCOLOR'>done?</th>" >> ${TMPFILE}
- echo "</tr>" >> ${TMPFILE}
-}
-
-write_row () {
- # first, gather data
-
- arch=$1
- build=$2
- directory=${ROOT_DIRECTORY}/${arch}/${build}
- branch=`echo $build | sed -e "s/-exp//"`
- if [ "$branch" = "4" ]; then
- indexfile=$directory/ports/INDEX
- else
- indexfile=$directory/ports/INDEX-$branch
- fi
-
- # column: date of CVS checkout
- cvsdone=" "
- if [ -f $directory/cvsdone ]; then
- cvsdone="$(cat $directory/cvsdone | awk '{printf("%s %s\n",$2,$3)}')"
- if [ -z "$cvsdone" ]; then
- cvsdone=" "
- fi
- fi
-
- # column: datestamp of latest log
- latest=" "
- if [ -d $directory/logs ]; then
- #latest="$(cd $directory/logs; ls -rtTl | grep '\.log' | tail -1 | awk '{printf("%s %s %s %s\n",$6,$7,$8,$9)}')"
- latest="$(cd $directory/logs; ls -rtTl | grep '\.log' | tail -1 | awk '{printf("%s %s\n",$6,$7)}')"
- if [ "$latest" ]; then
- #latest="$latest `date '+%Z'`"
- else
- latest=" "
- fi
- fi
-
- # column: INDEX count
- n_index=0
- if [ -f $indexfile ]; then
- n_index=`cat $indexfile | wc -l`
- fi
-
- # column: package count
- n_packages=0
- if [ -d $directory/packages/All ]; then
- n_packages=`find $directory/packages/All -name \*.tbz -o -name \*.tgz |wc -l`
- fi
-
- # column: error count
- n_errors=0
- if [ -d $directory/errors ]; then
- # XXX MCL why doesn't this work???
- #n_errors=`find $directory/errors -name \*.log -o -name \*.log.bz2 |wc -l`
- n_errors=`ls $directory/errors | grep '.log' | wc -l`
- fi
-
- # column: duds count
- n_duds=0
- if [ -f $directory/duds ]; then
- n_duds=`cat $directory/duds | wc -l`
- fi
-
- # column: missing count
- if [ $n_index -ne 0 ]; then
- n_missing=`expr $n_index - $n_packages - $n_errors - $n_duds`
- else # index currently being rebuilt
- n_missing=0
- fi
-
- # column: done flag
- done_flag="N"
- if [ -f $directory/build.log ]; then
- if [ ! -z "`grep 'all done at ' $directory/build.log`" ]; then
- done_flag="Y"
- fi
- fi
-
- # decorate the row to make everything less "gray"
- if [ "$done_flag" = "Y" ]; then
- cellcolor=$TDCOLOR_DONE
- else
- cellcolor=$TDCOLOR_NOT_DONE
- fi
-
- # now write the row
- echo "<tr>" >> ${TMPFILE}
- echo "<th align='left' bgcolor='$THCOLOR'>$arch-$build</th>" >> ${TMPFILE}
- echo "<td align='left' bgcolor='$cellcolor'>$cvsdone</td>" >> ${TMPFILE}
- echo "<td align='left' bgcolor='$cellcolor'>$latest</td>" >> ${TMPFILE}
- echo "<td align='right' bgcolor='$cellcolor'>$n_index</td>" >> ${TMPFILE}
- echo "<td align='right' bgcolor='$cellcolor'>" >> ${TMPFILE}
- echo "<a href='http://pointyhat.freebsd.org/errorlogs/$arch-$build-latest-logs'>" >> ${TMPFILE}
- echo "$n_packages</a></td>" >> ${TMPFILE}
- echo "<td align='right' bgcolor='$cellcolor'>" >> ${TMPFILE}
- echo "<a href='http://pointyhat.freebsd.org/errorlogs/$arch-$build-latest'>" >> ${TMPFILE}
- echo "$n_errors</a></td>" >> ${TMPFILE}
- echo "<td align='right' bgcolor='$cellcolor'>$n_duds</td>" >> ${TMPFILE}
- echo "<td align='right' bgcolor='$cellcolor'>$n_missing</td>" >> ${TMPFILE}
- echo "<td align='center' bgcolor='$cellcolor'>$done_flag</td>" >> ${TMPFILE}
- echo "</tr>" >> ${TMPFILE}
-}
-
-write_table_end () {
- echo "</table>" >> ${TMPFILE}
- echo "<br>" >> ${TMPFILE}
-}
-
-write_footer () {
- echo "<p>explanation of columns:</p>" >> ${TMPFILE}
- echo "<ul>" >> ${TMPFILE}
- echo "<li><b>latest log</b> is the date of the latest logfile.</li>" >> ${TMPFILE}
- echo "<li><b>cvs date</b> is the date of the latest CVS checkout done by the script. It may be inaccurate if a manual checkout was done later.</li>" >> ${TMPFILE}
- echo "<li><b>INDEX</b> is number of ports in the INDEX file built from the latest cvs checkout.</li>" >> ${TMPFILE}
- echo "<li><b>packages</b> is number of packages successfully built.</li>" >> ${TMPFILE}
- echo "<li><b>errors</b> is number of packages that failed.</li>" >> ${TMPFILE}
- echo "<li><b>skipped</b> is number of packages that were skipped due to NO_PACKAGE, IGNORE, BROKEN, FORBIDDEN, and so forth (\"duds\" file).</li>" >> ${TMPFILE}
- echo "<li><b>missing</b> is the INDEX column minus the others. These are packages that have not been built for one reason or another.</li>" >> ${TMPFILE}
- echo "<li><b>done</b> is whether that run terminated normally or not.</li>" >> ${TMPFILE}
- echo "</ul>" >> ${TMPFILE}
-
- echo "<p>notes:</p>" >> ${TMPFILE}
- echo "<ul>" >> ${TMPFILE}
- echo "<li>on the -exp builds, editors/openoffice.org* are skipped to save time.</li>" >> ${TMPFILE}
- echo "</ul>" >> ${TMPFILE}
-
- echo "</body>" >> ${TMPFILE}
- echo "</html>" >> ${TMPFILE}
-}
-
-# main
-
-write_header
-
-# display all the mainstream builds first
-for arch in ${SUPPORTED_ARCHS}; do
-
- builds=`ls ${ROOT_DIRECTORY}/${arch} | grep '^[1-9]$' | sort`
- if [ ! -z "$builds" ]; then
- write_table_begin
-
- for build in ${builds}; do
- write_row ${arch} ${build}
- done
-
- write_table_end
- fi
-done
-
-# then display all -exp builds (probably only of interest to portmgr;
-# would break up the logical flow of the above)
-for arch in ${SUPPORTED_ARCHS}; do
-
- builds=`ls ${ROOT_DIRECTORY}/${arch} | grep '^[1-9]-exp$' | sort`
- if [ ! -z "$builds" ]; then
- write_table_begin
-
- for build in ${builds}; do
- write_row ${arch} ${build}
- done
-
- write_table_end
- fi
-done
-
-write_footer
-
-mv -f ${TMPFILE} ${OUTFILE}
--- Tools/portbuild/scripts/dosetupnode
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-# configurable variables
-pb=/var/portbuild
-arch=$1
-branch=$2
-node=$3
-shift 3
-
-norsync=0
-if [ "$1" = "-norsync" ]; then
- norsync=1
-fi
-
-. ${pb}/${arch}/portbuild.conf
-
-. ${pb}/scripts/buildenv
-
-echo "setting up of $node started at $(date)"
-
-# Read in client config and decide if the node is disconnected or not (i.e. mounts via NFS)
-disconnected=0
-. ${pb}/${arch}/portbuild.${node}
-
-if [ "${norsync}" = 1 ]; then
- md5=0
- nocopy=
-else
- md5=$(/sbin/md5 ${pb}/${arch}/${branch}/tarballs/bindist.tar | awk '{print $4}')
- nocopy=
-fi
-
-scp -p ${pb}/scripts/setupnode ${client_user}@${node}:/tmp
-ssh -n ${client_user}@${node} ${sudo_cmd} sh /tmp/setupnode ${nocopy} $(hostname) ${pb} ${arch} ${branch} ${scratchdir} ${md5} ${disconnected}
-
-if [ "${disconnected}" = 1 -a "${norsync}" = 0 ]; then
- rsync ${rsync_gzip} -r -l -p --delete ${pb}/scripts ${client_user}@${node}:${pb}/
- rsync ${rsync_gzip} -r -l -p --delete ${pb}/${arch}/portbuild* ${client_user}@${node}:${pb}/${arch}
- rsync ${rsync_gzip} -r -l -p --delete ${pb}/${arch}/${branch}/ports ${client_user}@${node}:${pb}/${arch}/${branch}
- rsync ${rsync_gzip} -r -l -p --delete ${pb}/${arch}/${branch}/src ${client_user}@${node}:${pb}/${arch}/${branch}
- rsync ${rsync_gzip} -r -L -p --delete ${pb}/${arch}/${branch}/tarballs/ ${client_user}@${node}:${pb}/${arch}/${branch}/tarballs/
-fi
-
-lockf -k ${pb}/${arch}/queue/.lock ${pb}/scripts/pollmachine ${arch} ${node} -queue
-echo "setting up of $node ended at $(date)"
--- Tools/portbuild/scripts/getmachine
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-#
-# Choose the least-loaded machine in the queue dir
-# Called with lock held
-# We know that everything in this directory has space for another job
-
-pb=$1
-arch=$2
-branch=$3
-
-qdir=${pb}/${arch}/queue
-
-cd $qdir
-set *
-if [ "$1" = "*" ]; then
- echo ""
- exit 1
-fi
-
-min=9999
-while [ $# -gt 0 ]; do
- m=$1
- num=$(cat $m)
- if [ $num -lt $min ]; then
- mach=$m
- min=$num
- elif [ $num -eq $min ]; then
- mach="${mach} ${m}"
- fi
- shift
-done
-
-if [ "$min" = 9999 -o -z "${mach}" ]; then
- echo ""
- exit 1
-fi
-
-# Choose highest-priority machine that is free
-mach=$(echo ${mach} | tr -s ' ' '\n' | grep -F -f - ${pb}/${arch}/mlist | head -1)
-if [ -z "${mach}" ]; then
- rm -f "${mach}"
- exit 1
-fi
-
-. ${pb}/${arch}/portbuild.conf
-test -f ${pb}/${arch}/portbuild.${mach} && . ${pb}/${arch}/portbuild.${mach}
-
-# Now that we've found a machine, register our claim in the queue
-if [ "$((${min}+1))" -ge "${maxjobs}" ]; then
- rm ${mach}
-else
- echo $(($min+1)) > ${mach}
-fi
-
-# Report to caller
-echo ${mach}
-exit 0
--- Tools/portbuild/scripts/mkbindist
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/sh
-
-usage () {
- echo "usage: mkbindist <arch> <branch>"
- exit 1
-}
-if [ $# != 2 ]; then
- usage
-fi
-
-arch=$1
-branch=$2
-if [ "x$branch" != x4 -a "x$branch" != x4-exp -a "x$branch" != x5 -a "x$branch" != x5-exp -a "x$branch" != x6 -a "x$branch" != x7 ]; then
- usage
-fi
-
-pb=/var/portbuild
-. ${pb}/${arch}/portbuild.conf
-
-here=${pb}/${arch}/${branch}
-. ${here}/mkbindist.conf
-
-if [ ${buildworld} = "1" ]; then
- if ! ${pb}/scripts/makeworld ${arch} ${branch}; then
- exit 1
- fi
-elif [ ${ftp} = "1" ]; then
- cd ${here}
- rm -rf bindist/ftp
- mkdir -p bindist/ftp
- cd bindist/ftp
- for i in ${ftpdists}; do
- /usr/bin/ftp -a "ftp://${ftpserver}${ftpurl}/${rel}/$i.??"
- done
- cd ${here}
-fi
-
-tmpdir=${here}/tmp
-
-# just in case
-umount -f ${tmpdir}/usr/src 2>/dev/null
-
-# Clean up ${tmpdir}
-rm -rf ${tmpdir} 2>/dev/null
-if [ -d ${tmpdir} ]; then
- chflags -R noschg ${tmpdir}
- rm -rf ${tmpdir}
-fi
-mkdir -p ${tmpdir}
-
-# Set up the tmpdir directory hierarchy
-cd ${tmpdir}
-mtree -deU -f ${here}/src/etc/mtree/BSD.root.dist -p ${tmpdir}/
-mtree -deU -f ${here}/src/etc/mtree/BSD.var.dist -p ${tmpdir}/var
-mtree -deU -f ${here}/src/etc/mtree/BSD.usr.dist -p ${tmpdir}/usr
-mtree -deU -f ${here}/src/etc/mtree/BSD.local.dist -p ${tmpdir}/usr/local
-
-# Copy the files into the tmpdir. Use an existing built world, or the ftp
-# files.
-if [ "${ftp}" = 0 ]; then
- (cd ${worlddir}; find -dx . | \
- grep -v -E '^./usr/(X11R6|local|obj|opt|mports|src)' | \
- grep -v '^./home' | \
- grep -v '^./var/db/pkg' | \
- cpio -dump ${tmpdir})
-else
- for i in ${ftpdists}; do
- cat ${here}/bindist/ftp/$(basename $i).?? | tar --unlink -xzpf -
- done
-fi
-
-cd ${tmpdir}
-
-# Customize the tmpdir
-rm -rf $(cat ${here}/bindist/delete)
-mkdir -p $(cat ${here}/bindist/dirlist)
-(cd ${here}/bindist/files; find -dx . | cpio -dump ${tmpdir})
-
-# Post-processing of installed world
-
-date '+%Y%m%d' > var/db/port.mkversion
-
-rm -f kernel.GENERIC
-
-mkdir ${tmpdir}/var/run
-
-chroot ${tmpdir} /sbin/ldconfig /usr/lib
-if [ "${arch}" = "i386" ]; then
- chroot ${tmpdir} /sbin/ldconfig -aout /usr/lib/aout
- rm -f /usr/lib/aout/lib*_p.a
-fi
-
-# Create the tarballs
-mkdir -p ${here}/tarballs
-cd ${tmpdir}
-tar cf ${here}/tarballs/bindist.tar.new .
-mv -f ${here}/tarballs/bindist.tar.new ${here}/tarballs/bindist.tar
-
-# Clean up
-cd ${here}
-rm -rf ${tmpdir} 2>/dev/null
-if [ -d ${tmpdir} ]; then
- chflags -R noschg ${tmpdir}
- rm -rf ${tmpdir}
-fi
--- Tools/portbuild/scripts/allgohans
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-doarch() {
- arch=$1
- shift
-
- if [ -f "${pb}/${arch}/portbuild.conf" ]; then
- . ${pb}/${arch}/portbuild.conf
- else
- echo "Invalid arch"
- exit 1
- fi
-
- machines=$(awk '{print $1}' ${pb}/${arch}/mlist)
-
- for i in ${machines}; do
- . ${pb}/${arch}/portbuild.conf
- if [ -f "${pb}/${arch}/portbuild.${i}" ]; then
- . ${pb}/${arch}/portbuild.${i}
- fi
- if [ ${quiet} -eq 0 ]; then
- echo "[$i]"
- fi
- su ports-${arch} -c "ssh ${client_user}@$i ${sudo_cmd} $@"
- done
-}
-
-id=$(whoami)
-if [ "${id}" = "root" ]; then
- arch=$1
- shift
- root=1
-else
- arch=$(echo $id | sed s,ports-,,)
- root=0
-fi
-
-if [ "$1" = "-q" ]; then
- quiet=1
- shift
-else
- quiet=0
-fi
-
-pb=/var/portbuild
-if [ "${arch}" = "all" ]; then
- arches=$(find ${pb}/*/portbuild.conf)
- for i in ${arches}; do
- arch=$(basename $(dirname $i))
- doarch $arch "$@"
- done
-else
- doarch $arch "$@"
-fi
--- Tools/portbuild/scripts/checkmachines
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-#
-# Runs in the background on the server. This script keeps track of
-# the relative loads of the client machines, and specifies which machine(s)
-# should be handed new jobs, according to the following algorithm:
-#
-# For each machine listed in ${buildroot}/mlist, check whether its load
-# information has been updated in the last 15 seconds (should be updated by
-# the reportload script every 5 seconds). If so, then divide the number of
-# running jobs on the client by its weighting in mlist, and output the
-# machine(s) with the minimum value to ${buildroot}/ulist.
-#
-# Dividing by the weight has the effect of grouping machines with similar
-# job load (e.g. a weight of 5 will rank machines with job loads 0, 1, 2, 3, 4
-# as the same; if the machines all had a weight of 1 then it would only
-# choose the machine with the least value of the job load, and would probably
-# choose a single machine most of the time).
-
-buildroot=/var/portbuild
-
-arches=$*
-
-while true; do
- for i in ${arches}; do
- mlist=${buildroot}/${i}/mlist
-
- set $(cat $mlist)
- while [ $# -gt 0 ]; do
- m=$1
- ${buildroot}/scripts/pollmachine ${i} ${m}
- shift 1
- done
- done
- sleep 120
-done
--- Tools/portbuild/scripts/makerestr
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-# usage: $0 arch branch
-
-# configurable variables
-pb=/var/portbuild
-arch=$1
-shift
-
-. ${pb}/${arch}/portbuild.conf
-
-. ${pb}/scripts/buildenv
-
-usage () {
- echo "usage: makerestr branch"
- exit 1
-}
-if [ $# != 1 ]; then
- usage
-fi
-
-branch=$1
-
-buildenv ${pb} ${arch} ${branch}
-
-duds=${pb}/${arch}/${branch}/duds
-
-unset DISPLAY
-
-export PACKAGE_BUILDING=1
-cd ${PORTSDIR}
-make ECHO_MSG=/usr/bin/true clean-restricted-list \
- | sed -e "s./usr/ports/packages/.${pb}/${arch}/${branch}/packages/.g" \
- -e "s./usr/ports/.${pb}/${arch}/${branch}/ports/.g" \
- > ${pb}/${arch}/${branch}/restricted.sh
--- Tools/portbuild/scripts/ptimeout.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* ptimeout: executes command but kills it after a specified timeout
- * usage: ptimeout timeout command args ...
- *
- * $FreeBSD: ports/Tools/portbuild/scripts/ptimeout.c,v 1.1 2002/11/03 04:49:39 kris Exp $
- */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <time.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-int
-main(int argc, char *argv[])
-{
- int timeout, status, i;
- pid_t pid1, pid2, child;
- char *command, args[MAXPATHLEN + 1];
- time_t t;
-
- if (argc < 3) {
- printf("usage: %s timeout command [args ...]\n", argv[0]);
- exit(1);
- }
-
- timeout = atoi(argv[1]);
- command = argv[2];
-
- bzero(args, MAXPATHLEN + 1);
- for (i = 2; i < argc; i++) {
- strlcat(args, argv[i], MAXPATHLEN - strlen(args));
- strlcat(args, " ", MAXPATHLEN - strlen(args));
- }
-
- /*printf("timeout is %d\n", timeout);
- printf("arguments are %s\n", args);*/
-
- if ((pid1 = fork()) > 0) {
- if ((pid2 = fork()) > 0) {
- /* parent */
- /*printf("child pids are %d %d\n", pid1, pid2);*/
- child = wait(&status);
- /*printf("exited child is %d, status is %d\n", child, status);*/
- if (pid1 = child) {
- /*printf("killing process %d\n", pid2);*/
- kill(pid2, SIGTERM);
- } else {
- /*printf("killing process %d\n", pid1);*/
- kill(pid1, SIGTERM);
- }
- /* exit status in upper 8 bits, killed signal (if any)
- * in lower 8 bits
- */
- exit((status >> 8) | (status & 0xff));
- } else {
- /* second child */
- sleep(timeout);
- t = time(NULL);
- printf("ptimeout: killing %s (pid %d) since timeout of %d expired at %s", args, pid1, timeout, ctime(&t));
- kill(pid1, SIGTERM);
- exit(1);
- }
- } else {
- /* first child */
- /*printf("executing %s\n", args);*/
- execvp(command, argv + 2);
- }
-
- /* Shouldn't be reached. */
- return 0;
-}
--- Tools/portbuild/scripts/stats
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-if [ $# -ne 1 ]; then
- echo "usage: <branch>"
- exit 1
-fi
-
-branch=$1
-
-for i in i386 alpha sparc64 ia64 amd64; do
- if [ -d /var/portbuild/$i/${branch}/packages/All ]; then
- cd /var/portbuild/$i/${branch}/packages/All
- count=$(find . -name \*.tbz -o -name \*.tgz |wc -l)
- echo -n "$i: ${count} "
- fi
-done
-echo
--- Tools/portbuild/scripts/prunepkgs
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-if [ $# -lt 2 ]; then
- echo "usage: prunepkgs <indexfile> <pkgdir> [-dummy]"
- return 1
-fi
-index=$1
-pkgdir=$2
-
-if [ $# -eq 3 -a "$3" = "-dummy" ]; then
- dummy=1;
-else
- dummy=0;
-fi
-
-testprunelink() {
- if [ ! -e $1/ ]; then
- dest=$(readlink $1)
- echo "$1 -> $dest pruned."
- if [ "${dummy}" = "0" ]; then
- rm -f $1
- fi
- fi
-}
-
-# Set up work dir
-
-tmpdir=$(mktemp -d -t prunepkgs)
-trap "rm -rf $tmpdir; exit 1" 1 2 3 5 10 13 15
-
-# Check for non-package files
-
-extras=$(find ${pkgdir} -type f \! \( -name INDEX -o -name CHECKSUM.MD5 -o -name \*.tgz -o -name \*.tbz \) )
-echo "==> Removing extra files"
-echo $extras
-if [ "x${extras}" != "x" ]; then
- if [ "${dummy}" = "0" ]; then
- rm -f ${extras}
- fi
-fi
-
-# Check for files not present in INDEX
-echo "==> Removing extra package files"
-
-find $pkgdir/All -type f -name \*.tgz -o -name \*.tbz | sed -e "s,${pkgdir}/All/,," -e 's,\.tbz$,,' -e 's,\.tgz$,,' |sort > ${tmpdir}/files
-cut -f 1 -d '|' ${index} |sort > ${tmpdir}/packages
-
-extras=$(comm -2 -3 ${tmpdir}/files ${tmpdir}/packages)
-echo $extras
-if [ "${dummy}" = "0" ]; then
- for i in $extras; do
- rm -f $pkgdir/All/${i}.tgz $pkgdir/All/${i}.tbz
- done
-fi
-
-rm -rf ${tmpdir}
-
-# Look for dead links and prune them
-echo "==> Removing dead symlinks"
-
-links=$(find $pkgdir -type l)
-for i in $links; do
- testprunelink $i
-done
-
-
--- Tools/portbuild/scripts/processlogs2
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-of=extras.html.new
-
-if [ -e .stamp -a $(echo $(find . -newer .stamp -type f -name '*.log' 2>/dev/null | wc -l)) = "0" ]; then exit; fi
-
-echo "<html><head><title>List of files and directories that do not match their mtree description</title>" >$of
-echo "<h1>List of files and directories that do not match their mtree description</h1>" >>$of
-echo "</head><body>" >>$of
-
-touch .stamp
-
-find . -name '*.log' | xargs grep -l '^list of.*file' | sort | sed -e 's/^..//' > .tmp
-if [ $(echo $(cat .tmp | wc -l)) = 0 ]; then
- echo "No extra files (yet)" >> $of
-else
- set $(cat .tmp)
- num=$#
- if [ -s cvsdone ]; then
- echo "(cvs update finished at: $(cat cvsdone))<br>" >> $of
- fi
- echo "(timestamp of newest log: $(ls -rtTl | grep '\.log$' | tail -1 | awk '{printf("%s %s %s %s\n",$6,$7,$8,$9)}'))<br><br>" >> $of
- echo "<table border=1>" >>$of
- echo "<tr><th>Log</th><th>Aff.</th><th>Size</th><th>Repository</th><th>Maintainer</th><th>Pathname</th></tr>" >>$of
- while [ $# -gt 0 ]; do
- log=$(basename $1 .log)
- echo -n "<tr><td valign=\"top\">" >>$of
- echo -n "<a name=\"$log.log\"></a>" >> $of
- echo -n "<a href=\"$log.log\">" >>$of
- echo -n $log >>$of
- echo -n "</a>" >>$of
- echo -n "</td><td align=right valign=\"top\">" >>$of
- affected=$(($(grep -cF $log < INDEX) - 1))
- if [ $affected != 0 ]; then echo -n $affected >>$of; fi
- echo -n "</td><td align=right valign=\"top\">" >>$of
- size=$(/bin/ls -sk $log.log | awk '{print $1}')
- echo -n "$size KB" >>$of
- echo -n "</td><td valign=\"top\">" >>$of
- dir=$(sed -n -e '4p' $log.log | awk '{print $3}' | sed -e 's,^/[^/]*/[^/]*/,,')
- echo -n "<a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$dir\">$dir</a>" >>$of
- echo -n "</td><td valign=\"top\">" >>$of
- maint=$(sed -n -e '3p' $log.log | awk '{print $3}')
- maints="$maints $maint"
- echo -n "<a href=\"mailto:$maint\">$maint</a>" >>$of
- echo "</td><td valign=\"top\">" >>$of
- cat $log.log | sed -e '1,/^list of extra files and directories/d' -e '/^list of/,$d' | awk '{print $11}' | sed -E -e 's,^,<font color=\"magenta\">,' -e 's,(usr/(local|X11R6)),<font color=\"black\">\1,g' -e 's,$,</font></font><br>,' >>$of
- cat $log.log | sed -e '1,/^list of files present before this port was installed/d' -e '/^list of/,$d' -e 's,^\./,,' | awk '{print $1}' | sed -e 's,^,<font color=\"orange\">,' -e 's,$, (missing)</font><br>,' >> $of
- cat $log.log | sed -e '1,/^list of filesystem changes/d' -e '/^ /d' | awk '{print $1}' | sed -e 's,^,<font color=\"red\">,' -e 's,$, (changed)</font><br>,' >>$of
- echo "</td></tr>" >>$of
- shift
- done
- echo "</table><br>" >> $of
- echo "$num errors<br>" >> $of
-fi
-
-rm .tmp
-
-echo "<hr>" >> $of
-echo "<a href=\"../\">back to top</a>" >> $of
-
-echo "</body></html>" >>$of
-
-mv -f $of extras.html
-
-echo $maints | sed -e 's/ /\
-/g' | sort -fu > maintainers
--- Tools/portbuild/scripts/bothlogs
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-# prints out logs that are in dir1 but not in dir2
-
-if [ $# -ne 3 ]; then
- echo "usage: $0 arch dir1 dir2"
- exit 1
-fi
-
-here=$(pwd)
-arch=$1
-dir1=$2
-dir2=$3
-fdir1=$here/${arch}-$dir1
-fdir2=$here/${arch}-$dir2
-ldir2=$(cd $fdir2; pwd | sed -e 's/e\./a./')
-
-plus="$(echo $2 $3 | sed -e 's/ /+/g')"
-
-of=$here/$arch-$plus.html
-
-echo "<html><head><title>Logs that are in both $dir1 and $dir2</title>" >$of
-echo "<h1>Logs that are in both $dir1 and $dir2</h1>" >>$of
-echo "</head><body>" >>$of
-
-cd $fdir1
-logs=$(find . -name \*.log -o -name \*.log.bz2 | sed -e 's/\.log\.bz2/\.log/g')
-nlogs=$(echo $logs | wc -w)
-
-if [ $nlogs -eq 0 ]; then
- echo "No errors" >>$of;
-else
- num=0
- echo "<table border=1>" >>$of
- echo "<tr><th>Log</th></tr>" >>$of
- for i in $logs; do
- if [ -f ${fdir2}/${i}.bz2 -o -f ${fdir2}/${i} ]; then
- fname1=$(basename $i .bz2)
- fname=$(basename $fname1 .log)
- echo -n "<tr>" >> $of
- echo -n "<td><a href=\"$arch-$dir1/$fname.log\">$fname</a></td>" >>$of
- echo -n "<td><a href=\"$arch-$dir2/$fname.log\">$fname</a></td>" >>$of
- echo "</tr>" >>$of
- num=$(($num + 1))
- fi
- done
- echo "</table><br>" >> $of
- echo "$num errors<br>" >> $of
-fi
-
-echo "<hr>" >> $of
-echo "<a href=\"../\">back to top</a>" >> $of
-
-echo "</body></html>" >>$of
--- Tools/portbuild/scripts/updatefailure
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-#
-# Update the format of the failure file from the old-style (alphanumeric
-# date, and only tracks latest failure date).
-#
-# This must be called via:
-#
-# lockf -k ${pb}/${arch}/${branch}/failure.lock ${pb}/scripts/updatefailure ${arch} ${branch}
-#
-# to avoid racing with any package builds in progress that might try to append to
-# these files.
-
-# configurable variables
-pb=/var/portbuild
-
-cleanup() {
- echo "Problem writing new failure file!"
- rm -f failure.new
- exit 1
-}
-
-if [ $# -ne 2 ]; then
- echo "updatefailure <arch> <branch>"
- exit 1
-fi
-
-arch=$1
-branch=$2
-shift 2
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-buildenv ${pb} ${arch} ${branch}
-
-home=${pb}/${arch}/${branch}
-cd $home
-
-echo "===> Updating old failure file"
-
-rm -f failure.new
-tr -s ' ' '_' < failure > failure2
-mv failure2 failure
-
-IFS='|'
-while read dir name ver date count; do
-
- entry=$(grep "^$dir|" newfailure)
- if [ -z "$entry" ]; then
- echo $dir not in newfailures
- olddate=0
- else
- olddate=$(echo $entry | cut -f 4 -d \ )
- echo $dir has olddate $olddate
- fi
-
- if (echo $olddate | grep '_'); then
- date2=$(echo $olddate | tr -s '_' ' ')
- echo $date2
- olddate=$(date -j -f %+ "$date2" +%s)
- echo Updating to $olddate
- fi
-
- if (echo $date | grep '_'); then
- date2=$(echo $date | tr -s '_' ' ')
- echo $date2
- date=$(date -j -f %+ "$date2" +%s)
- echo Updating to $date
- fi
-
- (echo "$dir|$name|$ver|$olddate|$date|$count" >> $home/failure.new) || cleanup
-done < $home/failure
-
-mv failure.new failure
--- Tools/portbuild/scripts/makeindex
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-# usage: $0 arch branch
-
-# Don't want to pick up bento customizations
-INDEX_PRISTINE=1
-
-# Don't give luser advice if it fails
-INDEX_QUIET=1
-
-# Concurrency of index build
-INDEX_JOBS=2
-
-pb=/var/portbuild
-arch=$1
-shift
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-usage () {
- echo "usage: makeindex arch branch"
- exit 1
-}
-
-if [ $# != 1 ]; then
- usage
-fi
-
-case "x$1" in
- x4)
- branch=4
- INDEXFILE=INDEX
- ;;
- x4-exp)
- branch=4-exp
- INDEXFILE=INDEX
- ;;
- x5)
- branch=5
- INDEXFILE=INDEX-5
- ;;
- x5-exp)
- branch=5-exp
- INDEXFILE=INDEX-5
- ;;
- x6)
- branch=6
- INDEXFILE=INDEX-6
- ;;
- x6-exp)
- branch=6-exp
- INDEXFILE=INDEX-6
- ;;
- x7)
- branch=7
- INDEXFILE=INDEX-7
- ;;
- *)
- usage
- ;;
-esac
-
-# Set up the build env variables
-buildenv ${pb} ${arch} ${branch}
-
-unset DISPLAY
-
-# Don't pick up installed packages from the host
-export LOCALBASE=/nonexistentlocal
-export X11BASE=/nonexistentx
-
-cd ${PORTSDIR}
-make index
-# remove extra spaces in dependency list -- this causes problems
-# Also transform the dummy paths to their canonical locations
-sed -e 's/ */ /g' -e 's/| */|/g' -e 's/ *|/|/g' -e "s,${LOCALBASE},/usr/local," -e "s,${X11BASE},/usr/X11R6," ${INDEXFILE} > ${INDEXFILE}.tmp
-
-mv -f ${INDEXFILE}.tmp ${INDEXFILE}
--- Tools/portbuild/scripts/cpdistfiles
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-if [ $# != 1 ]; then
- echo "usage: $0 branch"
- exit 1
-fi
-
-# configurable variables
-pb=/var/portbuild
-
-. ${pb}/portbuild.conf
-
-unset DISPLAY
-
-branch=$1
-shift
-
-# copy one distfile to remote host
-cpdistfile () {
- tar -C distfiles -cf - $1 | ssh $ftpsite -l $user tar -C $distfiledir --unlink -xvf -
-}
-
-echo "================================================"
-echo "md5 generation started at $(date)"
-
-cd $pb/${branch}/bak/distfiles
-find . -type f | sort | xargs md5 > ../../md5-2
-
-echo "================================================"
-echo "copying started at $(date)"
-
-cd $pb/${branch}/bak
-for i in $(diff ../md5 ../md5-2 | grep '^>' | sed -e 's^.*(\./^^' -e 's/).*//'); do
- cpdistfile $i
-done
-mv ../md5-2 ../md5
-
-echo "================================================"
-echo "all done at $(date)"
--- Tools/portbuild/scripts/prunebad
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-# configurable variables
-pb=/var/portbuild
-
-if [ $# -ne 2 ]; then
- echo "prunebad <arch> <branch>"
- exit 1
-fi
-
-arch=$1
-branch=$2
-shift 2
-
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-buildenv ${pb} ${arch} ${branch}
-
-cd ${pb}/${arch}/${branch}
-
-if [ -f .packagelock ]; then exit; fi
-touch .packagelock
-
-cd packages/All
-if [ ! -f .packagestamp ]; then
- newfiles=$(find . -name \*${PKGSUFFIX})
-else
- newfiles=$(find . -name \*${PKGSUFFIX} -newer ../../.packagestamp)
-fi
-touch ../../.packagestamp
-echo Checking $newfiles
-
-mkdir -p ${pb}/${arch}/${branch}/bad
-echo "checking packages"
-for i in ${newfiles}; do
- if ! ${PKGZIPCMD} -t $i; then
- echo "Warning: package $i is bad, moving to ${pb}/${arch}/${branch}/bad"
- # the latest link will be left behind...
- mv $i ${pb}/${arch}/${branch}/bad
- rm ../*/$i
- fi
-done
-cd ../..
-rm .packagelock
\ No newline at end of file
--- Tools/portbuild/scripts/makeduds
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-# usage: $0 arch branch
-
-# configurable variables
-pb=/var/portbuild
-arch=$1
-shift
-
-. ${pb}/${arch}/portbuild.conf
-
-. ${pb}/scripts/buildenv
-
-# -j# to make duds
-DUDSJOBS=1
-
-usage () {
- echo "usage: makeduds branch"
- exit 1
-}
-if [ $# != 1 ]; then
- usage
-fi
-
-branch=$1
-
-buildenv ${pb} ${arch} ${branch}
-
-duds=${pb}/${arch}/${branch}/duds
-index=${PORTSDIR}/${INDEXFILE}
-
-unset DISPLAY
-
-export PACKAGE_BUILDING=1
-cd ${PORTSDIR}
-make -j${DUDSJOBS} ignorelist ECHO_MSG=true > ${duds} || exit 1
-sort ${duds} > ${duds}.tmp
-mv -f ${duds}.tmp ${duds}
-
-cp ${duds} ${duds}.orig
-grep -Ff ${duds}.orig ${index} | cut -f 1 -d \| > ${duds}.full
--- Tools/portbuild/scripts/pdispatch
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/sh
-#
-# pdispatch <arch> <branch> <command> <package.tgz> [<args> ...]
-#
-# Choose a random machine from ${buildroot}/ulist and dispatch the
-# job to it via the ptimeout script.
-
-pb=/var/portbuild
-arch=$1
-shift
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/scripts/buildenv
-
-# Increase timeout on slow build machines
-if [ "$arch" = "alpha" -o "$arch" = "sparc64" ]; then
- # wait 16 hours maximum
- timeout=57600
-else
- # wait 80 hours maximum
- timeout=288000
-fi
-
-branch=$1
-command=$2
-shift 2
-
-buildenv ${pb} ${arch} ${branch}
-
-# ssh -x doesn't work on some machines
-unset DISPLAY
-
-pkgname=$(basename $1 ${PKGSUFFIX})
-
-if grep -qxF ${pkgname} ${pb}/${arch}/${branch}/duds; then
- echo "skipping ${pkgname}"
- exit 1
-fi
-
-if [ -z "${pkgname}" ]; then
- echo "null packagename"
- exit 1
-fi
-
-args=${1+"$@"}
-flags=""
-clean=1
-if [ "x$NOCLEAN" != "x" ]; then
- flags="${flags} -noclean"
- clean=0
-fi
-if [ "x$NO_RESTRICTED" != "x" ]; then
- flags="${flags} -norestr"
-fi
-if [ "x$NOPLISTCHECK" != "x" ]; then
- flags="${flags} -noplistcheck"
-fi
-if [ "x$WANT_DISTFILES" != "x" ]; then
- flags="${flags} -distfiles"
-fi
-if [ "x$FETCH_ORIGINAL" != "x" ]; then
- flags="${flags} -fetch-original"
-fi
-if [ "x$TRYBROKEN" != "x" ]; then
- flags="${flags} -trybroken"
-fi
-
-while `true`; do
- host=
- chroot=
- while [ -z "${host}" -o -z "${chroot}" ]; do
- chroot=
- host=$(lockf -k ${pb}/${arch}/queue/.lock ${pb}/scripts/getmachine ${pb} ${arch} ${branch})
- # If ulist is empty, then all build machines are busy, so try again in 15 seconds.
- if [ -z "${host}" ]; then
- sleep 15
- else
- . ${pb}/${arch}/portbuild.conf
- test -f ${pb}/${arch}/portbuild.${host} && . ${pb}/${arch}/portbuild.${host}
- chroot=$(ssh -a -n ${client_user}@${host} ${sudo_cmd} ${pb}/scripts/claim-chroot ${arch} ${branch} ${pkgname})
- if [ -z "${chroot}" ]; then
- echo "Failed to claim chroot on ${host}"
- lockf -k ${pb}/${arch}/queue/.lock ${pb}/scripts/releasemachine ${arch} ${host}
- fi
- fi
- done
-
- . ${pb}/${arch}/portbuild.conf
- test -f ${pb}/${arch}/portbuild.${host} && . ${pb}/${arch}/portbuild.${host}
-
- rm -f ${pb}/${arch}/${branch}/logs/${pkgname}.log ${pb}/${arch}/${branch}/logs/${pkgname}.log.bz2
- rm -f ${pb}/${arch}/${branch}/errors/${pkgname}.log ${pb}/${arch}/${branch}/errors/${pkgname}.log.bz2
-
- echo "dispatching: ssh -a -t -n ${client_user}@${host} ${sudo_cmd} ${command} ${arch} ${branch} ${chroot} ${flags} \"$ED\" \"$PD\" \"$FD\" \"$BD\" \"$RD\" ${args}"
- ${pb}/scripts/ptimeout.host $timeout ssh -a -t -n ${client_user}@${host} ${sudo_cmd} ${command} ${arch} ${branch} ${chroot} ${flags} \"$ED\" \"$PD\" \"$FD\" \"$BD\" \"$RD\" ${args} 2>&1
- error=$?
-
- #if grep -q " failed unexpectedly on " ${pb}/${arch}/${branch}/logs/${pkgname}.pre.log; then
- # cat ${pb}/${arch}/${branch}/logs/${pkgname}.pre.log | mail -s "${pkgname} failed uncleanly on ${arch} ${branch}" ${mailto}
- #else
- # rm ${pb}/${arch}/${branch}/logs/${pkgname}.pre.log
- #fi
-
- # Pull in the results of the build from the client
-
- scp ${client_user}@${host}:${chroot}/tmp/${pkgname}.log ${pb}/${arch}/${branch}/logs/${pkgname}.log
- (ssh -a -n ${client_user}@${host} test -f ${chroot}/tmp/work.tbz ) && scp ${client_user}@${host}:${chroot}/tmp/work.tbz ${pb}/${arch}/${branch}/wrkdirs/${pkgname}.tbz
-
- # XXX Set dirty flag if any of the scp's fail
-
- mkdir -p ${pb}/${arch}/${branch}/distfiles/.pbtmp/${pkgname}
- ssh -a -n ${client_user}@${host} tar -C ${chroot}/tmp/distfiles -cf - . | \
- tar --unlink -C ${pb}/${arch}/${branch}/distfiles/.pbtmp/${pkgname} -xvf -
- touch ${pb}/${arch}/${branch}/distfiles/.pbtmp/${pkgname}/.done
-
- if [ "${error}" = 0 ]; then
- ssh -a -n ${client_user}@${host} tar -C ${chroot}/tmp -cf - packages | \
- tar --unlink -C ${pb}/${arch}/${branch} -xvf -
- test -f ${pb}/${arch}/${branch}/packages/All/${pkgname}${PKGSUFFIX} && \
- touch ${pb}/${arch}/${branch}/packages/All/${pkgname}${PKGSUFFIX}
- rm -f ${pb}/${arch}/${branch}/errors/${pkgname}.log
- lockf -k ${pb}/${arch}/${branch}/failure.lock ${pb}/scripts/buildsuccess ${arch} ${branch} ${pkgname}
- log=${pb}/${arch}/${branch}/logs/$pkgname.log
- if grep -q "even though it is marked BROKEN" ${log}; then
- echo | mail -s "${pkgname} BROKEN but built on ${arch} ${branch}" ${mailto}
- fi
- if grep -q "^list of .*file" ${log}; then
- buildlogdir=$(realpath ${pb}/${arch}/${branch}/logs/)
- baselogdir=$(basename ${buildlogdir})
- (sed -e '/^build started/,$d' $log;echo;echo "For the full build log, see"; echo; echo " http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$(basename $log)";echo;sed -e '1,/^=== Checking filesystem state/d' $log) | mail -s "${pkgname} pkg-plist errors on ${arch} ${branch}" ${mailto}
- fi
- else
- log=${pb}/${arch}/${branch}/errors/${pkgname}.log
- scp ${client_user}@${host}:${chroot}/tmp/${pkgname}.log ${log} || (echo ${chroot}@${host}; ssh -a -n ${client_user}@${host} ls -laR ${chroot}/tmp) | mail -s "${pkgname} logfile not found" ${mailto}
- if ! grep -q "even though it is marked BROKEN" ${log}; then
- tail -1000 ${log} | mail -s "${pkgname} failed on ${arch} ${branch}" ${mailto}
- fi
- lockf -k ${pb}/${arch}/${branch}/failure.lock ${pb}/scripts/buildfailure ${arch} ${branch} ${pkgname}
- fi
-
- ssh -a -n ${client_user}@${host} ${sudo_cmd} ${pb}/scripts/clean-chroot ${arch} ${branch} ${chroot} ${clean}
-
- lockf -k ${pb}/${arch}/queue/.lock ${pb}/scripts/releasemachine ${arch} ${host}
-
- # XXX Set a dirty variable earlier and check here
- if grep -q "^build of .*ended at" ${pb}/${arch}/${branch}/logs/${pkgname}.log; then
- exit ${error}
- else
- echo "Build of ${pkgname} in ${host}:/${chroot} failed uncleanly, rebuilding"
- sleep 120
- fi
-done
--- Tools/portbuild/scripts/dologs
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-pb=/var/portbuild
-arch=$1
-
-. ${pb}/${arch}/portbuild.conf
-
-home=${pb}/errorlogs
-scripts=${pb}/scripts
-
-for ver in latest full; do
- for num in 4 4-exp 5 5-exp 6 6-exp 7; do
- cd $home/$arch-$num-$ver && ${scripts}/processlogs ${arch}
- cd ${pb}/${arch}/${num} && ${scripts}/processfail ${arch} ${num}
- done
- for num in 4 4-exp 5 5-exp 6 6-exp 7; do
- cd $home/$arch-$num-$ver-logs && ${scripts}/processlogs2
- done
-# for num in 5 6 6-exp 7; do
-# cd $home && ${scripts}/comparelogs ${arch} $num-$ver 4-$ver
-# cd $home && ${scripts}/comparelogs ${arch} 4-$ver $num-$ver
-# done
- cd $home && ${scripts}/bothlogs ${arch} 4-$ver 5-$ver
-done
--- Tools/portbuild/scripts/clean-chroot
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-
-kill_procs()
-{
- dir=$1
- mount=$2
-
- pids="XXX"
- while [ ! -z "${pids}" ]; do
- pids=$(fstat -f "${dir}${mount}" | tail +2 | awk '{print $3}' | sort -u)
- if [ ! -z "${pids}" ]; then
- echo "Killing off pids in ${dir}"
- ps -p $pids
- kill -KILL ${pids} 2> /dev/null
- sleep 2
- fi
- done
-}
-
-cleanup_mount() {
- chroot=$1
- mount=$2
-
- if [ -d ${chroot}${mount} ]; then
- mdir=$(fstat -f ${chroot}${mount} | head -2 | tail -1 | awk '{print $5}')
- if [ "${mdir}" = "MOUNT" ]; then
- umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!"
- fi
- if [ "${mdir}" = "${chroot}${mount}" ]; then
- kill_procs ${chroot} ${mount}
- umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!"
- fi
- fi
-}
-
-arch=$1
-branch=$2
-chroot=$3
-clean=$4
-
-pb=/var/portbuild
-. ${pb}/${arch}/portbuild.conf
-. ${pb}/${arch}/portbuild.$(hostname)
-. ${pb}/scripts/buildenv
-buildenv ${pb} ${arch} ${branch}
-
-# directories to clean
-cleandirs="${LOCALBASE} ${X11BASE} /compat /var/db/pkg"
-
-if [ ! -d "${chroot}" ]; then
- exit 0
-fi
-
-if [ `realpath ${chroot}` = "/" ]; then
- # Don't spam the root file system if something has gone wrong!
- exit 1
-fi
-
-if [ -f ${chroot}/tmp/jail.id ]; then
- pgrep -lfj `awk '{print $1}' ${chroot}/tmp/jail.id`
- pkill -j `awk '{print $1}' ${chroot}/tmp/jail.id`
-fi
-
-#umount ${chroot}/proc
-
-if [ ${arch} = "i386" -o ${arch} = "amd64" ]; then
- cleanup_mount ${chroot} /compat/linux/proc
-fi
-
-for i in /a/ports /usr/src /dev; do
- cleanup_mount ${chroot} ${i}
-done
-
-#kill_procs ${chroot}
-
-if [ "${use_md_swap}" = "1" ]; then
- if [ "${clean}" -gt "0" ]; then
- cleanup_mount ${chroot} ""
- mdconfig -d -u $(basename ${chroot})
- rm -rf ${chroot}
- fi
-else
- if [ "${clean}" = 1 ]; then
- rm -rf ${chroot}/tmp/*
- for dir in ${cleandirs}; do
- if ! rm -rf ${chroot}${dir} >/dev/null 2>&1; then
- chflags -R noschg ${chroot}${dir} >/dev/null 2>&1
- rm -rf ${chroot}${dir} >/dev/null 2>&1
- fi
- done
- test -x ${chroot}/sbin/ldconfig && chroot ${chroot} /sbin/ldconfig -R
- if [ ${arch} = "i386" ]; then
- test -x ${chroot}/sbin/ldconfig && chroot ${chroot} /sbin/ldconfig -aout -R
- fi
- rm -rf ${chroot}/var/db/pkg/*
- rm -rf ${chroot}/used
- elif [ "${clean}" = 2 ]; then
- if ! rm -rf ${chroot} >/dev/null 2>&1; then
- chflags -R noschg ${chroot} >/dev/null 2>&1
- rm -rf ${chroot} >/dev/null 2>&1
- fi
- fi
-fi
More information about the Midnightbsd-cvs
mailing list