Merge branch 'master' of ssh://hummus/home/git/pub/git-tools
authorJohn Malconian <malc@indexdata.com>
Tue, 23 Jun 2015 19:04:06 +0000 (19:04 +0000)
committerJohn Malconian <malc@indexdata.com>
Tue, 23 Jun 2015 19:04:06 +0000 (19:04 +0000)
id-deb-build/id-mk-deb-changelog.sh [new file with mode: 0755]
id-deb-build/id-pbuild.sh
id-deb-build/pbuilderrc
update-archive/apt-ftparchive.conf.in
update-archive/apt-release.conf.in [deleted file]
update-archive/update-archive.sh

diff --git a/id-deb-build/id-mk-deb-changelog.sh b/id-deb-build/id-mk-deb-changelog.sh
new file mode 100755 (executable)
index 0000000..6b16884
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+if test ! -f debian/control; then
+    echo "No debian/control"
+    exit 1
+fi
+if test ! -f IDMETA; then
+    echo "No IDMETA"
+    exit 1
+fi
+. ./IDMETA
+DNAME=`awk '/Source:/ {print $2}' debian/control`
+if test "$NAME" -a "$NAME" != "$DNAME"; then
+    echo "NAME in IDMETA ($NAME) does not match debian/control ($DNAME)"
+    exit 1
+fi
+
+DCH=debian/changelog
+if ! git ls-files $DCH --error-unmatch >/dev/null 2>&1; then
+    rm -f $DCH
+    echo "${DNAME} (${VERSION}-1.indexdata) unstable; urgency=medium" >$DCH
+    echo '' >>$DCH
+    echo '  * Upstream.' >>$DCH
+    echo '' >>$DCH
+    echo " -- `git config --get user.name` <`git config --get user.email`>  `date -R`" >>$DCH
+    echo '' >>$DCH
+fi
index 5feb881..e53268e 100755 (executable)
@@ -100,15 +100,8 @@ if $debian; then
            echo "$MKDEBSRC not found"
            exit 1
        fi
-       DCH=debian/changelog
-       if ! git ls-files $DCH --error-unmatch >/dev/null 2>&1; then
-           rm -f $DCH
-           echo "${DNAME} (${VERSION}-1.indexdata) unstable; urgency=medium" >$DCH
-           echo '' >>$DCH
-           echo '  * Upstream.' >>$DCH
-           echo '' >>$DCH
-           echo " -- `git config --get user.name` <`git config --get user.email`>  `date -R`" >>$DCH
-           echo '' >>$DCH
+       if ! ${ID_DEB_BUILD}/id-mk-deb-changelog.sh; then
+           echo "id-mk-deb-changelog.sh failed"
        fi
        if test "${SUDO_USER}"; then
            if test ! -d deb-src; then
@@ -121,6 +114,7 @@ if $debian; then
                    echo "deb-src could not be removed. Remove deb-src manually"
                    exit 1
                fi
