/[fai]/people/michael/experimental/build-on-alioth
ViewVC logotype

Contents of /people/michael/experimental/build-on-alioth

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5139 - (show annotations) (download)
Tue Sep 9 06:46:12 2008 UTC (4 years, 8 months ago) by mt
File size: 4833 byte(s)
proper changelog formatting
1 #!/bin/bash
2
3 mangle_version_number() {
4 dh_testdir || exit 3
5 trunk_vers="`dpkg-parsechangelog | grep ^Version: | awk '{ print $2 }'`"
6 if [ ! -f $storage/LATEST_BUILD ] ; then
7 echo "$trunk_vers+experimental1" > $storage/LATEST_BUILD
8 else
9 cp $storage/LATEST_BUILD $storage/LATEST_BUILD.successful
10 if dpkg --compare-versions $trunk_vers gt $(<$storage/LATEST_BUILD) ; then
11 echo "$trunk_vers+experimental1" > $storage/LATEST_BUILD
12 else
13 beta_level="`cat $storage/LATEST_BUILD | sed 's/.*+experimental//'`"
14 beta_level=$((beta_level + 1))
15 echo "$trunk_vers+experimental$beta_level" > $storage/LATEST_BUILD
16 fi
17 fi
18 }
19
20 build_changelog() {
21 dh_testdir || exit 3
22 mv debian/changelog debian/changelog.orig
23 echo "fai ($(<$storage/LATEST_BUILD)) unstable; urgency=low" > debian/changelog
24 echo >> debian/changelog
25 echo " * Experimental FAI based on SVN r$REV" >> debian/changelog
26 for i in `quilt series` ; do
27 author="`quilt header $i | sed -n 1p | sed 's/^[[:digit:] -]*//'`"
28 quilt header $i | sed '/^[[:space:]]*$/d' | sed '/^[^[:space:]]/d' | \
29 sed "s/^[[:space:]]*\*/ [ $author ]\n&/" >> debian/changelog
30 done
31 echo >> debian/changelog
32 echo " -- FAI Developers <linux-fai-devel@uni-koeln.de> `date -R`" >> debian/changelog
33 echo >> debian/changelog
34 cat debian/changelog.orig >> debian/changelog
35 rm debian/changelog.orig
36 }
37
38 REPOS="$1"
39 REV="$2"
40
41 set -v -x
42
43 storage=/org/alioth.debian.org/chroot/home/groups/fai
44 log=`mktemp -t faiXXX`
45 date > $log
46
47 tmppatch=`mktemp -t faiXXX`
48 cat > $tmppatch << "EOF"
49 --- debian/rules (revision 5044)
50 +++ debian/rules (working copy)
51 @@ -1,5 +1,7 @@
52 #!/usr/bin/make -f
53
54 +include /usr/share/quilt/quilt.make
55 +
56 DESTDIR=`pwd`/debian/tmp
57 DOCDIR=`pwd`/debian/fai-doc/usr/share/doc/fai-doc
58
59 @@ -12,7 +14,7 @@
60 include VERSION
61
62 build: build-stamp
63 -build-stamp:
64 +build-stamp: patch
65 dh_testdir
66
67 # Add here commands to compile the package.
68 @@ -20,7 +22,7 @@
69
70 touch build-stamp
71
72 -clean:
73 +clean: unpatch
74 dh_testdir
75 # dh_testroot
76 rm -f build-stamp
77 EOF
78
79 {
80
81 set -e
82
83 # make sure no other build is running concurrently
84 for i in `seq 1 21` ; do
85 if [ $i -eq 21 ] ; then
86 echo "Timed out!" 1>&2
87 exit 1
88 fi
89 if [ -e $storage/BUILDING ] ; then
90 sleep 5
91 else
92 > $storage/BUILDING
93 break
94 fi
95 done
96
97 # check arguments
98 test -n "$REV" -a -n "$REPOS"
99
100 # checkout the directories, if necessary
101 if [ ! -d $storage/trunk-w-exp ] ; then
102 svn co -r $REV file:///srv/svn.debian.org/svn/fai/trunk $storage/trunk-w-exp
103 chmod -R g+wX $storage/trunk-w-exp
104 find $storage/trunk-w-exp -type d -exec chmod g+s {} \;
105 fi
106 if [ ! -d $storage/trunk-w-exp/debian/patches ] ; then
107 svn co -r $REV file:///srv/svn.debian.org/svn/fai/people/michael/experimental/patches $storage/trunk-w-exp/debian/patches
108 chmod -R g+wX $storage/trunk-w-exp/debian/patches
109 find $storage/trunk-w-exp/debian/patches -type d -exec chmod g+s {} \;
110 fi
111
112 # is this a commit to experimental?
113 if svnlook dirs-changed -r $REV $REPOS | grep '^people/michael/experimental/' ; then
114 svn revert $storage/trunk-w-exp/debian/rules
115 svn revert $storage/trunk-w-exp/debian/changelog
116 svn up -r $REV $storage/trunk-w-exp
117 svn up -r $REV $storage/trunk-w-exp/debian/patches
118 cd $storage
119 rm -f fai*.deb fai*.changes fai*.dsc fai*.tar.gz
120 cd trunk-w-exp
121 export QUILT_PC=$PWD/debian/.pc
122 export QUILT_PATCHES=$PWD/debian/patches
123 mangle_version_number
124 patch -p0 < $tmppatch
125 build_changelog
126 dpkg-buildpackage -uc -us -d -I.svn -rfakeroot && dpkg_exit=$? || dpkg_exit=$?
127 echo "STATUS: dpkg-buildpackage exited with status $dpkg_exit"
128 cd ..
129 if [ $dpkg_exit -eq 0 ] ; then
130 rm -f $storage/LATEST_BUILD.successful
131 vers="$(<$storage/LATEST_BUILD)"
132 if [ -x /usr/bin/lintian ] ; then
133 lintian -iI *$vers*.dsc *$vers*.deb
134 fi
135 rm -f htdocs/fai*.deb htdocs/fai*.changes htdocs/fai*.dsc htdocs/fai*.tar.gz
136 mv *$vers* htdocs/
137 cd htdocs
138 md5sum *$vers* | mail -s "FAI:$vers:$REV" -c mt@debian.org fai-experimental-upload@informatik.uni-koeln.de
139 else
140 who_did_it="`svnlook author -r $REV $REPOS`"
141 if [ -f $storage/LATEST_BUILD.successful ] ; then
142 mv $storage/LATEST_BUILD.successful $storage/LATEST_BUILD
143 else
144 rm $storage/LATEST_BUILD
145 fi
146 REPLYTO="mt@debian.org" mail -s "FAI build of $REV failed!" -c mt@debian.org $who_did_it@alioth.debian.org < $log
147 fi
148 fi
149
150 echo "STATUS: build exit status $?"
151
152 } 2>&1 | tee $log
153
154 date >> $log
155
156 err_found=0
157 if ! grep -q "^STATUS: build exit status 0" $log ; then
158 err_found=1
159 elif ! grep -q "^STATUS: dpkg-buildpackage exited with status 0" $log ; then
160 err_found=1
161 fi
162
163 if [ $err_found -eq 1 ] ; then
164 mail -s "FAI build of $REV failed!" mt@alioth.debian.org < $log
165 mv $log $storage/buildlog.failed.$REV
166 fi
167
168 rm -f $log $tmppatch $storage/BUILDING
169

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5