diff options
author | kris <kris@FreeBSD.org> | 2008-07-26 22:14:35 +0800 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2008-07-26 22:14:35 +0800 |
commit | a1adea8f2b37681d9758ec200325d2f7cd4f2568 (patch) | |
tree | c74bbb2cade0d273962f379dc0f4ac5323cdddd1 /Tools | |
parent | e6fd7f6eca283817f74974ae44b3c142e34277fc (diff) | |
download | freebsd-ports-gnome-a1adea8f2b37681d9758ec200325d2f7cd4f2568.tar.gz freebsd-ports-gnome-a1adea8f2b37681d9758ec200325d2f7cd4f2568.tar.zst freebsd-ports-gnome-a1adea8f2b37681d9758ec200325d2f7cd4f2568.zip |
* Catch up to build ID directory changes
* Optimize by copying old packages using cpio -dumpl (i.e. create hardlink
instead of copying the file).
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/portbuild/scripts/keeprestr | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/Tools/portbuild/scripts/keeprestr b/Tools/portbuild/scripts/keeprestr index 01b487ab1e7c..22b72cac76f2 100755 --- a/Tools/portbuild/scripts/keeprestr +++ b/Tools/portbuild/scripts/keeprestr @@ -1,11 +1,32 @@ -#!/bin/sh +#!/bin/sh -x + +usage () { + echo "usage: keeprestr arch branch buildid" + exit 1 +} + +if [ $# -ne 3 ]; then + usage +fi arch=$1 branch=$2 +buildid=$3 + +pb=/var/portbuild + +. ${pb}/scripts/buildenv + +buildid=$(resolve ${pb} ${arch} ${branch} ${buildid}) +if [ -z "${buildid}" ]; then + echo "Invalid build ID ${buildid}" + exit 1 +fi -cd /var/portbuild/${arch}/${branch} +builddir=${pb}/${arch}/${branch}/builds/${buildid} +cd ${builddir} 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/ +(tr ';' '\n' < restricted.sh | grep "/bin/rm -f" | awk '{print $3}' | grep packages/ | sed -e "s,${builddir}/,," -e 's,)$,,' | xargs ls -1 2>/dev/null) | cpio -dumpl bak/restricted/ |