2017-09-13 21:57:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [[ ${DIB_DEBUG_TRACE:-0} -gt 0 ]]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
if mountpoint -q /dev/shm; then
|
|
|
|
echo "/dev/shm found in /proc/self/mountinfo"
|
|
|
|
elif [[ -k /dev/shm ]]; then
|
|
|
|
echo "/dev/shm exists and is stickied"
|
|
|
|
else
|
|
|
|
fix_shm
|
|
|
|
fi
|
|
|
|
|
2019-07-26 22:18:40 +00:00
|
|
|
[[ ! -f ${PORTDIR}/profiles ]] && emerge-webrsync -q
|
2017-09-13 21:57:12 +00:00
|
|
|
|
2021-01-21 17:35:27 +00:00
|
|
|
# set active python targets
|
2017-09-13 21:57:12 +00:00
|
|
|
echo "PYTHON_TARGETS=\"${GENTOO_PYTHON_TARGETS}\"" >> /etc/portage/make.conf
|
|
|
|
# disable python in git if we have to, it only supports python-2.7
|
2019-07-26 22:18:40 +00:00
|
|
|
[[ "${GENTOO_PYTHON_TARGETS}" != *"python2_7"* ]] && echo 'dev-vcs/git -python' >> /etc/portage/package.use/git
|
|
|
|
|
2020-04-03 05:50:14 +00:00
|
|
|
# install portage first due to bug in env vars not being passed when portage installs itself and re-inits
|
2021-01-21 17:35:27 +00:00
|
|
|
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --update --newuse --deep sys-apps/portage
|
2017-09-13 21:57:12 +00:00
|
|
|
# set the active python version
|
2021-01-21 17:35:27 +00:00
|
|
|
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --oneshot --update --newuse --nodeps dev-lang/python-exec python-exec-conf
|
|
|
|
echo yes | etc-update --automode -3 /etc/python-exec/python-exec.conf
|
2017-09-13 21:57:12 +00:00
|
|
|
|
|
|
|
# make world consistant
|
2018-10-08 05:39:35 +00:00
|
|
|
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --complete-graph=y --update --newuse --deep @world
|
2017-09-13 21:57:12 +00:00
|
|
|
# rebuild packages that might need it
|
2018-10-08 05:39:35 +00:00
|
|
|
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --usepkg=n @preserved-rebuild
|
2017-09-13 21:57:12 +00:00
|
|
|
# remove unneeded packages
|
2018-10-08 05:39:35 +00:00
|
|
|
emerge --verbose=n --depclean
|
2017-09-13 21:57:12 +00:00
|
|
|
# rebuild packages that might have somehow depended on the unneeded packages
|
2018-10-08 05:39:35 +00:00
|
|
|
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --usepkg=n @preserved-rebuild
|
2017-09-13 21:57:12 +00:00
|
|
|
|
|
|
|
unfix_shm
|