+               rm -f deb-src/*.dsc
            fi
            $MKDEBSRC
        fi
index 854060b..25e2150 100644 (file)
@@ -16,9 +16,12 @@ APTCACHE="/var/cache/pbuilder/$NAME/aptcache/"
 ALLOWUNTRUSTED=yes
 CCACHEDIR=
 
+# See https://www.mail-archive.com/debian-bugs-closed@lists.debian.org/msg445261.html  --malc
+USENETWORK=yes
+
 # http://releases.ubuntu.com/releases/
 case "$DIST" in
-    trusty|saucy|raring|quantal|precise|oneiric|natty|maverick|lucid|karmic) # ubuntu specific
+    vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick|lucid|karmic) # ubuntu specific
        # MIRRORSITE="http://ftp.df.lth.se/ubuntu/"
        MIRRORSITE="http://mirrors.dotsrc.org/ubuntu/"
         # MIRRORSITE="http://mirrors.kernel.org/ubuntu/"
index f5fa5e9..c78c35c 100644 (file)
@@ -1,31 +1,26 @@
-// $Id: apt-ftparchive.conf.in,v 1.2 2008-10-20 10:24:15 adam Exp $
-// This config is for us with the pool-structure for the packages, thus we
-// don't use a Tree Section in here
+APT::FTPArchive::Release {
+       Origin "Index Data";
+       Label "Index Data";
+       Suite "@dist@";
+       Codename "@dist@";
+       Architectures "@architectures@";
+       Components "@sections@";
+       Description "Index Data Debian packages";
+}
 
-// The debian archive should be in the current working dir
 Dir {
        ArchiveDir ".";
        OverrideDir ".";
        CacheDir "tmp";
 };
 
-// Create Packages, Packages.gz and Packages.bz2, remove what you don't need
 Default {
+       Packages::Extensions ".deb";
        Packages::Compress ". gzip bzip2";
        Sources::Compress ". gzip bzip2";
        Contents::Compress ". gzip bzip2";
 };
 
-// Includes the main section. You can structure the directory tree under
-// ./pool/main any way you like, apt-ftparchive will take any deb (and
-// source package) it can find. This creates a Packages a Sources and a
-// Contents file for these in the main section of the sid release
-// BinDirectory "pool/@dist@" {
-//     Packages "dists/@dist@/main/binary-i386/Packages";
-//     Sources "dists/@dist@/main/source/Sources";
-//     Contents "dists/@dist@/Contents-i386";
-// };
-
 TreeDefault {
        Directory "pool/$(DIST)/$(SECTION)/$(ARCH)";
        SrcDirectory "pool/$(DIST)/$(SECTION)/source";
@@ -39,10 +34,4 @@ Tree "dists/@dist@" {
        Architectures "source @architectures@";
        SrcOverride "override";
 };
-// By default all Packages should have the extension ".deb"
-//Default {
-//     Packages {
-//             Extensions ".deb";
-//     };
-//};
 
diff --git a/update-archive/apt-release.conf.in b/update-archive/apt-release.conf.in
deleted file mode 100644 (file)
index ca329a2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-APT::FTPArchive::Release::Origin "Indexdata";
-APT::FTPArchive::Release::Label "Indexdata";
-APT::FTPArchive::Release::Suite "@dist@";
-APT::FTPArchive::Release::Codename "@dist@";
-APT::FTPArchive::Release::Architectures "@architectures@";
-APT::FTPArchive::Release::Components "@sections@";
-APT::FTPArchive::Release::Description "Index Data Debian packages";
index f00cd5d..66553ab 100755 (executable)
@@ -9,6 +9,8 @@ Usage: update-archive.sh [OPTIONS]
 Options:
         [--debian=distros]
         [--ubuntu=distros]
+        [--suffix=dist-suffix]
+        [--noauto]
         [--clear]
 EOF
     exit $1
@@ -16,6 +18,8 @@ EOF
 
 do_help=false
 clear=false
+noauto=false
+suffix=""
 while test $# -gt 0; do
     case "$1" in
         -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
@@ -31,6 +35,12 @@ while test $# -gt 0; do
         --ubuntu=*)
             UBUNTU_DIST=$optarg
             ;;
+        --suffix=*)
+            suffix="$optarg"
+            ;;
+        --noauto)
+            noauto=true
+            ;;
         -*)
             do_help=true
             ;;
@@ -46,18 +56,13 @@ if test ! -f ${confdir}/apt-ftparchive.conf.in; then
        echo "$0: ${condir}/apt-ftparchive.conf.in not found"
        exit 1
 fi
-if test ! -f ${confdir}/apt-release.conf.in; then
-       echo "$0: ${condir}/apt-release.conf.in not found"
-       exit 1
-fi
-
 if test ! -x /usr/bin/apt-ftparchive; then
        echo "$0: /usr/bin/apt-ftparchive missing. Install apt-utils"
        exit 1
 fi
 
 # gpg -a -d -o Release.gpg Release
-       
+
 architectures="i386 amd64"
 
 if test "$DEBIAN_DIST"; then
@@ -72,7 +77,7 @@ if test "$UBUNTU_DIST"; then
 fi
 
 # All distributions we know of
-ALLD="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal ubuntu/raring ubuntu/saucy ubuntu/trusty debian/jessie debian/wheezy debian/squeeze debian/lenny"
+ALLD="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal ubuntu/raring ubuntu/saucy ubuntu/trusty ubuntu/utopic ubuntu/vivid debian/jessie debian/wheezy debian/squeeze debian/lenny"
 
 if test -z "$DISTRIBUTIONS"; then
        DISTRIBUTIONS=$ALLD
@@ -94,6 +99,10 @@ fi
 echo "DISTRIBUTIONS=$DISTRIBUTIONS"
 for vdist in $DISTRIBUTIONS ; do
        dist=`basename $vdist`
+       fdist=${dist}
+       if test -n "${suffix}"; then
+               fdist="${fdist}-${suffix}"
+       fi
        vendor=`dirname $vdist`
        ftpdir=/home/ftp/pub/$vendor
        if test ! -d $ftpdir; then
@@ -101,7 +110,7 @@ for vdist in $DISTRIBUTIONS ; do
                exit 1
        fi
        cd $ftpdir
-       test -d tmp || mkdir tmp
+       mkdir -p tmp
        # Uncomment to clean the .db (cache)
        if $clear; then
                rm tmp/*
@@ -110,8 +119,8 @@ for vdist in $DISTRIBUTIONS ; do
        sections=""
        for section in main restricted; do
                # Prepare pool
-               d=pool/dists/$dist/$section
-               if test ! -d $d; then mkdir -p $d; fi
+               d=pool/dists/$fdist/$section
+               mkdir -p $d
                mkdir -p $d/source
                # Remove invalid symlinks (source, i386, amd64,..)
                for l in $d/*/*; do
