From ea0ea68fce543e75a3e86c810b5b7a61884513ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 9 Oct 2018 10:12:13 +0200 Subject: sys-apps/personal-utils: improve emergefix Now it should rebuild on perl version update and it also rebuilds preserved packages. --- sys-apps/personal-utils/files/emergefix | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'sys-apps/personal-utils/files') diff --git a/sys-apps/personal-utils/files/emergefix b/sys-apps/personal-utils/files/emergefix index 8104342..56754bf 100755 --- a/sys-apps/personal-utils/files/emergefix +++ b/sys-apps/personal-utils/files/emergefix @@ -1,15 +1,31 @@ #!/bin/sh set -e -echo -e '\e[1;34m========== Update packages ==========\e[0m' -emerge -auDN --with-bdeps=y --keep-going=y @world "$@" || { +fail_ask() { echo -ne "\e[1;31mContinue?\e[0m " read } -echo -e '\e[1;34m========== Rebuil packages ==========\e[0m' -revdep-rebuild -- "$@" || { - echo -ne "\e[1;31mContinue?\e[0m " - read + +get_perl_version() { + equery list -F '$version' dev-lang/perl } + +################################################################################# +perl_version="$(get_perl_version)" + +echo -e '\e[1;34m========== Update packages ==========\e[0m' +emerge -auDN --with-bdeps=y --keep-going=y @world "$@" || fail_ask + +if [ "$(get_perl_version)" != "$perl_version" ]; then + echo -e '\e[1;34m========== Rebuil perl (cleaner) ==========\e[0m' + perl-cleaner --all -- -1a --keep-going=y || fail_ask +fi + +echo -e '\e[1;34m========== Rebuil packages ==========\e[0m' +revdep-rebuild -- "$@" || fail_ask + +echo -e '\e[1;34m========== Rebuild preserved ones ==========\e[0m' +emerge --keep-going=y @preserved-rebuild || fail_ask + echo -e '\e[1;34m========== Clean packages ==========\e[0m' emerge --depclean -a "$@" -- cgit v1.2.3