9 for x in $(/tmp/build.sh)
11 echo $x >> /tmp/build.log
12 USE="-* build" emerge --usepkg --buildpkg --noreplace $x || exit 1
18 keepers="sys-kernel/linux-headers sys-devel/binutils sys-devel/gcc sys-apps/baselayout sys-libs/glibc virtual/glibc virtual/kernel"
19 if [ ${clst_rel_type} = "hardened" ]
21 keepers="${keepers} sys-devel/hardened-gcc"
23 # set everything to uid 999 (nouser)
25 install -d var/db/pkg2
30 [ "`ls var/db/pkg/${x}* 2>/dev/null`" = "" ] && continue
31 install -d var/db/pkg2/${category}
32 mv var/db/pkg/${category}/${package}* var/db/pkg2/${category}
35 mv var/db/pkg2 var/db/pkg
37 # clean out man, info and doc files
38 rm -rf usr/share/{man,doc,info}/*
40 # zap all .pyc and .pyo files
41 find -iname "*.py[co]" -exec rm -f {} \;
43 # cleanup all .a files except libgcc.a, *_nonshared.a and /usr/lib/portage/bin/*.a
44 find -iname "*.a" | `find -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' | grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a'` | xargs rm -f
46 chroot ${ROOT} /bin/bash << EOF
47 #now, some finishing touches to initialize gcc-config....
49 if [ -e /usr/sbin/gcc-config ]
51 mythang=\$( cd /etc/env.d/gcc; ls ${clst_CHOST}-* )
52 gcc-config \${mythang}; env-update; source /etc/profile