summaryrefslogtreecommitdiffhomepage
path: root/examples/gbp-try-ff
blob: 54c4afef2874ecf01606f1291d4e7cb2ad430b12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#
# Try to update a package to a new upstream version

set -e

git checkout debian/sid
gbp pq import --force
git checkout debian/sid
set +e
gbp import-orig --uscan --no-interactive --no-pristine-tar
ret=$?
set -e
if [ $ret = 4 ]; then
    exit 0
fi

if ! gbp pq rebase; then
    echo "Automatic rebase failed"
    git rebase --abort
    exit 1
fi

gbp pq export --commit
gbp dch -S -a
gbp buildpackage --git-pbuilder \
                 --git-ignore-new \
                 --git-no-pristine-tar \
                 --git-postbuild='lintian $GBP_CHANGES_FILE' \
                 -nc \
                 ${GBP_BUILDPACKAGE_ARGS}

NEW_VERSION=$(dpkg-parsechangelog -SVersion)
MAINTAINER=$(dpkg-parsechangelog -SMaintainer)
echo "New version ${NEW_VERSION} importet and built"

mail -s "Imported new version ${NEW_VERSION}" "${MAINTAINER}" < /dev/null