X-Git-Url: https://iankelling.org/git/?p=distro-functions;a=blobdiff_plain;f=src%2Fidentify-distros;fp=src%2Fidentify-distros;h=67d960820e6463cc1f6068b94de2c7da01933c11;hp=9c2221f43b7826137f1bbe3206984321fa3356eb;hb=da54fb345cff92b674bad5df4febf4484bb740d7;hpb=ed512c188a79f67fb69a6befadbe0043c435747b diff --git a/src/identify-distros b/src/identify-distros index 9c2221f..67d9608 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 brc +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,9 @@ debian-codename-compat() { etiona) echo bionic ;; + nabia) + echo focal + ;; *) echo $n ;;