#! /bin/sh if [ "$1" = packages -o -z "$1" ]; then type=packages topdir=binary-i386 outfile=Packages elif [ "$1" = sources ]; then type=sources topdir=source outfile=Sources else echo "Usage: $0 packages|sources" >&2 exit 1 fi echo Searching for $type ... for x in main non-US/main non-free; do echo Scanning $x ... dir=dists/unstable/$x/$topdir if [ -e $dir ]; then dpkg-scan$type $dir /dev/null > $dir/$outfile gzip -c $dir/$outfile > $dir/$outfile.gz else echo $x not found. fi done