Meta/DoKernelOrg: skip if i386 is not ready yet
[git] / DoKernelOrg
1 #!/bin/sh
2
3 case "`uname -m 2>/dev/null`" in
4 x86_64)
5         USE_PIC=YesPlease
6         export USE_PIC
7         ;;
8 esac
9
10 : ${J='-l 4 -j'}
11 G=/pub/software/scm/git &&
12
13 cd $HOME/git &&
14 make clean >/dev/null 2>&1 &&
15 git reset --hard &&
16 make clean >/dev/null 2>&1 &&
17 git checkout master &&
18 git pull . origin &&
19 make clean >/dev/null 2>&1 &&
20
21 case "$1" in
22 '')
23         echo "* Building all"
24         : ${branches='next master maint pu'}
25         nstalled=install
26         for branch in $branches
27         do
28                 if git-rev-parse --verify refs/heads/$branch 2>/dev/null
29                 then
30                         echo "** $branch **" &&
31                         git checkout $branch &&
32                         make $J $nstalled &&
33                         make test &&
34                         make clean &&
35                         nstalled=all || exit $?
36                 else
37                         echo
38                         echo "* NO $branch"
39                         echo
40                 fi
41         done >:all.log 2>&1
42         ;;
43
44 maint | master)
45         case `hostname` in
46         hera.kernel.org)
47                 narch='x86_64 i386'
48                 arch=x86_64 ;;
49         demeter.kernel.org|demeter|old-hera.kernel.org|kunrun-vmw-fc5)
50                 arch=i386 ;;
51         *)      echo >&2 "What are you talking about???"
52                 exit 1 ;;
53         esac &&
54         : >./:all.log &&
55         echo "* Building $1" &&
56         git checkout "$1" &&
57         make $J git >./:all.log 2>&1 &&
58         V=`./git --version | sed -e 's/git version //'` &&
59         make rpm >>./:all.log 2>&1 &&
60         case "$narch" in
61         '')
62                 # This is not the primary build machine.
63                 status=$?
64                 case "$status" in
65                 0)
66                         echo >&2 "Done -- move RPMS to the master machine."
67                         (
68                                 cd "$HOME/rpms/" &&
69                                 tar cf "$HOME/$V.tar" \
70                                         RPMS/$arch/*-$V-*.$arch.rpm &&
71                                 ls -ld $HOME/$V.tar
72                         )
73                         make clean
74                         ;;
75                 ?)
76                         echo >&2 "Failed with status $status"
77                         ;;
78                 esac
79                 exit $status ;;
80         *)
81                 ln git-$V.tar.gz $G/. &&
82                 make dist-doc >>./:all.log 2>&1 &&
83                 ln git-htmldocs-$V.tar.gz git-manpages-$V.tar.gz $G/.
84                 ;;
85         esac >>./:all.log 2>&1 &&
86         case "$NO_RPM_PLEASE" in
87         '')
88                 mkdir -p $G/RPMS/$arch $G/RPMS/SRPMS &&
89                 for a in $narch
90                 do
91                         mkdir -p "$G/RPMS/$a" &&
92                         for rr in $HOME/rpms/RPMS/$a/*-$V-*.$a.rpm
93                         do
94                                 test -f "$rr" || continue
95                                 ln "$rr" $G/RPMS/$a/.
96                         done
97                 done &&
98                 ln $HOME/rpms/SRPMS/git-$V-*.src.rpm $G/RPMS/SRPMS/. &&
99                 {
100                         # I do not know how it exits, and I do not care much.
101                         for a in $narch
102                         do
103                                 /usr/local/bin/yummy $G/RPMS/$a
104                         done
105                         /usr/local/bin/yummy $G/RPMS/SRPMS
106                         :
107                 } >>./:all.log 2>&1 ;;
108         *)
109                 echo Skipping RPM ;;
110         esac &&
111         make clean &&
112
113         : ;;
114 esac || exit $?
115
116 git checkout master