Revision 25476,
1.6 KB
checked in by jdreed, 12 years ago
(diff) |
Use control fields instead of nobuild files (Trac #913)
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[22687] | 1 | #!/bin/sh |
---|
| 2 | |
---|
[22688] | 3 | # Wrapper around sbuild. The main purpose is to append a |
---|
| 4 | # distribution-dependent string like "~ubuntu7.10" to the binary |
---|
[24259] | 5 | # package version |
---|
[22688] | 6 | |
---|
[23072] | 7 | # This script us normally run as "da sbuildhack filename.dsc". |
---|
| 8 | |
---|
| 9 | # This script will skip dists listed in ./nobuild. |
---|
| 10 | |
---|
[22687] | 11 | usage() { |
---|
| 12 | echo "Usage: $0 <dist>-<arch> ..." >&2 |
---|
| 13 | exit 1 |
---|
| 14 | } |
---|
| 15 | |
---|
[22748] | 16 | . $(dirname "$0")/debian-versions.sh |
---|
| 17 | |
---|
[22687] | 18 | dist_arch=$1; shift |
---|
| 19 | if [ -z "$dist_arch" ]; then usage; fi |
---|
| 20 | IFS=- read dist arch <<EOF |
---|
| 21 | $dist_arch |
---|
| 22 | EOF |
---|
| 23 | if [ -z "$dist" ] || [ -z "$arch" ]; then usage; fi |
---|
[23072] | 24 | |
---|
[25476] | 25 | dscfile= |
---|
| 26 | for i in $@; do |
---|
| 27 | if echo $i | grep -q '\.dsc$'; then |
---|
| 28 | dscfile=$i |
---|
| 29 | fi |
---|
| 30 | done |
---|
| 31 | |
---|
| 32 | NOBUILD=$(grep-dctrl -n -s Debathena-No-Build -F Debathena-No-Build -e . "$dscfile") |
---|
| 33 | BUILDFOR=$(grep-dctrl -n -s Debathena-Build-For -F Debathena-Build-For -e . "$dscfile") |
---|
| 34 | |
---|
| 35 | if [ -n "$NOBUILD" ] && [ -n "$BUILDFOR" ]; then |
---|
| 36 | echo "It is an error to specify both Debathena-Build-For and Debathena-No-Build fields." |
---|
| 37 | echo "Pick one and try again." |
---|
| 38 | exit 1 |
---|
| 39 | fi |
---|
| 40 | |
---|
| 41 | if [ -z "$NOBUILD" ] && [ -z "$BUILDFOR" ] && [ -e nobuild ]; then |
---|
| 42 | NOBUILD="$(cat nobuild)" |
---|
| 43 | echo "NOTE: Please migrate ./nobuild to XSC-Debathena-No-Build!" |
---|
| 44 | fi |
---|
| 45 | |
---|
| 46 | if [ -n "$NOBUILD" ] && echo "$NOBUILD" | fgrep -q "$dist"; then |
---|
| 47 | echo "Skipping $dist since it is listed in the Debathena-No-Build field" |
---|
[23072] | 48 | exit |
---|
| 49 | fi |
---|
| 50 | |
---|
[25476] | 51 | if [ -n "$BUILDFOR" ] && ! echo "$BUILDFOR" | fgrep -q "$dist"; then |
---|
| 52 | echo "Skipping $dist since it is not listed in the Debathena-Build-For field" |
---|
| 53 | exit |
---|
| 54 | fi |
---|
| 55 | |
---|
[24259] | 56 | sbuild --append-to-version=`gettag "$dist"` \ |
---|
| 57 | -d "$dist" --arch="$arch" \ |
---|
| 58 | --apt-update --apt-distupgrade \ |
---|
[24681] | 59 | --setup-hook="$(readlink -f "$(dirname "$0")/chroot-sources")" \ |
---|
[24680] | 60 | -v "$@" |
---|
Note: See
TracBrowser
for help on using the repository browser.