##// END OF EJS Templates
builddeb: use the os codename instead of 'unstable'...
Sean Farley -
r28989:a8256e37 stable
parent child Browse files
Show More
@@ -1,90 +1,91 b''
1 1 #!/bin/sh -e
2 2 #
3 3 # Build a Mercurial debian package from the current repo
4 4 #
5 5 # Tested on Jessie (stable as of original script authoring.)
6 6
7 7 . $(dirname $0)/packagelib.sh
8 8
9 9 BUILD=1
10 10 CLEANUP=1
11 11 DISTID=`(lsb_release -is 2> /dev/null | tr '[:upper:]' '[:lower:]') || echo debian`
12 12 CODENAME=`lsb_release -cs 2> /dev/null || echo unknown`
13 13 while [ "$1" ]; do
14 14 case "$1" in
15 15 --distid )
16 16 shift
17 17 DISTID="$1"
18 18 shift
19 19 ;;
20 20 --codename )
21 21 shift
22 22 CODENAME="$1"
23 23 shift
24 24 ;;
25 25 --cleanup )
26 26 shift
27 27 BUILD=
28 28 ;;
29 29 --build )
30 30 shift
31 31 CLEANUP=
32 32 ;;
33 33 * )
34 34 echo "Invalid parameter $1!" 1>&2
35 35 exit 1
36 36 ;;
37 37 esac
38 38 done
39 39
40 40 trap "if [ '$CLEANUP' ] ; then rm -r '$PWD/debian' ; fi" EXIT
41 41
42 42 set -u
43 43
44 44 if [ ! -d .hg ]; then
45 45 echo 'You are not inside a Mercurial repository!' 1>&2
46 46 exit 1
47 47 fi
48 48
49 49 gethgversion
50 50 debver="$version"
51 51 if [ -n "$type" ] ; then
52 52 debver="$debver~$type"
53 53 fi
54 54 if [ -n "$distance" ] ; then
55 55 debver="$debver+$distance-$node"
56 56 fi
57 57
58 58 control=debian/control
59 59 changelog=debian/changelog
60 60
61 61 if [ "$BUILD" ]; then
62 62 if [ -d debian ] ; then
63 63 echo "Error! debian control directory already exists!"
64 64 exit 1
65 65 fi
66 66
67 67 cp -r $PWD/contrib/debian debian
68 68 chmod -R 0755 debian
69 69
70 70 sed -i.tmp "s/__VERSION__/$debver/" $changelog
71 71 sed -i.tmp "s/__DATE__/$(date --rfc-2822)/" $changelog
72 sed -i.tmp "s/__CODENAME__/$CODENAME/" $changelog
72 73 rm $changelog.tmp
73 74
74 75 debuild -us -uc -b
75 76 if [ $? != 0 ]; then
76 77 echo 'debuild failed!'
77 78 exit 1
78 79 fi
79 80
80 81 fi
81 82 if [ "$CLEANUP" ] ; then
82 83 echo
83 84 OUTPUTDIR=${OUTPUTDIR:=packages/$DISTID-$CODENAME}
84 85 mkdir -p "$OUTPUTDIR"
85 86 find ../mercurial*.deb ../mercurial_*.build ../mercurial_*.changes \
86 87 -type f -newer $control -print0 | \
87 88 xargs -Inarf -0 mv narf "$OUTPUTDIR"
88 89 echo "Built packages for $debver:"
89 90 find "$OUTPUTDIR" -type f -newer $control -name '*.deb'
90 91 fi
@@ -1,5 +1,5 b''
1 mercurial (__VERSION__) unstable; urgency=medium
1 mercurial (__VERSION__) __CODENAME__; urgency=medium
2 2
3 3 * Automated build performed by upstream.
4 4
5 5 -- Mercurial Devel <mercurial-devel@selenic.com> __DATE__
General Comments 0
You need to be logged in to leave comments. Login now