debian-cd-clone/wheezy/contrib/mklist

21 lines
461 B
Plaintext
Raw Normal View History

2013-05-06 13:08:31 +00:00
#!/bin/sh
export LC_ALL=C
for FILE in $@; do
if [ -e "$FILE" ] ; then
ISODIR=`dirname $FILE`
LISTDIR=`echo $ISODIR | sed 's/iso-/list-/'`
if [ ! -d $LISTDIR ] ; then
mkdir -p $LISTDIR
fi
LISTFILE=`echo $FILE | sed 's/\.iso$/.list.gz/g'`
isoinfo -fR -i $FILE | perl -e '
while (<>) {
chomp;m,^/pool/[^/]+/[^/]+/[^/]+/(.*), and print "$1\n";
}' | sort | gzip -9 > $LISTFILE
mv $LISTFILE $LISTDIR
fi
done