/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download) (as text)
Wed Dec 13 15:13:59 2000 UTC (17 years, 7 months ago) by achim
Branch: MAIN
Changes since 1.7: +1 -1 lines
File MIME type: text/x-sh
supervise fixes

1 #!/bin/sh
2
3
4 C_NORMAL=$'\033[0m'
5 C_HILITE=$'\e[36;01m'
6 C_END=$'\e[A\e[68G'
7 C_OK=$'\e[32m'
8 C_NO=$'\e[31m'
9 PORTDIR=/usr/portage
10 LOGDIR=$ROOT/tmp/portage-log
11 STEPS="check fetch clean unpack compile install qmerge clean"
12 #STEPS="check unmerge"
13
14 do_step() {
15
16 local tmpp
17 tmpd=`pwd`
18 echo "$C_END $C_HILITE "
19 echo "$C_END $C_HILITE [$1]$C_NORMAL "
20 cd `dirname $myd`
21 ebuild $myf $1 &> $myl/$1
22 mye=$?
23 cd $tmpd
24
25
26 if [ -f $LOGDIR/$1 ]
27 then
28 cp $LOGDIR/$1 /tmp/failed
29 grep -v "$i" /tmp/failed > $LOGDIR/$1
30 fi
31
32 if [ $mye -ne 0 ]
33 then
34 echo "$C_END $C_HILITE "
35 echo "$C_END $C_NO [$1]$C_NORMAL "
36 echo $i >> $LOGDIR/$1
37 fi
38 }
39
40 if [ -z "${ROOT}" ]
41 then
42 echo "ROOT not set !"
43 exit 1
44 fi
45
46 mylist=${PORTDIR}/gentoo-x86/current-packages
47
48 if [ -f "${1}" ]
49 then
50 mylist=${1}
51 fi
52
53 mypackages="`grep -v "\#.*" $mylist`"
54
55
56 install -m1777 -d $ROOT/tmp/portage-log
57
58 echo "$C_HILITE>>>$C_NORMAL Building from ${mylist}..."
59 for i in $mypackages
60 do
61
62 # full path
63 myd=${i/.\//$PORTDIR\/gentoo-x86\/}
64
65 # file name
66 myf="`basename $myd`"
67
68 # category
69 myc="`echo $i | sed -e "s:^\./\(.*\).*/.*/.*$:\1:"`"
70
71 # package name
72 myp=${myf%*.ebuild}
73
74 if [ -f "$myd" ]
75 then
76
77 # Check if installed
78 if [ -d ${ROOT}/var/db/pkg/$myc/$myp ]
79 then
80 continue
81 fi
82
83 echo "$C_NORMAL$myp ($myc)"
84
85 myl="$LOGDIR/$myc/$myp/"
86 mkdir -p $myl
87
88 for j in ${STEPS}
89 do
90 mye=0
91 do_step $j
92 if [ $mye -ne 0 ]
93 then
94 break
95 fi
96 done
97 if [ $mye -eq 0 ]
98 then
99 echo "$C_END $C_OK [OK]$C_NORMAL "
100 fi
101
102 else
103 echo "!!! $myd does not exists !"
104 fi
105 ldconfig -r $ROOT &> /dev/null
106 done

  ViewVC Help
Powered by ViewVC 1.1.20