/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download) (as text)
Wed Nov 22 06:48:18 2000 UTC (18 years ago) by achim
Branch: MAIN
Changes since 1.5: +4 -4 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     STEPS="check fetch clean unpack compile install qmerge clean"
12    
13     do_step() {
14    
15 achim 1.4 local tmpp
16     tmpd=`pwd`
17 achim 1.3 echo "$C_END $C_HILITE "
18 achim 1.6 echo "$C_END $C_HILITE [$1]$C_NORMAL "
19 achim 1.4 cd `dirname $myd`
20     ebuild $myf $1 &> $myl/$1
21 achim 1.5 mye=$?
22 achim 1.4 cd $tmpd
23 achim 1.5
24 achim 1.3
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 achim 1.6 echo "$C_END $C_NO [$1]$C_NORMAL "
35 achim 1.3 echo $i >> $LOGDIR/$1
36     fi
37     }
38 achim 1.1
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 achim 1.3 mkdir -p $ROOT/tmp/portage-log
56 achim 1.1
57 achim 1.3 echo "$C_HILITE>>>$C_NORMAL Building from ${mylist}..."
58 achim 1.1 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 achim 1.3 # Check if installed
77     if [ -d ${ROOT}var/db/pkg/$myc/$myp ]
78 achim 1.1 then
79     continue
80     fi
81    
82 achim 1.3 echo "$C_NORMAL$myp ($myc)"
83 achim 1.1
84 achim 1.3 myl="$LOGDIR/$myc/$myp/"
85     mkdir -p $myl
86 achim 1.1
87 achim 1.3 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 achim 1.6 echo "$C_END $C_OK [OK]$C_NORMAL "
99 achim 1.1 fi
100 achim 1.3
101 achim 1.1 else
102     echo "!!! $myd does not exists !"
103     fi
104 achim 1.6 done

  ViewVC Help
Powered by ViewVC 1.1.20