From c73ba35d74818a8c295a9136f0671b90d078dea5 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 4 Jun 2014 18:03:36 +0200 Subject: [PATCH] autodist-upstream-updates: fix exiting with an error message if srcpkglist is bad --- autodist-upstream-updates | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/autodist-upstream-updates b/autodist-upstream-updates index a83e922..33dc52d 100755 --- a/autodist-upstream-updates +++ b/autodist-upstream-updates @@ -24,16 +24,6 @@ XORG_RELEASE=current done } -[ -r $PKGLIST_FILE ] || { - echo "Error: file $PKGLIST_FILE cannot be read; aborting." >&2 - exit 1 -} - -[ -r $ALIASES_DB ] || { - echo "Error: file $ALIASES_DB cannot be read; aborting." >&2 - exit 1 -} - function usage() { echo "openmamba-upstream-updates - finds upstream packages updates from different internet resources" @@ -168,6 +158,15 @@ UPDATES_DB=$CACHE_DIR/upstream-updates ALIASES_DB=$CACHE_DIR/aliases MANUALVER_DB=$CACHE_DIR/manualver +[ -s $PKGLIST_FILE ] || { + echo "Error: file $PKGLIST_FILE is missing or empty; aborting." >&2 + exit 1 +} + +[ -r $ALIASES_DB ] || { + echo "Error: file $ALIASES_DB cannot be read; aborting." >&2 + exit 1 +} parse_arch_linux() { # parse Arch Linux package list