A script to generate all of the packages/*/* symlinks described in the INDEX

This commit is contained in:
Brian Somers 2002-06-06 00:18:49 +00:00
parent 4b5395fccb
commit 50e7d6539c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97900

33
release/scripts/mkpkghier Executable file
View File

@ -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