/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (show annotations) (download) (as text)
Fri Aug 10 14:44:54 2001 UTC (12 years, 11 months ago) by pete
Branch: MAIN
CVS Tags: HEAD
Changes since 1.19: +0 -0 lines
File MIME type: text/x-sh
FILE REMOVED
these files are now under scripts/

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 #eval `/usr/lib/portage/bin/import-settings PORTDIR PKGDIR`
10 PORTDIR=/usr/portage
11 LOGDIR=$ROOT/tmp/portage-log
12 if [ -z "$CHECK" ]
13 then
14 CHECK="yes"
15 fi
16 if [ -z "$STEPS" ]
17 then
18 STEPS="check fetch clean compile install qmerge clean"
19 fi
20 #STEPS="check unmerge"
21
22 do_step() {
23
24 local tmpp
25 tmpd=`pwd`
26 echo "$C_END $C_HILITE "
27 echo "$C_END $C_HILITE [$1]$C_NORMAL "
28 cd `dirname $myd`
29 ebuild $myf $1 &> $myl/$1
30 mye=$?
31 cd $tmpd
32
33
34 if [ -f $LOGDIR/$1 ]
35 then
36 cp $LOGDIR/$1 /tmp/failed
37 grep -v "$i" /tmp/failed > $LOGDIR/$1
38 fi
39
40 if [ $mye -ne 0 ]
41 then
42 echo "$C_END $C_HILITE "
43 echo "$C_END $C_NO [$1]$C_NORMAL "
44 echo $i >> $LOGDIR/$1
45 fi
46 }
47
48 if [ -z "${ROOT}" ]
49 then
50 echo "ROOT not set !"
51 exit 1
52 fi
53
54 mylist=${PORTDIR}/current-packages
55
56 if [ -f "${1}" ]
57 then
58 mylist=${1}
59 fi
60
61 mypackages="`grep -v "\#.*" $mylist`"
62
63
64 install -m1777 -d $ROOT/tmp/portage-log
65
66 echo "$C_HILITE>>>$C_NORMAL Building from ${mylist}..."
67 for i in $mypackages
68 do
69 source /etc/profile
70 # full path
71 myd=${i/.\//$PORTDIR\/}
72
73 # file name
74 myf="`basename $myd`"
75
76 # category
77 myc="`echo $i | sed -e "s:^\(.*\).*/.*/.*$:\1:"`"
78
79 # package name
80 myp=${myf%*.ebuild}
81
82 # debugging
83 # echo $myp
84
85 if [ -f "$myd" ]
86 then
87
88 # Check if installed
89 if [ "$CHECK" = "yes" ]
90 then
91 if [ -d ${ROOT}/var/db/pkg/$myc/$myp ]
92 then
93 continue
94 fi
95 else
96 if [ "$CHECK" = "package" ]
97 then
98 if [ -f ${PKGDIR}/All/$myp.tbz2 ]
99 then
100 continue
101 fi
102 fi
103 fi
104
105 echo "$C_NORMAL$myp ($myc)"
106
107 myl="$LOGDIR/$myc/$myp/"
108 mkdir -p $myl
109
110 for j in ${STEPS}
111 do
112 mye=0
113 do_step $j
114 if [ $mye -ne 0 ]
115 then
116 break
117 fi
118 done
119 if [ $mye -eq 0 ]
120 then
121 echo "$C_END $C_OK [OK]$C_NORMAL "
122 echo $i >> ${LOGDIR}/ok
123 fi
124
125 else
126 echo "!!! $myd does not exists !"
127 fi
128 env-update &>/dev/null
129
130 done

  ViewVC Help
Powered by ViewVC 1.1.20