/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20