Commit 842df8ac authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Use lsb_release only if available

fallback to uname command output as a distro codename. This allows
developers to use commands such `update-version` on other than linux
unix-like environments (FreeBSD, OSX etc.).
parent c3c33dd0
......@@ -230,7 +230,13 @@ def undebianize(branch):
def get_distribution_codename():
output = sh.lsb_release("-c") # pylint: disable=E1101
_, codename = output.split("\t")
codename = sh.uname().lower()
if codename == "linux":
# lets try to be more specific using lsb_release
try:
output = sh.lsb_release("-c") # pylint: disable=E1101
_, codename = output.split("\t")
except sh.CommandNotFound:
pass
codename = codename.strip()
return codename
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