/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download) (as text)
Mon Jan 22 04:26:51 2001 UTC (17 years, 5 months ago) by achim
Branch: MAIN
Changes since 1.14: +1 -1 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 source /etc/profile
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 else
92 if [ "$CHECK" = "package" ]
93 then
94 if [ -f ${PORTDIR}/packages/i486/All/$myp.tbz2 ]
95 then
96 continue
97 fi
98 fi
99 fi
100
101 echo "$C_NORMAL$myp ($myc)"
102
103 myl="$LOGDIR/$myc/$myp/"
104 mkdir -p $myl
105
106 for j in ${STEPS}
107 do
108 mye=0
109 do_step $j
110 if [ $mye -ne 0 ]
111 then
112 break
113 fi
114 done
115 if [ $mye -eq 0 ]
116 then
117 echo "$C_END $C_OK [OK]$C_NORMAL "
118 fi
119
120 else
121 echo "!!! $myd does not exists !"
122 fi
123 env-update &>/dev/null
124
125 done

  ViewVC Help
Powered by ViewVC 1.1.20