/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download) (as text)
Fri Jan 5 03:21:55 2001 UTC (17 years, 8 months ago) by achim
Branch: MAIN
Changes since 1.10: +14 -5 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 if [ -z "$CHECK" ]
12 then
13 CHECK="yes"
14 fi
15 if [ -z "$STEPS" ]
16 then
17 STEPS="check fetch clean compile install qmerge clean"
18 fi
19 #STEPS="check unmerge"
20
21 do_step() {
22
23 local tmpp
24 tmpd=`pwd`
25 echo "$C_END $C_HILITE "
26 echo "$C_END $C_HILITE [$1]$C_NORMAL "
27 cd `dirname $myd`
28 ebuild $myf $1 &> $myl/$1
29 mye=$?
30 cd $tmpd
31
32
33 if [ -f $LOGDIR/$1 ]
34 then
35 cp $LOGDIR/$1 /tmp/failed
36 grep -v "$i" /tmp/failed > $LOGDIR/$1
37 fi
38
39 if [ $mye -ne 0 ]
40 then
41 echo "$C_END $C_HILITE "
42 echo "$C_END $C_NO [$1]$C_NORMAL "
43 echo $i >> $LOGDIR/$1
44 fi
45 }
46
47 if [ -z "${ROOT}" ]
48 then
49 echo "ROOT not set !"
50 exit 1
51 fi
52
53 mylist=${PORTDIR}/gentoo-x86/current-packages
54
55 if [ -f "${1}" ]
56 then
57 mylist=${1}
58 fi
59
60 mypackages="`grep -v "\#.*" $mylist`"
61
62
63 install -m1777 -d $ROOT/tmp/portage-log
64
65 echo "$C_HILITE>>>$C_NORMAL Building from ${mylist}..."
66 for i in $mypackages
67 do
68
69 # full path
70 myd=${i/.\//$PORTDIR\/gentoo-x86\/}
71
72 # file name
73 myf="`basename $myd`"
74
75 # category
76 myc="`echo $i | sed -e "s:^\./\(.*\).*/.*/.*$:\1:"`"
77
78 # package name
79 myp=${myf%*.ebuild}
80
81 if [ -f "$myd" ]
82 then
83
84 # Check if installed
85 if [ "$CHECK" = "yes" ]
86 then
87 if [ -d ${ROOT}/var/db/pkg/$myc/$myp ]
88 then
89 continue
90 fi
91 fi
92
93 echo "$C_NORMAL$myp ($myc)"
94
95 myl="$LOGDIR/$myc/$myp/"
96 mkdir -p $myl
97
98 for j in ${STEPS}
99 do
100 mye=0
101 do_step $j
102 if [ $mye -ne 0 ]
103 then
104 break
105 fi
106 done
107 if [ $mye -eq 0 ]
108 then
109 echo "$C_END $C_OK [OK]$C_NORMAL "
110 fi
111
112 else
113 echo "!!! $myd does not exists !"
114 fi
115 env-update &>/dev/null
116 done

  ViewVC Help
Powered by ViewVC 1.1.20