X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=src%2Fidentify-distros;h=a3bc4028f26c6559e4d4901cddc5aef2a17da82d;hb=33796378c9b8fe2d6e30226fe0a977254b3246e8;hp=9c2221f43b7826137f1bbe3206984321fa3356eb;hpb=ed512c188a79f67fb69a6befadbe0043c435747b;p=distro-functions diff --git a/src/identify-distros b/src/identify-distros index 9c2221f..a3bc402 100644 --- a/src/identify-distros +++ b/src/identify-distros @@ -91,9 +91,34 @@ EOF fi done < <(echo "$policy" | sed -rn "$expression" | sort -rn || [[ $? == 141 ]]) echo "$shortest" - } +# formatted for use in pfile() in package-manager-abstractions +positive-origins() { + isdeb || return 0 + local archive expression pri name highpri shortest + local policy="${1:-$(apt-cache policy)}" || return $? + # a = archive + # n = codename + # o = origin + # c = component (licensing component) + # l = label (Debian{,-Security,-Updates}) + read -rd '' expression < 0 )); then + if [[ ! $origins ]]; then + origins=$name + else + origins+=,$name + fi + fi + done < <(echo "$policy" | sed -rn "$expression" | sort -rn || [[ $? == 141 ]]) + echo $origins +} isdebian-testing() { [[ $(debian-archive) == testing ]] @@ -118,6 +143,12 @@ debian-codename-compat() { etiona) echo bionic ;; + nabia) + echo focal + ;; + aramo) + echo jammy + ;; *) echo $n ;;