diff options
author | kris <kris@FreeBSD.org> | 2003-10-13 10:52:58 +0800 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2003-10-13 10:52:58 +0800 |
commit | deeb4390afe5c87e0d466de9cf6dabb54de88fa6 (patch) | |
tree | 30a73de7f8a25ad03e0d828d7281362efb10e3ed /Tools/portbuild | |
parent | eec57a6e2ce31c46ab3e11f98d534daba45de3bc (diff) | |
download | freebsd-ports-gnome-deeb4390afe5c87e0d466de9cf6dabb54de88fa6.tar.gz freebsd-ports-gnome-deeb4390afe5c87e0d466de9cf6dabb54de88fa6.tar.zst freebsd-ports-gnome-deeb4390afe5c87e0d466de9cf6dabb54de88fa6.zip |
* Try to be more careful when writing the failure file in case the disk
is full
* The newfailure file is no longer maintained, but generated as-needed
by the processfail script
* Update format of failure file (records both initial failure date and
most recent failure date)
Diffstat (limited to 'Tools/portbuild')
-rwxr-xr-x | Tools/portbuild/scripts/buildfailure | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/Tools/portbuild/scripts/buildfailure b/Tools/portbuild/scripts/buildfailure index 789b9d711997..f95d96de1624 100755 --- a/Tools/portbuild/scripts/buildfailure +++ b/Tools/portbuild/scripts/buildfailure @@ -2,6 +2,12 @@ # # buildfailure <arch> <branch> <pkgname> +cleanup() { + echo "Problem writing new failure file!" + rm -f failure.new + exit 1 +} + # configurable variables pb=/var/portbuild arch=$1 @@ -26,21 +32,18 @@ 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 +%s| tr ' ' '_')|$((${count}+1))" >> failure.new +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 - # Want newfailure to be in reverse chronological order - mv newfailure newfailure.new - echo "${portloc}|${pkgbase}|${pkgname}|$(date +%s| tr ' ' '_')" > newfailure - cat newfailure newfailure.new > newfailure.new2 - mv newfailure.new2 newfailure - rm newfailure.new - - echo "${portloc}|${pkgbase}|${pkgname}|$(date +%s)|1" >> failure + (echo "${portloc}|${pkgbase}|${pkgname}|${date}|${date}|1" >> failure) || cleanup fi |