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