Only update distro if it's >1 week since last update
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 13 Apr 2010 13:22:21 +0000 (15:22 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 13 Apr 2010 13:22:21 +0000 (15:22 +0200)
id-deb-build/id-pbuild-all.sh

index c88ec51..cde1dc5 100755 (executable)
@@ -15,7 +15,6 @@ Usage: id-pbuild-all.sh [OPTIONS]
 Options:
        [--debian=distros]
        [--ubuntu=distros]
-       [--update=true|false]
        [--upload]
        [--concurrency=N]
 EOF
@@ -24,7 +23,6 @@ EOF
 
 # things that might be set by options
 upload=false
-update=true
 do_help=false
 concurrency=4
 
@@ -44,9 +42,6 @@ while test $# -gt 0; do
        --debian=*)
            DEBIAN_DIST=$optarg
            ;;
-        --update=*)
-           update=$optarg
-           ;;
         --concurrency=*)
            concurrency=$optarg
            ;;
@@ -108,9 +103,9 @@ for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
            if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then
                sudo DIST=$dist ARCH=$arch $PBUILDER create
            fi
-           if $update; then
+           for f in `find /var/cache/pbuilder/${dist}-${arch}-base.tgz -ctime +7`; do
                sudo DIST=$dist ARCH=$arch $PBUILDER update --override-config
-           fi
+           done
            sudo DIST=$dist ARCH=$arch $PBUILDER --build $PKG
            ) >${dist}-${arch}.log 2>&1 &
        i=`expr $i + 1`