diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2003-10-13 02:52:58 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2003-10-13 02:52:58 +0000 |
commit | 6c56f2eb95c8513dffad1fcc9af6f643e8ca681f (patch) | |
tree | b63305e60f456aa09cff39da8615d87dea8b6a46 /Tools/portbuild | |
parent | Fix strange permissions on directories which fail to make the port (diff) |
* 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)
Notes
Notes:
svn path=/head/; revision=90973
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 |