#!/bin/sh

for dir in binary-i386 binary-sparc binary-all; do
	cd /var/www/debian.ipsyn.net/htdocs/debian/dists/woody/all/$dir
	ln -s ../../*/$dir/*.deb . > /dev/null 2>&1
	cd /var/www/debian.ipsyn.net/htdocs/debian/dists/sarge/all/$dir
        ln -s ../../*/$dir/*.deb . > /dev/null 2>&1

done

cd /var/www/debian.ipsyn.net/htdocs/debian

for dir in ` find . -name binary-i386 -type d`; do 
	echo "dpkg-scanpackages $dir /dev/null 2> /dev/null | gzip -cf > $dir/Packages.gz";
	dpkg-scanpackages $dir /dev/null 2> /dev/null | gzip -cf > $dir/Packages.gz;
done

for dir in ` find . -name binary-sparc -type d`; do
        echo "dpkg-scanpackages $dir /dev/null 2> /dev/null | gzip -cf > $dir/Packages.gz";
        dpkg-scanpackages $dir /dev/null 2> /dev/null | gzip -cf > $dir/Packages.gz;
done

for dir in ` find . -name binary-all -type d`; do
        echo "dpkg-scanpackages $dir /dev/null 2> /dev/null | gzip -cf > $dir/Packages.gz";
        dpkg-scanpackages $dir /dev/null 2> /dev/null | gzip -cf > $dir/Packages.gz;
done

for dir in ` find . -name source -type d`; do
	echo "dpkg-scansources $dir | gzip -cf > $dir/Sources.gz";
	dpkg-scansources $dir | gzip -cf > $dir/Sources.gz;
done

