#!/bin/zsh HOST=$(hostname) source $(dirname $0)/func.zsh check_root if [[ $HOST == "bogues" ]]; then if grep -qs '/media/ext_sd' /proc/mounts; then mount -o remount,exec,nouser,nousers /media/ext_sd mkdir -p /media/ext_sd/tmp chmod 777 /media/ext_sd/tmp else echo "External disk not mounted, exiting." exit fi rsync -avv /usr/portage/ /usr/portage_/ umount /usr/portage rm -f /usr/portage.squashfs rmdir /usr/portage mv /usr/portage_ /usr/portage fi emaint --check all emaint --fix all emerge --sync if [[ -e $(which layman) ]]; then layman -s SYNC ALL fi emerge --oneshot portage emerge --newuse -avuDN --with-bdeps y --keep-going world echo "-------------------------" read p\?"press enter to continue... " etc-update emerge -av --depclean perl-cleaner --reallyall revdep-rebuild emerge @preserved-rebuild eclean -d distfiles if [[ $HOST == "bogues" ]]; then mksquashfs /usr/portage /usr/portage.squashfs -comp xz rm -rf /usr/portage mkdir /usr/portage mount /usr/portage rm -r /media/ext_sd/tmp mount -o remount,users,auto /media/ext_sd fi