/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20