From 0d9e8c5f266d07ecc7aaf66ada51fc97dac9af0a Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Fri, 20 May 2016 02:40:24 +0000 Subject: [PATCH] Fix update detection in update_portage.sh --- scripts/update_portage.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/update_portage.sh b/scripts/update_portage.sh index a9f6912..f991620 100755 --- a/scripts/update_portage.sh +++ b/scripts/update_portage.sh @@ -113,9 +113,10 @@ trap "cleanup" INT TERM mount_overlay # End early if there are no upstream changes +# If rsync s executed more than once timestamps differed so we assume updates available echo 'Syncing gentoo portage tree ...' -emaint sync -r gentoo 2>/dev/null | grep -q 'You are already up to date' -[ $? -eq 0 ] && { echo 'No upstream changes. Exiting.'; cleanup; } +RUNS=$(emaint sync -r gentoo 2>/dev/null | grep -c 'Number of files') +[ $RUNS -le 2 ] && { echo 'No upstream changes. Exiting.'; cleanup; } # Optional step to customize the tree, mostly to alter upstream use masks customize