Updated make_destpath so it writes out to make.conf as well as exporting ROOT to...
[catalyst.git] / targets / stage1 / stage1-chroot.sh
1 #!/bin/bash
2
3 # We do this first, so we know our package list for --debug
4 export clst_buildpkgs="$(/tmp/build.py)"
5
6 source /tmp/chroot-functions.sh
7
8 # Setup our environment
9 STAGE1_USE="$(portageq envvar STAGE1_USE)"
10 FEATURES="${clst_myfeatures} nodoc noman noinfo"
11
12 ## Sanity check profile
13 if [ -z "${clst_buildpkgs}" ]
14 then
15         echo "Your profile seems to be broken."
16         echo "Could not build a list of build packages."
17         echo "Double check your /etc/make.profile link and the 'packages' files."
18         exit 1
19 fi
20
21 ## START BUILD
22 clst_root_path=/ setup_pkgmgr
23 make_destpath /tmp/stage1root
24
25 # First, we drop in a known-good baselayout
26 [ -e /etc/make.conf ] && \
27         echo 'USE="${USE} -build"' >> /etc/make.conf
28 run_merge "--oneshot --nodeps virtual/baselayout"
29 sed -i '/USE="${USE} -build"/d' /etc/make.conf
30
31 [ -e /etc/make.conf ] && \
32         echo "USE=\"-* bindist build ${STAGE1_USE} ${clst_HOSTUSE}\"" \
33         >> /etc/make.conf
34 run_merge "--noreplace --oneshot --newuse ${clst_buildpkgs}"
35 sed -i "/USE=\"-* bindist build ${STAGE1_USE} ${clst_HOSTUSE}\"/d" \
36         /etc/make.conf