diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2008-07-26 14:14:35 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2008-07-26 14:14:35 +0000 |
commit | b9dde2b9f84c916cd5b862d4f1a1f886a70c6479 (patch) | |
tree | 8153e914ac9a5309091ff848c4a443292937e19a /Tools | |
parent | 07e904cab8be7e2c82526d56ba3aa1abf3229e82 (diff) | |
download | ports-b9dde2b9f84c916cd5b862d4f1a1f886a70c6479.tar.gz ports-b9dde2b9f84c916cd5b862d4f1a1f886a70c6479.zip |
Notes
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/ |