[game-data-packager] 01/01: make local part of version number overidable by foreign distros
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Thu Jul 28 09:26:26 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 949be23f2daa83afab7c27a7d6eefc4dfeee36da
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Thu Jul 28 11:20:53 2016 +0200
make local part of version number overidable by foreign distros
reminder to myself: change RPMFusion specfile elsewhere:
%install
-make DESTDIR=$RPM_BUILD_ROOT bindir=/usr/bin datadir=/usr/share install
+make RELEASE=%{?dist} DESTDIR=$RPM_BUILD_ROOT bindir=/usr/bin datadir=/usr/share install
---
Makefile | 2 +-
game_data_packager/util.py | 8 ++++----
game_data_packager/version.py | 8 +++++++-
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 8002a2f..535acd3 100644
--- a/Makefile
+++ b/Makefile
@@ -135,7 +135,7 @@ install:
mkdir -p $(DESTDIR)$(datadir)/game-data-packager
cp -ar game_data_packager/ $(DESTDIR)$(datadir)/game-data-packager/
- python3 -m game_data_packager.version > $(DESTDIR)$(datadir)/game-data-packager/game_data_packager/version.py
+ python3 -m game_data_packager.version $(RELEASE) > $(DESTDIR)$(datadir)/game-data-packager/game_data_packager/version.py
install -m0644 out/*.copyright $(DESTDIR)$(datadir)/game-data-packager/
install -m0644 out/*.png $(DESTDIR)$(datadir)/game-data-packager/
install -m0644 out/*.svgz $(DESTDIR)$(datadir)/game-data-packager/
diff --git a/game_data_packager/util.py b/game_data_packager/util.py
index be946d4..7f81143 100644
--- a/game_data_packager/util.py
+++ b/game_data_packager/util.py
@@ -2,7 +2,7 @@
# encoding=utf-8
#
# Copyright © 2014-2015 Simon McVittie <smcv at debian.org>
-# © 2015 Alexandre Detiste <alexandre at detiste.be>
+# © 2015-2016 Alexandre Detiste <alexandre at detiste.be>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -26,16 +26,16 @@ import subprocess
import sys
from .paths import DATADIR
-from .version import (GAME_PACKAGE_VERSION)
+from .version import (GAME_PACKAGE_VERSION, GAME_PACKAGE_RELEASE)
logger = logging.getLogger(__name__)
KIBIBYTE = 1024
MEBIBYTE = KIBIBYTE * KIBIBYTE
-AGENT = ('Debian Game-Data-Packager/%s (%s %s;'
+AGENT = ('Debian Game-Data-Packager/%s%s (%s %s;'
' +http://wiki.debian.org/Games/GameDataPackager)' %
- (GAME_PACKAGE_VERSION, os.uname()[0], os.uname()[4]) )
+ (GAME_PACKAGE_VERSION, GAME_PACKAGE_RELEASE, os.uname()[0], os.uname()[4]) )
class TemporaryUmask(object):
"""Context manager to set the umask. Not thread-safe.
diff --git a/game_data_packager/version.py b/game_data_packager/version.py
index d2828a7..9c85a91 100644
--- a/game_data_packager/version.py
+++ b/game_data_packager/version.py
@@ -4,6 +4,7 @@
# with a generated version during installation.
import os
+import sys
with open('debian/changelog', encoding='utf-8') as cl:
try:
@@ -14,6 +15,11 @@ with open('debian/changelog', encoding='utf-8') as cl:
cl = ChangeLog(cl, strict=False)
GAME_PACKAGE_VERSION = str(cl.full_version)
+if len(sys.argv) > 1:
+ GAME_PACKAGE_RELEASE = sys.argv[1]
+else:
+ GAME_PACKAGE_RELEASE = ''
+
details = {}
if os.path.isfile('/etc/os-release'):
with open('/etc/os-release', encoding='utf-8') as release:
@@ -49,5 +55,5 @@ else:
if __name__ == '__main__':
print('#!/usr/bin/python3')
- for const in ('GAME_PACKAGE_VERSION', 'FORMAT', 'DISTRO'):
+ for const in ('GAME_PACKAGE_VERSION', 'GAME_PACKAGE_RELEASE', 'FORMAT', 'DISTRO'):
print('%s = "%s"' % (const, eval(const)))
--
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