[game-data-packager] 01/01: add fake lgogdownloader program for tests ...

Alexandre Detiste detiste-guest at moszumanska.debian.org
Wed Sep 16 07:51:20 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 6c6978f01f8ca0e311511e5603921a135bf1ffc1
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Wed Sep 16 09:48:55 2015 +0200

    add fake lgogdownloader program for tests ...
    
    packaging ROTT from lgogdownloader sometimes works sometimes fail;
    this avoid to download the same file again and again repeatedly
---
 tools/fake_lgog.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/tools/fake_lgog.py b/tools/fake_lgog.py
new file mode 100755
index 0000000..db65204
--- /dev/null
+++ b/tools/fake_lgog.py
@@ -0,0 +1,58 @@
+#!/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.
+
+# fake lgogdownloader to symlink in ~/bin
+
+import argparse
+import subprocess
+
+parser = argparse.ArgumentParser(prog='lgogdownloader',
+            description='Fake lgogdownloader.')
+parser.add_argument('--download', action='store_true')
+parser.add_argument('--no-extra', action='store_true')
+parser.add_argument('--directory', metavar='DIR')
+parser.add_argument('--subdir-game', type=str)
+parser.add_argument('--platform', type=str)
+parser.add_argument('--language', type=str)
+parser.add_argument('--game', type=str)
+args = parser.parse_args()
+
+assert args.directory, 'Must specify --directory'
+assert args.game, 'Must specifiy --game'
+
+game = args.game.lstrip('^').rstrip('$')
+
+archive = {
+          'descent#en': 'setup_descent_2.1.0.8.exe',
+          'legend_of_kyrandia#en': 'setup_legend_of_kyrandia_2.1.0.14.exe',
+          'legend_of_kyrandia#de': 'setup_legend_of_kyrandia_german_2.1.0.14.exe',
+          'legend_of_kyrandia#fr': 'setup_legend_of_kyrandia_french_2.1.0.14.exe',
+          'loom#en': 'setup_loom_2.0.0.4.exe',
+          'rise_of_the_triad__dark_war#en': 'setup_rise_of_the_triad_2.0.0.5.exe',
+          }.get(game + '#' + (args.language or 'en'))
+
+if archive is None:
+    exit('Unknown game %s' % game)
+
+locate = subprocess.check_output(['locate', archive], universal_newlines=True)
+for file in locate.splitlines():
+    if file.endswith(archive):
+       break
+else:
+    exit('archive %s not found in "locate" database' % archive)
+
+subprocess.check_call(['cp', '--reflink=auto', '-v', file, args.directory])

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