[game-data-packager] 01/01: /etc/SuSE-release is deprecated and not present by default on build servers

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sun Mar 20 10:54:58 UTC 2016


This is an automated email from the git hooks/post-receive script.

detiste-guest pushed a commit to branch master
in repository game-data-packager.

commit 17dc235830dadca585581c62decec75afb8cb39e
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sun Mar 20 11:53:40 2016 +0100

    /etc/SuSE-release is deprecated and not present by default on build servers
---
 game_data_packager/version.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/game_data_packager/version.py b/game_data_packager/version.py
index 629442e..107a3cf 100644
--- a/game_data_packager/version.py
+++ b/game_data_packager/version.py
@@ -14,6 +14,13 @@ with open('debian/changelog', encoding='utf-8') as cl:
         cl = ChangeLog(cl, strict=False)
         GAME_PACKAGE_VERSION = str(cl.full_version)
 
+details = {}
+if os.path.isfile('/etc/os-release'):
+    with open('/etc/os-release', encoding='utf-8') as release:
+        for line in release:
+            key, value = line.strip().split('=', 1)
+            details[key]=value.strip('"')
+
 if os.path.isfile('/etc/debian_version'):
     FORMAT = 'deb'
     DISTRO = 'generic'
@@ -27,7 +34,7 @@ elif os.path.isfile('/etc/redhat-release'):
     FORMAT = 'rpm'
     DISTRO = 'fedora'
 
-elif os.path.isfile('/etc/SuSE-release'):
+elif os.path.isfile('/etc/SuSE-release') or details.get('ID_LIKE') == 'suse':
     FORMAT = 'rpm'
     DISTRO = 'suse'
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list