source: soft/build_system/build_system/upload/robot/trunk/mir @ 1

Last change on this file since 1 was 1, checked in by fasma, 12 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

File size: 3.2 KB
Line 
1#!/bin/zsh
2
3TMP="$HOME/tmp/UNE_SALE_CONNERIE_DE_LOCK"
4trap 'rm -f $TMP' 0
5
6usage () {
7    echo "Usage:  -s -a -u -i -f"
8    echo "-u       --update:    donwload from mandriva.com (need the passwd)"
9    echo ""
10    echo "X-Complaints go to Dave Null <dave@null.com>"
11}
12
13#while [[ $1 = (|-*|--*) && $1 != (|-|--) ]];do
14while [ $1 ]; do
15        case $1 in
16            -s|--srpms)
17            SRPM="true";shift;
18            ;;
19            -f|--fermetageule)
20            FORCE="true"; shift;
21            ;;
22            -a|--admin)
23            ADMIN="true"; shift;
24            ;;
25            -u|--update)
26            UPDATE="true"; shift;
27            ;;
28            -i|--install)
29            INSTALL="true"; shift;
30            ;;
31            -c|--check)
32            CHECK="true"; shift;
33            ;;
34            -t|--to-mdk)
35            UPLOAD="true"; shift;
36            ;;
37            -*)
38            print "Error: unknown option $1"
39            usage; return 1;
40            ;;
41        esac
42done
43
44
45if [[ -n "$ADMIN" ]];then
46    ssh devel@mandriva.com sh robot/admin
47fi
48
49if [ -r "$TMP" ]; then
50    pid=`cat $TMP`
51    if [ ! -r /proc/$pid ]; then
52        echo "stalled lock removing it"
53        rm -f $TMP
54    fi
55fi
56
57[[ -z $FORCE ]] && [[ -e $TMP ]] && {
58    echo "Sound like a another cow boys run `basename $0`."
59    echo "The PID :"
60    cat $TMP
61    echo "kill me -9 or use the -f options"
62    exit 0
63}
64
65echo "$$" > $TMP
66
67[[ -n "$UPLOAD" ]] && {
68    $HOME/robot/cooker-push-rsync
69}
70
71[[ -n $UPDATE ]] && {
72echo "Updating from mandriva.com:"
73sh $HOME/bin/cooker-mandrake-rsync
74echo -n "Rebuilding file listings..."
75cd /c/cooker/
76misc/genhdlist_cz2 --noclean --distrib .
77misc/gendepslist2 -o Mandrake/base/depslist Mandrake/base/hdlist.cz2
78#./genhdlist ../
79#./gendepslist -h ../Mandrake/base/depslist ../Mandrake/base/hdlist
80echo "done"
81}
82
83[[ -n $CHECK ]] && {
84echo "Checking Cooker"
85if [ -x /usr/bin/check-distrib ]; then
86    /usr/bin/check-distrib /mnt/BIG/distrib/cooker/SRPMS/main /mnt/BIG/distrib/cooker/i586/media/main i586 | grep -v DrakX > ~/tmp/$$
87    if [ $? -eq 0 -a `wc -l ~/tmp/$$|awk '{print $1;}'` -gt 0 ]; then
88        echo "Sending result to future"
89       
90        email=""
91        for m in `while read a b p; do rpmmon -p $p; done < ~/tmp/$$ | sort -u`; do
92            if [ $m = NOT_FOUND ]; then
93                m=maintainers
94            fi
95            email="$m, $email"
96        done
97        (cat <<EOF
98From: Nono the little bot <warly@mandriva.com>
99To: $email
100Subject: missing packages in Cooker
101Errors-To: warly@mandriva.com
102
103Fix the following problems asap:
104
105EOF
106        while read a b p; do echo -n "$a $b $p "; rpmmon -p $p; done < ~/tmp/$$
107        cat <<EOF
108
109--
110Nono the little bot
111EOF
112
113        if [ -x /usr/games/fortune ]; then
114            /usr/games/fortune -s 33% computers 33% MS-FORTUNES 34% linuxcookie
115        fi
116        ) | /usr/sbin/sendmail -B8BITMIME -oi -t
117        fi
118        rm -f ~/tmp/$$
119    fi
120    echo done
121}
122
123if [[ -n $INSTALL ]];then
124    echo "Updating from leia"
125    for i in Mandrake/base/compssUsers Mandrake/base/compssList Mandrake/base/mdkinst_stage2.gz dosutils/autoboot/mdkinst/{initrd.hd,vmlinuz} dosutils/autoboot/mdkinst/initrd.pc dosutils/autoboot/mdkinst/initrd.nt dosutils/autoboot/mdkinst/initrd.cd images/hd.img images/cdrom.img images/network.img images/pcmcia.img lnx4win/initrd.gz lnx4win/vmlinuz misc/make_mdkinst_stage2 misc/build_archive misc/gendepslist misc/rpm2header misc/genhdlist;do
126        echo -n "Upgrading $i from leia: "
127        rsync -qSavuz --delete leia::dis/export/$i /I/$i
128        echo "Done."
129    done
130fi
131   
132[ "$UID" = "0" ] && {
133        cd /c/
134        find -exec chown mandrake {} \; &
135}
136
137rm -f $TMP
Note: See TracBrowser for help on using the repository browser.