diff options
author | brian <brian@FreeBSD.org> | 2002-06-06 00:18:49 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2002-06-06 00:18:49 +0000 |
commit | 0a075ee9e1c8bf6843356d6b6264ed72e41fdfa9 (patch) | |
tree | 298c22890fb837f2b7e456b9b746b5a530c2b31f /release | |
parent | 838811de260740aadde974eee6ddf063010c4509 (diff) | |
download | FreeBSD-src-0a075ee9e1c8bf6843356d6b6264ed72e41fdfa9.zip FreeBSD-src-0a075ee9e1c8bf6843356d6b6264ed72e41fdfa9.tar.gz |
A script to generate all of the packages/*/* symlinks described in the INDEX
Diffstat (limited to 'release')
-rwxr-xr-x | release/scripts/mkpkghier | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/release/scripts/mkpkghier b/release/scripts/mkpkghier new file mode 100755 index 0000000..9f59512 --- /dev/null +++ b/release/scripts/mkpkghier @@ -0,0 +1,33 @@ +#! /bin/sh +# +# $FreeBSD$ + +usage() +{ + echo "$*" >&2 + echo "This script must be run from the top level package directory" >&2 + exit 1 +} + +[ $# -ge 1 ] && usage "usage: mkpkghier" +[ -f INDEX ] || usage "INDEX file not found" +[ -d All ] || usage "All directory not found" + +old=$(ls | egrep -v "^INDEX$|^All$|^Latest$") + +[ -n "$old" ] && { echo Removing old hierarchy; rm -fr $old; } + +echo Creating new hierarchy +awk -F'|' '{ print $1 " " $7; }' INDEX | while read pkg dirs +do + [ -f All/$pkg.tgz ] || { + echo "All/$pkg.tgz: Non-existent" >&2 + continue + } + for dir in $dirs + do + mkdir -p $dir + [ -e $dir/$pkg.tgz ] && continue + ln -s ../All/$pkg.tgz $dir/$pkg.tgz + done +done |