From 5b49c5c9dc14d5882acd1fe7f3a5eeddace34fdd Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sat, 1 Dec 2018 08:50:00 +0100 Subject: upgrade-gentoo: run as root, layman --- upgrade-gentoo | 57 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/upgrade-gentoo b/upgrade-gentoo index e7be3e3..03e7c50 100755 --- a/upgrade-gentoo +++ b/upgrade-gentoo @@ -2,42 +2,49 @@ HOST=$(hostname) +source $HOME/.local/bin/func.zsh + +check_root + if [[ $HOST == "bogues" ]]; then if grep -qs '/media/ext_sd' /proc/mounts; then - sudo mount -o remount,exec,nouser,nousers /media/ext_sd - sudo mkdir -p /media/ext_sd/tmp - sudo chmod 777 /media/ext_sd/tmp + 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 - cd /usr - sudo rsync -avv portage/ portage_/ - sudo umount portage - sudo rm portage.squashfs - sudo mv portage_ portage + rsync -avv /usr/portage/ /usr/portage_/ + umount /usr/portage + rm -f /usr/portage.squashfs + mv /usr/portage_ /usr/portage fi -sudo perl-cleaner --reallyall -sudo emaint --check all -sudo emaint --fix all -sudo emerge --sync -sudo emerge -avuDN --with-bdeps y --keep-going world +perl-cleaner --reallyall +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... " -sudo etc-update -sudo emerge -av --depclean -sudo revdep-rebuild -sudo emerge @preserved-rebuild -sudo eclean -d distfiles -sudo localepurge +etc-update +emerge -av --depclean +revdep-rebuild +emerge @preserved-rebuild +eclean -d distfiles +localepurge if [[ $HOST == "bogues" ]]; then - sudo mksquashfs portage portage.squashfs -comp xz - sudo rm -rf /usr/portage - sudo mkdir /usr/portage - sudo mount portage - sudo rm -r /media/ext_sd/tmp - sudo mount -o remount,users,auto /media/ext_sd + 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 -- cgit v1.2.3