summaryrefslogtreecommitdiffstats
path: root/debian/bin/gbp-postexport-hook
blob: 21321a8757b96695f5df4879d1011f3389e95a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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"