/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download) (as text)
Wed Nov 22 06:48:18 2000 UTC (17 years, 1 month ago) by achim
Branch: MAIN
Changes since 1.5: +4 -4 lines
File MIME type: text/x-sh
*** empty log message ***

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

  ViewVC Help
Powered by ViewVC 1.1.20