diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-12-01 20:18:01 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-12-01 20:18:01 +0300 |
commit | 77d81aa4a3747b7dfbb17e43b16e1a514550c60c (patch) | |
tree | 0679778b3a5b46cb96d7c57485c847b83cc78bbf /debian/patches/platform-lsbrelease.diff | |
parent | c089c4500b0b78acf03ee5405ad250a84b0dfa66 (diff) | |
download | python3.8-debian.tar.gz |
Import python3.8 (3.8.0-5)debian/3.8.0-5debian
Diffstat (limited to 'debian/patches/platform-lsbrelease.diff')
-rw-r--r-- | debian/patches/platform-lsbrelease.diff | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/debian/patches/platform-lsbrelease.diff b/debian/patches/platform-lsbrelease.diff deleted file mode 100644 index 83f3df3..0000000 --- a/debian/patches/platform-lsbrelease.diff +++ /dev/null @@ -1,50 +0,0 @@ -# DP: Use /etc/lsb-release to identify the platform. - ---- a/Lib/platform.py -+++ b/Lib/platform.py -@@ -299,7 +299,7 @@ _release_version = re.compile(r'([^0-9]+ - _supported_dists = ( - 'SuSE', 'debian', 'fedora', 'redhat', 'centos', - 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', -- 'UnitedLinux', 'turbolinux', 'arch', 'mageia') -+ 'UnitedLinux', 'turbolinux', 'arch', 'mageia', 'Ubuntu') - - def _parse_release_file(firstline): - -@@ -328,6 +328,10 @@ def _parse_release_file(firstline): - id = l[1] - return '', version, id - -+_distributor_id_file_re = re.compile(r"(?:DISTRIB_ID\s*=)\s*(.*)", re.I) -+_release_file_re = re.compile(r"(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I) -+_codename_file_re = re.compile(r"(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I) -+ - def linux_distribution(distname='', version='', id='', - - supported_dists=_supported_dists, -@@ -360,6 +364,25 @@ def _linux_distribution(distname, versio - args given as parameters. - - """ -+ # check for the Debian/Ubuntu /etc/lsb-release file first, needed so -+ # that the distribution doesn't get identified as Debian. -+ try: -+ with open("/etc/lsb-release", "r") as etclsbrel: -+ for line in etclsbrel: -+ m = _distributor_id_file_re.search(line) -+ if m: -+ _u_distname = m.group(1).strip() -+ m = _release_file_re.search(line) -+ if m: -+ _u_version = m.group(1).strip() -+ m = _codename_file_re.search(line) -+ if m: -+ _u_id = m.group(1).strip() -+ if _u_distname and _u_version: -+ return (_u_distname, _u_version, _u_id) -+ except (EnvironmentError, UnboundLocalError): -+ pass -+ - try: - etc = os.listdir(_UNIXCONFDIR) - except OSError: |