/[gentoo-x86]/scripts/autocompile.sh
Gentoo

Contents of /scripts/autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Mon Sep 27 20:07:36 2004 UTC (15 years ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/x-sh
FILE REMOVED
old stuff; use catalyst

1 #!/bin/sh
2
3 # description:
4 #
5 # ROOT is the root all packages are installed to
6 #
7 # if CHECK=yes then skip an already installed package
8 # if CHECK=package then skip a package if its tbz2 already exists
9 #
10 # ERRQUIT=no causes the script to keep trying to build packages even
11 # when one has failed.
12 #
13
14 C_NORMAL=$'\033[0m'
15 C_HILITE=$'\e[36;01m'
16 C_END=$'\e[A\e[68G'
17 C_OK=$'\e[32m'
18 C_NO=$'\e[31m'
19 #eval `/usr/lib/portage/bin/import-settings PORTDIR PKGDIR`
20 PORTDIR=/usr/portage
21 LOGDIR=${ROOT}/tmp/portage-log
22 PKGDIR=/usr/portage/packages
23 [ -z "$CHECK" ] && CHECK="yes"
24 [ -z "$STEPS" ] && STEPS="check fetch clean compile install qmerge clean"
25 [ -z "$ERRQUIT" ] && ERRQUIT="no"
26
27 do_step() {
28
29 local tmpd
30 tmpd=`pwd`
31 echo "$C_END $C_HILITE "
32 echo "$C_END $C_HILITE [$1]$C_NORMAL "
33 cd `dirname $myd`
34 ebuild $myf $1 &> $myl/$1
35 mye=$?
36 cd $tmpd
37
38 if [ -f $LOGDIR/$1 ]
39 then
40 cp $LOGDIR/$1 /tmp/failed
41 grep -v "$i" /tmp/failed > $LOGDIR/$1
42 fi
43
44 if [ $mye -ne 0 ]
45 then
46 echo "$C_END $C_HILITE "
47 echo "$C_END $C_NO [$1]$C_NORMAL "
48 echo $i >> $LOGDIR/$1
49 [ "${ERRQUIT}" = "yes" ] && exit 1
50 fi
51 return $mye
52 }
53
54 if [ -z "${ROOT}" ]
55 then
56 echo "ROOT not set !"
57 exit 1
58 fi
59
60 mylist=${PORTDIR}/current-packages
61
62 if [ -f "${1}" ]
63 then
64 mylist=${1}
65 fi
66
67 mypackages="`grep -v "\#.*" $mylist`"
68
69 install -m1777 -d $ROOT/tmp/portage-log
70
71 echo "$C_HILITE>>>$C_NORMAL Building from ${mylist}..."
72 for i in $mypackages
73 do
74 source /etc/profile
75 # full path
76 myd=${i/.\//$PORTDIR\/}
77
78 # file name
79 myf="`basename $myd`"
80
81 # category
82 myc="`echo $i | sed -e "s:^\(.*\).*/.*/.*$:\1:"`"
83
84 # package name
85 myp=${myf%*.ebuild}
86
87 # debugging
88 # echo $myp
89
90 if [ -f "$myd" ]
91 then
92
93 # Check if installed
94 if [ "$CHECK" = "yes" ]
95 then
96 if [ -d ${ROOT}/var/db/pkg/$myc/$myp ]
97 then
98 continue
99 fi
100 else
101 if [ "$CHECK" = "package" ]
102 then
103 if [ -f ${PKGDIR}/All/$myp.tbz2 ]
104 then
105 continue
106 fi
107 fi
108 fi
109
110 echo "$C_NORMAL$myp ($myc)"
111
112 myl="$LOGDIR/$myc/$myp/"
113 mkdir -p $myl
114
115 for j in ${STEPS}
116 do
117 mye=0
118 do_step $j
119 if [ $mye -ne 0 ]
120 then
121 break
122 fi
123 done
124 if [ $mye -eq 0 ]
125 then
126 echo "$C_END $C_OK [OK]$C_NORMAL "
127 echo $i >> ${LOGDIR}/ok
128 fi
129
130 else
131 echo "!!! $myd does not exists !"
132 fi
133 env-update &>/dev/null
134
135 done

  ViewVC Help
Powered by ViewVC 1.1.20