From c3a036e54fa94e3874ccd1802fcd1d17ef0c4144 Mon Sep 17 00:00:00 2001 From: Matthew Thode Date: Mon, 22 Aug 2016 07:14:25 -0500 Subject: [PATCH] Update portage only if needed Currently we update portage whenever we could need it. Instead we should update portage only if we actually need to. This update adds a check to do so. Change-Id: Ifdb27fd844b0b3a169ced945ac7ee0ddc235e9ec --- elements/gentoo/bin/install-packages | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/elements/gentoo/bin/install-packages b/elements/gentoo/bin/install-packages index d452b177..f0a4bf49 100755 --- a/elements/gentoo/bin/install-packages +++ b/elements/gentoo/bin/install-packages @@ -79,7 +79,9 @@ eval set -- "${TEMP}" while true; do case "${1}" in -u ) - emerge-webrsync -q + if [[ ! -f /usr/portage/profiles ]]; then + emerge-webrsync -q + fi install_gentoo_packages -uDNv --with-bdeps=y --jobs=2 @world install_gentoo_packages --verbose=n --depclean install_gentoo_packages -v --usepkg=n @preserved-rebuild @@ -122,10 +124,14 @@ if [[ -z "${PKGS}" ]]; then echo "Not running install-packages ${ACTION} with empty packages list" else if [[ "${ACTION}" == 'install' ]]; then - emerge-webrsync -q + if [[ ! -f /usr/portage/profiles ]]; then + emerge-webrsync -q + fi install_gentoo_packages -q --jobs=2 --changed-use "${PKGS}" elif [[ "${ACTION}" == 'remove' ]]; then - emerge-webrsync -q + if [[ ! -f /usr/portage/profiles ]]; then + emerge-webrsync -q + fi install_gentoo_packages -C "${PKGS}" else echo 'something when really wrong, install action is not install or remove'