aboutsummaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2004-03-08 10:01:24 +0800
committerKris Kennaway <kris@FreeBSD.org>2004-03-08 10:01:24 +0800
commitf71e6907792e3453cb64c64e05b2a5d12622cf97 (patch)
tree66d8c005b84634a5621a53c750f79b401e538aed /Tools
parentf2138752d24a8383445cc9298eb0ccb863b53fe3 (diff)
downloadfreebsd-ports-gnome-f71e6907792e3453cb64c64e05b2a5d12622cf97.tar.gz
freebsd-ports-gnome-f71e6907792e3453cb64c64e05b2a5d12622cf97.tar.zst
freebsd-ports-gnome-f71e6907792e3453cb64c64e05b2a5d12622cf97.zip
Verify the archive integrity of a package set, and move aside any that
are found to be bad. Not currently in use, since we do not experience package corruption and this takes quite a while to run.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/portbuild/scripts/prunebad45
1 files changed, 45 insertions, 0 deletions
diff --git a/Tools/portbuild/scripts/prunebad b/Tools/portbuild/scripts/prunebad
new file mode 100644
index 000000000000..ddcc709bb099
--- /dev/null
+++ b/Tools/portbuild/scripts/prunebad
@@ -0,0 +1,45 @@
+#!/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