Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/git-tools
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 4 May 2010 12:09:00 +0000 (14:09 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 4 May 2010 12:09:00 +0000 (14:09 +0200)
update-archive/README [deleted file]
update-archive/apt-ftparchive.conf.in
update-archive/apt-release.conf.in
update-archive/update-archive.sh

diff --git a/update-archive/README b/update-archive/README
deleted file mode 100644 (file)
index 73a8937..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Debian users can add the following two lines in /etc/apt/sources.list
-and use Debians own package management tools, apt-get, aptitude, or dselect.
-Replace sarge with etch or lenny if you are using these versions of Debian.
-As of August 2007, sarge is old stable, etch is stable, lenny is
-testing.
-
-deb http://ftp.indexdata.dk/debian etch main
-deb-src http://ftp.indexdata.dk/debian etch main
-
-These packages are signed with a key you can install as follows:
- wget http://ftp.indexdata.dk/debian/indexdata.asc
- sudo apt-key add indexdata.asc
index 92047d2..f5fa5e9 100644 (file)
@@ -5,6 +5,7 @@
 // The debian archive should be in the current working dir
 Dir {
        ArchiveDir ".";
+       OverrideDir ".";
        CacheDir "tmp";
 };
 
@@ -34,9 +35,9 @@ TreeDefault {
 };
 
 Tree "dists/@dist@" {
-       Sections "main restricted";
+       Sections "@sections@";
        Architectures "source @architectures@";
-       SrcOverride "/dev/null";
+       SrcOverride "override";
 };
 // By default all Packages should have the extension ".deb"
 //Default {
index babe45a..ca329a2 100644 (file)
@@ -3,5 +3,5 @@ APT::FTPArchive::Release::Label "Indexdata";
 APT::FTPArchive::Release::Suite "@dist@";
 APT::FTPArchive::Release::Codename "@dist@";
 APT::FTPArchive::Release::Architectures "@architectures@";
-APT::FTPArchive::Release::Components "main restricted";
+APT::FTPArchive::Release::Components "@sections@";
 APT::FTPArchive::Release::Description "Index Data Debian packages";
index 6f96c09..c8da2ed 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/sh
-# $Id: update-archive.sh,v 1.13 2008-10-20 10:24:15 adam Exp $
 if test ! -f apt-ftparchive.conf.in; then
        echo "$0: apt-ftparchive.conf.in must be located in current directory"
        exit 1
@@ -29,6 +28,7 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm
        # Uncomment to clean the .db (cache)
        # rm tmp/*
 
+       sections=""
        for section in main restricted; do
                # Prepare pool
                d=pool/dists/$dist/$section
@@ -43,6 +43,7 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm
                        fi
                done
                # Make symlinks from the regular FTP archive
+               has_packages=false
                for pdir in /home/ftp/pub/*; do
                        use=false
                        if test -f $pdir/.htaccess -a $section != "main"; then
@@ -63,6 +64,7 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm
                                                        $distdir/*_all.*; do
                                                    if test -f $f; then
                                                            ln -sf $f $d/${arch}
+                                                           has_packages=true
                                                    fi
                                                done
                                        done
@@ -70,36 +72,47 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm
                        fi
                done
                # ${confdir}/symclean.sh $d
-               
-               for arch in $architectures; do
-                       d=dists/$dist/$section/binary-$arch
+
+               rm -f $d/Release
+               if $has_packages; then
+                       if test -z "$sections"; then
+                               sections="$section"
+                       else
+                               sections="$sections $section"
+                       fi
+                       for arch in $architectures; do
+                               d=dists/$dist/$section/binary-$arch
+                               if test ! -d $d; then mkdir -p $d; fi
+                               echo "Archive: $dist" >$d/Release
+                               echo "Component: $section" >>$d/Release
+                               echo 'Origin: Indexdata' >>$d/Release
+                               echo "Architecture: $arch" >>$d/Release
+                       done
+                       d=dists/$dist/$section/source
                        if test ! -d $d; then mkdir -p $d; fi
                        echo "Archive: $dist" >$d/Release
                        echo "Component: $section" >>$d/Release
                        echo 'Origin: Indexdata' >>$d/Release
-                       echo "Architecture: $arch" >>$d/Release
-               done
-               
-               d=dists/$dist/$section/source
-               if test ! -d $d; then mkdir -p $d; fi
-               echo "Archive: $dist" >$d/Release
-               echo "Component: $section" >>$d/Release
-               echo 'Origin: Indexdata' >>$d/Release
-               echo 'Architecture: source' >>$d/Release
+                       echo 'Architecture: source' >>$d/Release
+               fi
        done
        # generate
-       echo "Begin Generate $dist"
+       echo "Begin Generate $dist: $sections"
        F=apt-ftparchive.conf
-       sed "s/@dist@/$dist/g" <${confdir}/${F}.in |sed "s/@architectures@/${architectures}/g" > $F
+       sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
+               sed "s/@architectures@/${architectures}/g" | \
+               sed "s/@sections@/${sections}/g" > $F
        # Don't know if clean is needed!
        # apt-ftparchive clean apt-ftparchive.conf
        apt-ftparchive generate apt-ftparchive.conf
-       echo "Done generate $dist"
+       echo "Done generate $dist: $sections"
 
        # release
        r=dists/$dist/Release
        F=apt-release.conf
-       sed "s/@dist@/$dist/g" <${confdir}/${F}.in | sed "s/@architectures@/${architectures}/g" >$F
+       sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
+               sed "s/@architectures@/${architectures}/g" | \
+               sed "s/@sections@/${sections}/g" > $F
        # Move Release file away while calling using release 
        rm $r
        apt-ftparchive -c $F release dists/$dist >tmp_Release