Commit 7398e449 authored by Anton Midyukov's avatar Anton Midyukov

bin/check-pkg-list: return error, if lists contain unavailable packages

parent 2c3415ff
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
# (pkgnames file should contain `apt-cache pkgnames`) # (pkgnames file should contain `apt-cache pkgnames`)
# NB: -n pkgnames MUST go first, if given # NB: -n pkgnames MUST go first, if given
RET_ERROR=
error() { echo `basename $0`: $* >&2; exit 1; } error() { echo `basename $0`: $* >&2; exit 1; }
exit_handler() { exit_handler() {
...@@ -50,6 +52,7 @@ check_pkglist() { ...@@ -50,6 +52,7 @@ check_pkglist() {
done < "$fpkgwildcards" done < "$fpkgwildcards"
if [ -s "$fpkgerrors" ]; then if [ -s "$fpkgerrors" ]; then
echo "Error: Packages are not available in $fprofilelist:" >&2 echo "Error: Packages are not available in $fprofilelist:" >&2
RET_ERROR=1
cat $fpkgerrors >&2 cat $fpkgerrors >&2
fi fi
} }
...@@ -93,3 +96,5 @@ done ...@@ -93,3 +96,5 @@ done
for list in "$@"; do for list in "$@"; do
check_pkglist "$list" check_pkglist "$list"
done done
[ -z "$RET_ERROR" ] || error "Some lists contain unavailable packages"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment