1 |
#! /usr/local/bin/bash |
2 |
# |
3 |
# Giuseppe vacanti, January 2000 |
4 |
# |
5 |
# + Build the latest set of CCF packages |
6 |
# |
7 |
# Exit code: |
8 |
# + -1 (255): nothing to build |
9 |
# + 1: shell errors (cd mkdir ...) |
10 |
# + 2: SAS set up cannot find deceit |
11 |
# |
12 |
# $Id: buildlatest,v 1.2 2003/11/26 10:50:47 ccflib Exp $ |
13 |
|
14 |
cleanup () { |
15 |
cd ~ |
16 |
rm -fr $builddir/* |
17 |
exit |
18 |
} |
19 |
|
20 |
buildpkg () { |
21 |
pkg=$1 |
22 |
echo Attempting to build $pkg ... |
23 |
(make -s -C $pkg clobber 2>&1 && make -s -C $pkg depend 2>&1 && make -s -C $pkg 2>&1) >> $builddir/build.log |
24 |
} |
25 |
|
26 |
. $HOME/bin/ccflib.cfg |
27 |
|
28 |
builtdir=~/deliveries/built |
29 |
mkdir -p $builtdir |
30 |
|
31 |
trap cleanup SIGINT |
32 |
|
33 |
me=`basename $0` |
34 |
##echo $me running on `date` |
35 |
|
36 |
PATH=$HOME/bin:$PATH |
37 |
export PATH |
38 |
|
39 |
|
40 |
plist=`findlatest` |
41 |
|
42 |
if [ -z "$plist" ] ; then |
43 |
## echo Nothing to build. |
44 |
exit -1 |
45 |
fi |
46 |
|
47 |
saslatest |
48 |
deceit -v 2>&1 || (echo ERROR: deceit missing; exit 2) |
49 |
ccfextseq -v 2>&1 || (echo ERROR: ccfextseq missing; exit 2) |
50 |
|
51 |
builddir=$HOME/builds/tmp |
52 |
mv $builddir ${builddir}.old |
53 |
rm -fr ${builddir}.old & |
54 |
mkdir -p $builddir |
55 |
cd $builddir || exit 1 |
56 |
echo -n Removing the contents of $builddir ... |
57 |
rm -fr * |
58 |
echo "" |
59 |
|
60 |
mkdir packages || exit 1 |
61 |
|
62 |
for p in $plist; do |
63 |
|
64 |
echo -n Unpacking `basename $p` ... |
65 |
tar -C packages -xzf $p || (echo FAILED, aborting ; exit 1) |
66 |
echo " done." |
67 |
mkdir tmplog || exit 1 |
68 |
tar -C tmplog -xzf $p || (echo FAILED, aborting ; exit 1) |
69 |
chmod -R a+w tmplog |
70 |
tmpdir=`ls -1 tmplog` |
71 |
echo "ChangeLog says:" |
72 |
last_version tmplog/$tmpdir/ChangeLog |
73 |
rm -fr tmplog |
74 |
|
75 |
done |
76 |
|
77 |
|
78 |
CCFDEV=$HOME/ccfdev |
79 |
cd $CCFDEV |
80 |
cvs update 2> /dev/null |
81 |
cd ~- |
82 |
export CCFDEV |
83 |
. $CCFDEV/setup.sh |
84 |
|
85 |
cd packages |
86 |
|
87 |
for p in $plist; do |
88 |
thisp=`basename $p '.tgz' | sed -e 's/-[0-9]\{1,\}\.[0-9]\{1,\}$//'` |
89 |
buildpkg $thisp && (echo ok; mv $p $builtdir) || (echo FAILED ; cat $builddir/build.log) |
90 |
done |
91 |
|
92 |
###emptypkgdir |