@@ -160,53 +169,42 @@ for vdist in $DISTRIBUTIONS ; do
                                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
+                               d=dists/$fdist/$section/binary-$arch
+                               mkdir -p $d
+                               echo "Archive: $fdist" >$d/Release
                                echo "Component: $section" >>$d/Release
-                               echo 'Origin: Indexdata' >>$d/Release
+                               echo 'Origin: Index Data' >>$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
+                       d=dists/$fdist/$section/source
+                       mkdir -p $d
+                       echo "Archive: $fdist" >$d/Release
                        echo "Component: $section" >>$d/Release
-                       echo 'Origin: Indexdata' >>$d/Release
+                       echo 'Origin: Index Data' >>$d/Release
                        echo 'Architecture: source' >>$d/Release
                fi
        done
-       # generate
-       echo "Begin Generate $dist: $sections"
-       F=apt-ftparchive.conf
-       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 2>&1
-       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" | \
-               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
-       mv tmp_Release $r
-
-       # sign
-       if true; then
-               r=dists/$dist/Release
+       if test -n "$sections"; then
+               F=apt-ftparchive.conf
+               sed "s/@dist@/$fdist/g" <${confdir}/${F}.in | \
+                       sed "s/@architectures@/${architectures}/g" | \
+                       sed "s/@sections@/${sections}/g" > $F
+               apt-ftparchive generate apt-ftparchive.conf 2>&1
+               r=dists/$fdist/Release
+               rm -f $r # Move Release file away while calling using release
+               apt-ftparchive -c $F release dists/$fdist >tmp_Release
+               if $noauto; then
+                       sed -e 's/^Suite:/NotAutomatic: yes\nButAutomaticUpgrades: yes\nSuite:/g' <tmp_Release >$r
+               else
+                       mv tmp_Release $r
+               fi
                rm -f ${r}.gpg
-               gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release
+               gpg --sign -u "Index Data" -ba -o ${r}.gpg $r
        fi
 done
 # Local Variables:
 # mode:shell-script
-# sh-indentation: 2
+# sh-indentation: 8
 # sh-basic-offset: 8
 # End: