File: backport-ppa

package info (click to toggle)
postgresql-common 165
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 1,060 kB
  • sloc: perl: 2,815; sh: 1,083; makefile: 62
file content (48 lines) | stat: -rwxr-xr-x 1,618 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
# Generate and upload backports for Ubuntu PPA
# Author: Martin Pitt <mpitt@debian.org>

set -e

if [ -n "`bzr modified`" ]; then
    echo "Modified files, aborting" >&2
    exit 1
fi

SRC=`dpkg-parsechangelog  | grep ^Source | cut -f2- -d' '`
if [ "$SRC" = postgresql-9.1 ]; then
    RELEASES='lucid'
elif [ "$SRC" = postgresql-9.2 ]; then
    RELEASES='lucid precise'
else
    RELEASES='lucid precise'
fi

CUR_VERSION=`dpkg-parsechangelog | grep ^Version | cut -f2 -d' '`
SINCE_VERSION=`dpkg-parsechangelog -n2 | grep urgency=| tail -n1 | awk '{print $2}' | tr -d '()'`


export DEBEMAIL=martin.pitt@ubuntu.com

# do first upload with orig tarball, subsequent ones without
ORIG="-sa"
for release in $RELEASES; do
    BP_VERSION=`echo "$CUR_VERSION~${release}" | sed 's/-/-0ppa/'`
    dch -D$release -v"$BP_VERSION" -b 'Backport'
    if [ "$release" = lucid -o "$release" = "natty" -o "$release" = oneiric ]; then
        sed -i 's/dpkg-dev.*| hardening-wrapper/hardening-wrapper/' debian/control
    fi
    if [ "$SRC" = "postgresql-9.1" ]; then
        # libraries are built by -9.2 now, and PPAs disallow building older versions
        perl -000 -ne 'print $_ unless /^Package: lib/' -i debian/control
        sed -i 's/fail-missing/list-missing/' debian/rules
        sed -i 's/python-dev,/python-dev, libpq-dev (>= 9.1),/' debian/control
    fi
    if [ "$release" = "lucid" ]; then
        sed -i 's/-Zxz//' debian/rules 
    fi
    bzr bd -S -- --no-lintian "$ORIG" -v$SINCE_VERSION
    bzr revert --no-backup
    dput ppa:pitti/postgresql ../${SRC}_${BP_VERSION}_source.changes
    ORIG="-sd"
done