Helper commands to update Debian repo.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 28 Aug 2012 14:55:16 +0000 (16:55 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 28 Aug 2012 14:55:16 +0000 (16:55 +0200)
mock.sh

diff --git a/mock.sh b/mock.sh
index 94af052..9a1a3d0 100755 (executable)
--- a/mock.sh
+++ b/mock.sh
@@ -206,6 +206,35 @@ while test -n "$1"; do
                package org.glite.px.emi-px emi-px
                ;;
 
+       push)
+               shift
+               repo=$1
+               if test -z "$repo"; then
+                       echo "Usage: $0 push OLD_REPO_DIR"
+                       exit 1
+               fi
+
+               if test "$CONF" = "pbuilder"; then
+                       (cd $repo; ls -1 | grep '\.changes$' | sort) > old
+                       (cd $DEBREPO/$DEBDISTRO; ls -1 | grep '\.changes$' | sort) > new
+                       diff -U0 old new | tail -n +3 | grep -v ^@ | grep '^+' | cut -c2- > changes
+                       echo "New packages:"
+                       cat changes
+                       echo
+
+                       echo "Commands:"
+                       cat << EOF
+rm -rf $DEBREPO/$DEBDISTRO.prev
+mv $DEBREPO/$DEBDISTRO $DEBREPO/$DEBDISTRO.prev
+mkdir $DEBREPO/$DEBDISTRO
+touch $DEBREPO/$DEBDISTRO/Packages
+(cd $repo; dput -U local `cat changes | tr '\n' ' '`)
+(cd $DEBREPO/$DEBDISTRO; rm -f Release.gpg; gpg -abs -o Release.gpg Release)
+EOF
+               fi
+
+               ;;
+
        *)
                if test "$CONF" = "pbuilder"; then
                        pbuilder_build "$1"