debian-cd-clone/contrib/mklist

21 lines
465 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
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 | pigz -9nm > $LISTFILE
mv $LISTFILE $LISTDIR
fi
done