summaryrefslogtreecommitdiff
path: root/infra
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 15:36:04 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 16:05:10 +0100
commited13a339560efb554f9afc9419ffd8157e357727 (patch)
treea78270addd92d68d35bc1c95d0fd6bf4ec5a9f3f /infra
parent6b8c969adabf3b74d9deb836e5377a3e01c2a57b (diff)
Infra: Add dgit-repos-policy-trusting
Also add the --deliberately-fresh-repo deliberately, both to the manpage and to dgit's idea of non-fast-forward-ness. Rename the dgit test only deliberatelies to start with TEST-dgit-only- rather than having the -dgit-only at the end.
Diffstat (limited to 'infra')
-rwxr-xr-xinfra/dgit-repos-policy-trusting46
1 files changed, 46 insertions, 0 deletions
diff --git a/infra/dgit-repos-policy-trusting b/infra/dgit-repos-policy-trusting
new file mode 100755
index 0000000..b550d01
--- /dev/null
+++ b/infra/dgit-repos-policy-trusting
@@ -0,0 +1,46 @@
+#!/bin/bash
+set -e
+
+case "$DGIT_DRS_DEBUG" in
+''|0) exec 3>/dev/null ;;
+1) exec 3>&2 ;;
+*) exec 3>&2; set -x ;;
+esac
+
+distro=$1 ; shift
+reposdir=$1 ; shift
+livedir=$1 ; shift
+distrodir=$1 ; shift
+action=$1 ; shift
+
+echo >&3 "dgit-repos-policy-trusting: action=$action"
+
+case "$action" in
+push|push-confirm) ;;
+*) exit 0 ;;
+esac
+
+package=$1 ; shift
+version=$1 ; shift
+suite=$1 ; shift
+tagname=$1 ; shift
+delibs=$1 ; shift
+
+bitmask=0
+
+policyflags () {
+ perl -e 'use Debian::Dgit qw(:policyflags); print '$1',"\n"'
+}
+
+set -e
+
+case "$action//,$delibs," in
+push//*,--deliberately-fresh-repo,*)
+ bitmask=$(( bitmask | `policyflags 'NOFFCHECK|FRESHREPO'` ))
+ ;;
+push//*,--deliberately-not-fast-forward,*)
+ bitmask=$(( bitmask | `policyflags 'NOFFCHECK'` ))
+ ;;
+esac
+
+exit $bitmask