~ubuntu-langpack/langpack-o-matic/main

29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
1
#!/bin/bash -e
1 by martin at piware
state for breezy final
2
3
# this is part of langpack-o-matic, by Martin Pitt <martin.pitt@canonical.com>
4
#
5
# (C) 2005 Canonical Ltd.
6
#
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
7
# Process all packages in "updated-packages": Build source packages and
118 by Martin Pitt
packages: drop obsolete binary; add ppa option for uploading to PPA and required .changes mangling
8
# optionally upload them. Generated source tar.gz/dsc/changes files are deleted
9
# after successful upload. Entries from updated-packages are removed after
10
# successful processing.
1 by martin at piware
state for breezy final
11
12
cd $(dirname $0)
13
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
14
while [ -n "$1" ]; do
15
    case "$1" in
118 by Martin Pitt
packages: drop obsolete binary; add ppa option for uploading to PPA and required .changes mangling
16
	ppa)
567 by Martin Pitt
packages: use canonical PPA archive names
17
	    DEST=ppa:ubuntu-langpack/ubuntu/ppa
500 by Martin Pitt
packages: support uploads to ubuntu-rtm
18
	    ;;
19
	rtm)
567 by Martin Pitt
packages: use canonical PPA archive names
20
	    DEST=ppa:ci-train-ppa-service/ubuntu/stable-phone-overlay
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
21
	    ;;
22
	upload)
23
	    UPLOAD=1
24
	    ;;
25
	'')
26
	    break
27
	    ;;
28
	*)
500 by Martin Pitt
packages: support uploads to ubuntu-rtm
29
	    echo "Invalid option! Usage: $0 [ppa|rtm] [upload]"
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
30
	    exit 1
31
	    ;;
32
    esac
33
    shift
34
done
35
36
[ -f updated-packages ] || {
37
    echo "updated-packages does not exist, nothing to do" >&2
2 by martin at piware
combined changes from breezy to head from old revision control
38
    exit 1
39
}
40
1 by martin at piware
state for breezy final
41
for i in $(< updated-packages); do
42
    pushd $i >/dev/null
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
43
    p=$(basename $i)
74 by martin at piware
use dpkg-buildpackage instead of debuild
44
    chmod 755 debian/rules
118 by Martin Pitt
packages: drop obsolete binary; add ppa option for uploading to PPA and required .changes mangling
45
    dpkg-buildpackage -rfakeroot -S -us -uc
1 by martin at piware
state for breezy final
46
118 by Martin Pitt
packages: drop obsolete binary; add ppa option for uploading to PPA and required .changes mangling
47
    # PPAs only accept release pockets, fudge the .changes
544 by Martin Pitt
packages: Fix typo in destination series fudging
48
    if [ "${DEST#ppa}" != "${DEST}" ]; then
308 by Arne Goetje
* packages: accept security uploads
49
        sed -ri '/^Distribution:/ s/-(proposed|updates|security)$//' ../${p}_*_source.changes
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
50
    fi
120 by Martin Pitt
packages: fix path of .changes files
51
    debsign ../${p}_*_source.changes
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
52
53
    if [ -n "$UPLOAD" ]; then
2 by martin at piware
combined changes from breezy to head from old revision control
54
	cd ..
543 by Martin Pitt
packages: adjust for 15.04 overlay PPA
55
        dput $DEST ${p}_*_source.changes
530 by Martin Pitt
packages: clean .upload stamps harder
56
	rm -f ${p}_*_source.changes ${p}_*.upload ${p}_*.dsc ${p}_*.tar.gz
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
57
	cd -
2 by martin at piware
combined changes from breezy to head from old revision control
58
    fi
1 by martin at piware
state for breezy final
59
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
60
    cd ..
30 by martin at piware
packages: remove non-source changes files
61
    rm -f ${p}_*.build *[^r][^c][^e].changes
29 by martin at piware
remove testbuilds scripts, add binary mode to packages script
62
1 by martin at piware
state for breezy final
63
    popd >/dev/null
64
65
    # this seems to be overly complicated, but it allows us to run this script
66
    # again if dput fails for a single package
63 by martin.pitt at ubuntu
packages: fix removal from updated-packages
67
    sed -i -e "s#^$i\$##" -e '/^$/d'  updated-packages
1 by martin at piware
state for breezy final
68
done
69