summaryrefslogtreecommitdiff
blob: 3baae1d2bc9f862279a2381faccb258b6448b233 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

LIST=$1

#We really need to upgrade baselayout now that it's possible:
myBASELAYOUT=`grep "sys-apps/baselayout" $1`
myPORTAGE=`grep "sys-apps/portage" $1`
myGETTEXT=`grep "sys-devel/gettext" $1`
myBINUTILS=`grep "sys-devel/binutils" $1`
myGCC=`grep "sys-devel/gcc" $1`
myGLIBC=`grep "sys-libs/glibc" $1`
myTEXINFO=`grep "sys-apps/texinfo" $1`

echo "Using $myBASELAYOUT"
echo "Using $myPORTAGE"
echo "Using $myBINUTILS"
echo "Using $myGCC"
echo "Using $myGETTEXT"
echo "Using $myGLIBC"

cleanup() {
	cp /etc/make.conf.build /etc/make.conf
	exit $1
}

#USE may be set from the environment so we back it up for later.
export ORIGUSE="`spython -c 'import portage; print portage.settings["USE"];'`"
export USE="build"
#get correct CFLAGS, CHOST, CXXFLAGS, MAKEOPTS since make.conf will be
#overwritten
cp /etc/make.conf /etc/make.conf.build
export CFLAGS="`spython -c 'import portage; print portage.settings["CFLAGS"];'`"
export CHOST="`spython -c 'import portage; print portage.settings["CHOST"];'`"
export CXXFLAGS="`spython -c 'import portage; print portage.settings["CXXFLAGS"];'`"
export MAKEOPTS="`spython -c 'import portage; print portage.settings["MAKEOPTS"];'`"

export CONFIG_PROTECT=""
#above allows portage to overwrite stuff
cd /usr/portage
emerge $myPORTAGE #separate, so that the next command uses the *new* emerge
emerge $myBASELAYOUT $myBINUTILS $myGCC $myGETTEXT || cleanup 1
#make.conf has been overwritten, so we explicitly export our original settings
export USE="$ORIGUSE"
# This line should no longer be required
emerge $myGLIBC $myGETTEXT $myBINUTILS $myGCC $myTEXINFO || cleanup 1
#restore original make.conf
cleanup 0