move links to the new place, so bob's mirror will run again

This commit is contained in:
espie 2008-07-29 18:00:19 +00:00
parent 7d70a8b03f
commit 2021a1dcbf

View File

@ -12,14 +12,12 @@ DISTDIR=${DISTDIR:-/usr/ports/distfiles}
cd ${DISTDIR}
CIPHERS=${CIPHERS:-sha1 md5 rmd160 sha256}
bdir=by_cipher
# Build the find so that existing cipher dirs are avoided
exclude=''
conn=''
exclude="-type d -name $bdir -prune"
for ci in ${CIPHERS}
do
mkdir -p $ci
exclude="${exclude}${conn}-type d -name $ci -prune"
conn=" -o "
exclude="${exclude} -o -type d -name $ci -prune"
done
echo "find . \( $exclude \) -o -type f -print"
find . \( $exclude \) -o -type f -print | while read i
@ -27,11 +25,10 @@ do
file=`basename $i`
for ci in ${CIPHERS}
do
result=`cksum -a $ci <$i`
mkdir -p $ci/$result
ln -f $i $ci/$result/$file
result=`cksum -a $ci -b <$i`
mkdir -p $ci/$result
ln -f $i $ci/$result/$file
res=`echo $result|sed -e 's,\(..\).*,\1,'`
dir=$bdir/$ci/$res/$result
mkdir -p $dir
ln -f $i $dir/$file
done
done