|
|
@ -1,4 +1,4 @@
|
|
|
|
# Copyright 2015,2016,2017 Nir Cohen
|
|
|
|
# Copyright 2015-2021 Nir Cohen
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
@ -59,7 +59,7 @@ except ImportError:
|
|
|
|
# Python 3.7
|
|
|
|
# Python 3.7
|
|
|
|
TypedDict = dict
|
|
|
|
TypedDict = dict
|
|
|
|
|
|
|
|
|
|
|
|
__version__ = "1.8.0"
|
|
|
|
__version__ = "1.9.0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VersionDict(TypedDict):
|
|
|
|
class VersionDict(TypedDict):
|
|
|
@ -129,6 +129,7 @@ _DISTRO_RELEASE_BASENAME_PATTERN = re.compile(r"(\w+)[-_](release|version)$")
|
|
|
|
# Base file names to be looked up for if _UNIXCONFDIR is not readable.
|
|
|
|
# Base file names to be looked up for if _UNIXCONFDIR is not readable.
|
|
|
|
_DISTRO_RELEASE_BASENAMES = [
|
|
|
|
_DISTRO_RELEASE_BASENAMES = [
|
|
|
|
"SuSE-release",
|
|
|
|
"SuSE-release",
|
|
|
|
|
|
|
|
"altlinux-release",
|
|
|
|
"arch-release",
|
|
|
|
"arch-release",
|
|
|
|
"base-release",
|
|
|
|
"base-release",
|
|
|
|
"centos-release",
|
|
|
|
"centos-release",
|
|
|
@ -155,6 +156,8 @@ _DISTRO_RELEASE_IGNORE_BASENAMES = (
|
|
|
|
"system-release",
|
|
|
|
"system-release",
|
|
|
|
"plesk-release",
|
|
|
|
"plesk-release",
|
|
|
|
"iredmail-release",
|
|
|
|
"iredmail-release",
|
|
|
|
|
|
|
|
"board-release",
|
|
|
|
|
|
|
|
"ec2_version",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -247,6 +250,7 @@ def id() -> str:
|
|
|
|
"rocky" Rocky Linux
|
|
|
|
"rocky" Rocky Linux
|
|
|
|
"aix" AIX
|
|
|
|
"aix" AIX
|
|
|
|
"guix" Guix System
|
|
|
|
"guix" Guix System
|
|
|
|
|
|
|
|
"altlinux" ALT Linux
|
|
|
|
============== =========================================
|
|
|
|
============== =========================================
|
|
|
|
|
|
|
|
|
|
|
|
If you have a need to get distros for reliable IDs added into this set,
|
|
|
|
If you have a need to get distros for reliable IDs added into this set,
|
|
|
@ -995,10 +999,10 @@ class LinuxDistribution:
|
|
|
|
|
|
|
|
|
|
|
|
For details, see :func:`distro.info`.
|
|
|
|
For details, see :func:`distro.info`.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
return dict(
|
|
|
|
return InfoDict(
|
|
|
|
id=self.id(),
|
|
|
|
id=self.id(),
|
|
|
|
version=self.version(pretty, best),
|
|
|
|
version=self.version(pretty, best),
|
|
|
|
version_parts=dict(
|
|
|
|
version_parts=VersionDict(
|
|
|
|
major=self.major_version(best),
|
|
|
|
major=self.major_version(best),
|
|
|
|
minor=self.minor_version(best),
|
|
|
|
minor=self.minor_version(best),
|
|
|
|
build_number=self.build_number(best),
|
|
|
|
build_number=self.build_number(best),
|
|
|
|