[game-data-packager] 02/02: add ppa.py, to be linked from d-d-games ML

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sat Nov 7 10:04:46 UTC 2015


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 a8f3c74705aa9f07a581cb49d5251b998f02a544
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sat Nov 7 11:02:18 2015 +0100

    add ppa.py, to be linked from d-d-games ML
---
 tools/ppa.py | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/tools/ppa.py b/tools/ppa.py
new file mode 100755
index 0000000..7821287
--- /dev/null
+++ b/tools/ppa.py
@@ -0,0 +1,66 @@
+#!/usr/bin/python3
+# encoding=utf-8
+#
+# Copyright © 2015 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
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# You can find the GPL license text on a Debian system under
+# /usr/share/common-licenses/GPL-2.
+
+import os
+import subprocess
+import time
+
+today = time.strftime('%Y%m%d')
+
+BASE = '/home/tchet/git'
+GDP = os.path.join(BASE, 'game-data-packager')
+
+subprocess.check_call(['git', 'checkout', 'debian/changelog'],
+                       cwd = GDP)
+
+with open('/usr/share/distro-info/ubuntu.csv', 'r') as data:
+    for line in data.readlines():
+       version, _, release, _, date, _ = line.split(',', 5)
+       if version == 'version':
+          continue
+       if time.strptime(date, '%Y-%m-%d') > time.localtime():
+          continue
+       current = release
+       if 'LTS' in version:
+          lts = release
+version = subprocess.check_output(['dpkg-parsechangelog',
+                                  '-l', os.path.join(GDP, 'debian/changelog'),
+                                  '-S', 'Version'],
+                                  universal_newlines = True).strip()
+releases = sorted(set([lts, current]))
+
+for release in releases:
+    snapshot = version + '~git' + today + '+' + release
+    subprocess.check_call(['dch', '-b',
+                           '-D', release,
+                           '-v', snapshot,
+                           "Git snapshot"],
+                          cwd = GDP)
+    subprocess.check_call(['debuild', '-S'],cwd = GDP)
+    subprocess.check_call(['dput', 'my-ppa',
+                           'game-data-packager_%s_source.changes' % snapshot],
+                           cwd = BASE)
+    subprocess.check_call(['git', 'checkout', 'debian/changelog'],
+                          cwd = GDP)
+    for file in ('.tar.xz',
+                 '.dsc',
+                 '_source.build',
+                 '_source.changes',
+                 '_source.my-ppa.upload'):
+        subprocess.check_call(['rm', '-v',
+                               'game-data-packager_%s%s' % (snapshot, file)],
+                              cwd = BASE)

-- 
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