Fix removal of symlinks (.debs removed)
[git-tools-moved-to-github.git] / update-archive / update-archive.sh
index e60a9a1..17d4b29 100755 (executable)
@@ -16,7 +16,7 @@ confdir=`pwd`
 
 architectures="i386 amd64"
 
-for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty debian/squeeze debian/lenny debian/etch debian/sarge debian/woody; do
+for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karmic debian/squeeze debian/lenny debian/etch; do
        dist=`basename $vdist`
        vendor=`dirname $vdist`
        ftpdir=/home/ftp/pub/$vendor
@@ -29,20 +29,21 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty debian/sque
        # Uncomment to clean the .db (cache)
        # rm tmp/*
 
-       # Make symlinks from the regular FTP archive
+       # Prepare pool
        d=pool/dists/$dist
        if test ! -d $d; then mkdir -p $d; fi
-       # Remove invalid symlinks
-       for l in $d/*; do
+       mkdir -p $d/source
+       # Remove invalid symlinks (source, i386, amd64,..)
+       for l in $d/*/*; do
                if test -L $l; then
                        if test ! -f $l; then
                                rm $l
                        fi
                fi
        done
-       mkdir -p $d/source
-       ln -sf /home/ftp/pub/*/$vendor/$dist/* $d/source
-       rm $d/source/*.deb
+       # Make symlinks from the regular FTP archive
+       ln -sf /home/ftp/pub/*/$vendor/$dist/*.dsc $d/source
+       ln -sf /home/ftp/pub/*/$vendor/$dist/*.gz $d/source
        for arch in $architectures; do
                mkdir -p $d/${arch}
                for f in /home/ftp/pub/*/$vendor/$dist/*_${arch}.* \