diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-08 12:30:43 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-08 12:30:43 +0100 |
commit | a54e20a21ee24306f34a9bfeffdeabcac32be490 (patch) | |
tree | 8fcf92a4eb43ff0539c3c9d63a6f1b7d59f48680 | |
parent | 44b755e788dd7ba8d46848def865e9da8cd950f5 (diff) |
Add ability to skip Portage and layman tree syncing
-rwxr-xr-x | portage-update.sh | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/portage-update.sh b/portage-update.sh index 7c92bbd..19c5727 100755 --- a/portage-update.sh +++ b/portage-update.sh @@ -18,14 +18,18 @@ SAFE_SERVICES="cupsd lvmetad ntpd smartd sshd tor syslog-ng vixie-cron webmin" while test $# -gt 0 do case "$1" in + --skip-sync) export SKIP_SYNC="true" # In case we don't to --sync the Portage tree + ;; + --skip-layman-sync) export SKIP_LAYMAN_SYNC="true" # In case we don't to --sync-all Layman + ;; + --skip-news) export SKIP_NEWS="true" # In case we don't to read new news before continuing + ;; --skip-update) export SKIP_UPDATE="true" # In case we don't want to do the actual "emerge --update" ;; --skip-depclean) export SKIP_DEPCLEAN="true" # In case we don't want to do an "emerge --depclean" ;; --skip-preserved-rebuild) export SKIP_PRESERVED_REBUILD="true" # In case we don't want to do an "emerge @preserved-rebuild" ;; - --skip-news) export SKIP_NEWS="true" # In case we don't to read new news before continuing - ;; --*) echo "bad argument '$1'" ; exit 1 ;; *) echo "unexpected argument '$1'" ; exit 1 @@ -34,15 +38,19 @@ do shift done -# Sync the Portage tree -echo 'emerge --sync' -emerge --sync || exit 1 +# Sync the Portage tree, unless skipped +if [ -z ${SKIP_SYNC+x} ]; then + echo 'emerge --sync' + emerge --sync || exit 1 +fi -# Sync Layman repos -echo 'layman -S' -# Only try to run layman if the command seems to exist -if command -v layman > /dev/null; then - layman -S || exit 1 +# Sync Layman repos, unless skipped +if [ -z ${SKIP_LAYMAN_SYNC+x} ]; then + echo 'layman -S' + # Only try to run layman if the command seems to exist + if command -v layman > /dev/null; then + layman -S || exit 1 + fi fi # Check to see if there's any news, unless skipped |