From: Ian Kelling Date: Mon, 29 Apr 2019 17:37:50 +0000 (-0400) Subject: better error handling X-Git-Url: https://iankelling.org/git/?p=distro-functions;a=commitdiff_plain;h=b603450a2502e1ae500f1527d4c4e8002e15d9be better error handling --- diff --git a/src/identify-distros b/src/identify-distros index 011ddb5..c3cfc72 100644 --- a/src/identify-distros +++ b/src/identify-distros @@ -47,7 +47,7 @@ distro-name-ver() { debian-archive() { isdeb || return 0 local archive expression pri name highpri shortest - local policy="${1:-$(apt-cache policy)}" + local policy="${1:-$(apt-cache policy)}" || return $? # a = archive # n = codename # o = origin @@ -93,7 +93,7 @@ isdebian-stable() { debian-codename() { isdeb || return 0 - local policy="$(apt-cache policy)" + local policy="$(apt-cache policy)" || return $? archive=$(debian-archive "$policy") echo "$policy" | sed -rn "s/^.*a=$archive,n=([a-z]+).*/\1/p;T;q" }