summaryrefslogtreecommitdiffstats
path: root/debian/bin/gbp-postexport-hook
diff options
context:
space:
mode:
Diffstat (limited to 'debian/bin/gbp-postexport-hook')
-rwxr-xr-xdebian/bin/gbp-postexport-hook23
1 files changed, 23 insertions, 0 deletions
diff --git a/debian/bin/gbp-postexport-hook b/debian/bin/gbp-postexport-hook
new file mode 100755
index 0000000..21321a8
--- /dev/null
+++ b/debian/bin/gbp-postexport-hook
@@ -0,0 +1,23 @@
+#!/bin/sh -eu
+
+if [ "${CI}" = true ]; then
+ # Install required packages for gencontrol.py
+ linux_support_name="$(debian/rules linux-support-name)"
+ apt-get install -y --no-install-recommends "$linux_support_name" python3
+
+ # Fudge source version *before* gencontrol.py
+ sed -i -e '1 s/)/+salsaci)/' debian/changelog
+fi
+
+# Create temporary log
+log="$(mktemp)"
+trap 'rm -f "$log"' EXIT
+
+# Invoke debian/control-real rule and log output
+rc=0
+debian/rules debian/control-real >"$log" 2>&1 || rc=$?
+cat "$log"
+
+# Check for success message and error code
+test $rc = 2
+grep -q 'been generated SUCCESSFULLY' "$log"