#!/bin/sh
if [ -z $1 ] ; then
    LIST=`ls -d pool/*/*`
elif [ -z $2 ] ; then
    LIST=`ls -d pool/$1/*`
else
    LIST=pool/$1/$2
fi
echo $LIST
for f in $LIST ; do
Paquet=`echo $f | sed -e 's/pool/dists/' | sed -e 's|/\([^/]*\)$|/divers/binary-\1/Packages|'`
echo -n $Paquet...
dpkg-scanpackages $f override  | gzip > $Paquet.gz
zcat $Paquet.gz | bzip2 > $Paquet.bz2
echo fait
done