summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2003-01-24 05:01:24 +0000
committerKris Kennaway <kris@FreeBSD.org>2003-01-24 05:01:24 +0000
commitdf64a01f6895e0a176a2415fe53d14e2db0fc4fe (patch)
treec8903a226d32c407a403f807d97a89f5badfd34e /Tools
parentSimple script to check the number of packages built on the various (diff)
These scripts are run when a build completes (successfully or not). They
keep track of the number of times a port has failed to build, resetting the counter when it builds successfully. There are still some bugs to be worked out, but this will be used as the basis for maintainer notification of port failures.
Notes
Notes: svn path=/head/; revision=73922
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/buildfailure48
-rwxr-xr-xTools/portbuild/scripts/buildsuccess32
2 files changed, 80 insertions, 0 deletions
diff --git a/Tools/portbuild/scripts/buildfailure b/Tools/portbuild/scripts/buildfailure
new file mode 100755
index 000000000000..cc9d944825cd
--- /dev/null
+++ b/Tools/portbuild/scripts/buildfailure
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# buildfailure <arch> <branch> <pkgname>
+
+# 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}
+if grep -q "^${portloc}|" failure; then
+ count=$(grep "^${portloc}|" failure | cut -f 5 -d \|)
+ grep -v "^${portloc}|" failure > failure.new
+
+ echo "${portloc}|${pkgbase}|${pkgname}|$(date | tr ' ' '_')|$((${count}+1))" >> failure.new
+ mv failure.new failure
+else
+ # Want newfailure to be in reverse chronological order
+ mv newfailure newfailure.new
+ echo "${portloc}|${pkgbase}|${pkgname}|$(date | tr ' ' '_')" > newfailure
+ cat newfailure newfailure.new > newfailure.new2
+ mv newfailure.new2 newfailure
+ rm newfailure.new
+
+ echo "${portloc}|${pkgbase}|${pkgname}|$(date)|1" >> failure
+fi
+
+
+
+
diff --git a/Tools/portbuild/scripts/buildsuccess b/Tools/portbuild/scripts/buildsuccess
new file mode 100755
index 000000000000..f5b0bd686bde
--- /dev/null
+++ b/Tools/portbuild/scripts/buildsuccess
@@ -0,0 +1,32 @@
+#!/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}
+grep -v "^${portloc}|" failure > failure.new
+mv failure.new failure
+
+grep -v "^${portloc}|" newfailure > newfailure.new
+mv newfailure.new newfailure