2016-01-28 22:24:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [[ ${DIB_DEBUG_TRACE:-0} -gt 0 ]]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-09-13 21:57:12 +00:00
|
|
|
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
|
|
|
|
|
2018-10-08 05:39:35 +00:00
|
|
|
# sync if needed
|
|
|
|
[[ ! -e /usr/portage/profiles ]] && emerge-webrsync
|
|
|
|
|
2019-01-08 06:30:26 +00:00
|
|
|
# make world consistent
|
2018-10-08 05:39:35 +00:00
|
|
|
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --complete-graph=y --update --newuse --deep @world
|
2017-04-23 00:31:18 +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-04-23 00:31:18 +00:00
|
|
|
# remove unneeded packages
|
2018-10-08 05:39:35 +00:00
|
|
|
emerge --verbose=n --depclean
|
2017-04-23 00:31:18 +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
|
2016-01-28 22:24:12 +00:00
|
|
|
|
|
|
|
# update config files
|
|
|
|
etc-update --automode -5
|
|
|
|
|
|
|
|
# clean up portage files
|
|
|
|
emerge --verbose=n --depclean
|
|
|
|
emaint all -f
|
|
|
|
eselect news read all
|
|
|
|
|
2016-07-28 20:11:43 +00:00
|
|
|
if [[ "${GENTOO_PORTAGE_CLEANUP}" != "False" ]]; then
|
2017-11-01 03:04:29 +00:00
|
|
|
# remove the overlays
|
|
|
|
if [[ ${GENTOO_OVERLAYS} != '' ]]; then
|
|
|
|
for OVERLAY in ${GENTOO_OVERLAYS}; do
|
|
|
|
layman -d "${OVERLAY}"
|
|
|
|
done
|
|
|
|
fi
|
2016-01-28 22:24:12 +00:00
|
|
|
fi
|
2017-09-13 21:57:12 +00:00
|
|
|
|
|
|
|
unfix_shm
|
2018-03-22 18:57:57 +00:00
|
|
|
|
2018-10-08 05:39:35 +00:00
|
|
|
# remove within the chroot since /var/run is a symlink
|
|
|
|
rm -Rf /var/run/* /run/*
|