quarks/scripts/update_box.sh

31 lines
763 B
Bash
Raw Normal View History

2015-09-19 02:32:46 +00:00
#!/bin/sh
2016-05-19 01:14:09 +00:00
#set -x
2015-09-19 02:32:46 +00:00
set -e
2016-05-19 01:14:09 +00:00
TODO=$(emerge -q --update --deep --newuse --pretend --with-bdeps=y world)
[ "${TODO}x" == "x" ] && { echo "Nothing to merge."; exit 0; }
2015-09-19 02:32:46 +00:00
# parallel jobs to speed up configure runs etc.
# but only half as many if CPU cores > 4
CPUS=$(nproc)
[ $CPUS -ge 4 ] && JOBS="--jobs $((CPUS/2))"
2016-05-19 01:14:09 +00:00
emerge --ask --update --deep --newuse --keep-going --accept-properties=-interactive --fail-clean --with-bdeps=y ${JOBS} world
2015-09-19 02:32:46 +00:00
echo "Going to remove unneeded packages ..."
emerge --depclean
if [ -x $(which localepurge) ]; then
echo "Removing unneeded locales..."
localepurge
fi
echo "Fixing dependencies..."
revdep-rebuild -i
echo "Updating eix cache..."
eix-update -q
echo "Cleaning up archives.."
eclean -q -d packages
eclean -q -d distfiles