Index: head/sysutils/py-distro/files/patch-pr207-bsdsupport =================================================================== --- head/sysutils/py-distro/files/patch-pr207-bsdsupport (revision 492134) +++ head/sysutils/py-distro/files/patch-pr207-bsdsupport (nonexistent) @@ -1,106 +0,0 @@ ---- distro.py.orig 2017-12-24 16:29:31 UTC -+++ distro.py -@@ -1,4 +1,4 @@ --# Copyright 2015,2016 Nir Cohen -+# Copyright 2015,2016,2017 Nir Cohen - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. -@@ -932,9 +932,16 @@ class LinuxDistribution(object): - cmd = ('lsb_release', '-a') - stdout = subprocess.check_output(cmd, stderr=devnull) - except OSError: # Command not found -- return {} -+ try: -+ cmd = ('uname', '-rs') -+ stdout = subprocess.check_output(cmd, stderr=devnull) -+ except OSError: -+ return {} - content = stdout.decode(sys.getfilesystemencoding()).splitlines() -- return self._parse_lsb_release_content(content) -+ if cmd[0] == 'lsb_release': -+ return self._parse_lsb_release_content(content) -+ else: -+ return self._parse_uname_content(content) - - @staticmethod - def _parse_lsb_release_content(lines): -@@ -958,6 +965,18 @@ class LinuxDistribution(object): - continue - k, v = kv - props.update({k.replace(' ', '_').lower(): v.strip()}) -+ return props -+ -+ @staticmethod -+ def _parse_uname_content(lines): -+ props = {} -+ match = re.search(r'^([^\s]+)\s+([\d\.]+)', lines[0].strip()) -+ if match: -+ name, version = match.groups() -+ props['id'] = name.lower() -+ props['distributor_id'] = name -+ props['release'] = version -+ props['description'] = name + ' ' + version - return props - - @cached_property ---- tests/resources/distros/freebsd111/bin/uname.orig 2017-12-31 03:40:48 UTC -+++ tests/resources/distros/freebsd111/bin/uname -@@ -0,0 +1,4 @@ -+#!/bin/bash -+ -+echo "FreeBSD 11.1-RELEASE" -+ ---- tests/resources/distros/netbsd711/bin/uname.orig 2017-12-31 03:40:48 UTC -+++ tests/resources/distros/netbsd711/bin/uname -@@ -0,0 +1,4 @@ -+#!/bin/bash -+ -+echo "NetBSD 7.1.1" -+ ---- tests/resources/distros/openbsd62/bin/uname.orig 2017-12-31 03:40:48 UTC -+++ tests/resources/distros/openbsd62/bin/uname -@@ -0,0 +1,4 @@ -+#!/bin/bash -+ -+echo "OpenBSD 6.2" -+ ---- tests/test_distro.py.orig 2017-12-24 16:26:25 UTC -+++ tests/test_distro.py -@@ -450,6 +450,36 @@ class TestLSBRelease(DistroTestCase): - # } - # self._test_outcome(desired_outcome) - -+ def test_openbsd62_uname(self): -+ self._test_outcome({ -+ 'id': 'openbsd', -+ 'name': 'OpenBSD', -+ 'version': '6.2', -+ 'pretty_name': 'OpenBSD 6.2', -+ 'pretty_version': '6.2', -+ 'best_version': '6.2' -+ }) -+ -+ def test_netbsd711_uname(self): -+ self._test_outcome({ -+ 'id': 'netbsd', -+ 'name': 'NetBSD', -+ 'version': '7.1.1', -+ 'pretty_name': 'NetBSD 7.1.1', -+ 'pretty_version': '7.1.1', -+ 'best_version': '7.1.1' -+ }) -+ -+ def test_freebsd111_uname(self): -+ self._test_outcome({ -+ 'id': 'freebsd', -+ 'name': 'FreeBSD', -+ 'version': '11.1', -+ 'pretty_name': 'FreeBSD 11.1', -+ 'pretty_version': '11.1', -+ 'best_version': '11.1' -+ }) -+ - def test_ubuntu14normal_lsb_release(self): - self._setup_for_distro(os.path.join(TESTDISTROS, 'lsb', - 'ubuntu14_normal')) Property changes on: head/sysutils/py-distro/files/patch-pr207-bsdsupport ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/py-distro/Makefile =================================================================== --- head/sysutils/py-distro/Makefile (revision 492134) +++ head/sysutils/py-distro/Makefile (revision 492135) @@ -1,21 +1,22 @@ # Created by: Ben Woods # $FreeBSD$ PORTNAME= distro -PORTVERSION= 1.2.0 +PORTVERSION= 1.4.0 CATEGORIES= sysutils python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= woodsb02@FreeBSD.org COMMENT= Linux OS platform information API LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= python shebangfix USE_PYTHON= autoplist concurrent distutils + SHEBANG_FILES= query_local_distro.py NO_ARCH= yes .include Index: head/sysutils/py-distro/distinfo =================================================================== --- head/sysutils/py-distro/distinfo (revision 492134) +++ head/sysutils/py-distro/distinfo (revision 492135) @@ -1,3 +1,3 @@ -TIMESTAMP = 1514689680 -SHA256 (distro-1.2.0.tar.gz) = d94370e43b676ac44fbe1ab68ca903a6147eaba3a9e8eff85b2c05556a455b76 -SIZE (distro-1.2.0.tar.gz) = 45893 +TIMESTAMP = 1549288968 +SHA256 (distro-1.4.0.tar.gz) = 362dde65d846d23baee4b5c058c8586f219b5a54be1cf5fc6ff55c4578392f57 +SIZE (distro-1.4.0.tar.gz) = 53719