/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations) (download) (as text)
Sat Jan 13 20:07:51 2001 UTC (19 years, 9 months ago) by achim
Branch: MAIN
Changes since 1.11: +8 -0 lines
File MIME type: text/x-sh
*** empty log message ***

1 achim 1.1 #!/bin/sh
2    
3    
4     C_NORMAL=$'\033[0m'
5     C_HILITE=$'\e[36;01m'
6 achim 1.3 C_END=$'\e[A\e[68G'
7 achim 1.1 C_OK=$'\e[32m'
8     C_NO=$'\e[31m'
9 achim 1.2 PORTDIR=/usr/portage
10 achim 1.3 LOGDIR=$ROOT/tmp/portage-log
11 achim 1.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 achim 1.7 #STEPS="check unmerge"
20 achim 1.3
21     do_step() {
22    
23 achim 1.4 local tmpp
24     tmpd=`pwd`
25 achim 1.3 echo "$C_END $C_HILITE "
26 achim 1.6 echo "$C_END $C_HILITE [$1]$C_NORMAL "
27 achim 1.4 cd `dirname $myd`
28     ebuild $myf $1 &> $myl/$1
29 achim 1.5 mye=$?
30 achim 1.4 cd $tmpd
31 achim 1.5
32 achim 1.3
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 achim 1.6 echo "$C_END $C_NO [$1]$C_NORMAL "
43 achim 1.3 echo $i >> $LOGDIR/$1
44     fi
45     }
46 achim 1.1
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 achim 1.8 install -m1777 -d $ROOT/tmp/portage-log
64 achim 1.1
65 achim 1.3 echo "$C_HILITE>>>$C_NORMAL Building from ${mylist}..."
66 achim 1.1 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 achim 1.3 # Check if installed
85 achim 1.11 if [ "$CHECK" = "yes" ]
86 achim 1.1 then
87 achim 1.11 if [ -d ${ROOT}/var/db/pkg/$myc/$myp ]
88     then
89     continue
90     fi
91 achim 1.12 else
92     if [ "$CHECK" = "package" ]
93     then
94     if [ -f ${PORTDIR}/packages/$myc/$myp.tbz2 ]
95     then
96     continue
97     fi
98     fi
99 achim 1.1 fi
100    
101 achim 1.3 echo "$C_NORMAL$myp ($myc)"
102 achim 1.1
103 achim 1.3 myl="$LOGDIR/$myc/$myp/"
104     mkdir -p $myl
105 achim 1.1
106 achim 1.3 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 achim 1.6 echo "$C_END $C_OK [OK]$C_NORMAL "
118 achim 1.1 fi
119 achim 1.3
120 achim 1.1 else
121     echo "!!! $myd does not exists !"
122     fi
123 achim 1.11 env-update &>/dev/null
124 achim 1.6 done

  ViewVC Help
Powered by ViewVC 1.1.20