[game-data-packager] 02/02: RTCW: fix French & Spanish mission 1 briefing (#803128)
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Tue Oct 27 09:24:04 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 53e6bc40206214a125e840fae24905c6ca6d2c35
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Tue Oct 27 10:23:27 2015 +0100
RTCW: fix French & Spanish mission 1 briefing (#803128)
---
debian/changelog | 1 +
game_data_packager/games/rtcw.py | 50 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index ef6d610..6c44ceb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -95,6 +95,7 @@ game-data-packager (43) UNRELEASED; urgency=medium
* Search for Steam at the root of a disk, since C:\ on SSD and
D:\Steam on HDD is a somewhat popular setup
* Pack game data into a zip file for faster startup when installed
+ * RTCW: fix mission 1 French & Spanish briefing (Closes: #803128)
[ Markus Koschany ]
* Vcs-Browser: Use cgit and https.
diff --git a/game_data_packager/games/rtcw.py b/game_data_packager/games/rtcw.py
new file mode 100644
index 0000000..a171d7a
--- /dev/null
+++ b/game_data_packager/games/rtcw.py
@@ -0,0 +1,50 @@
+#!/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 version 2
+# as published by the Free Software Foundation.
+#
+# 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 logging
+import os
+import zipfile
+
+from .. import (GameData)
+from ..build import (PackagingTask, mkdir_p)
+
+logger = logging.getLogger('game-data-packager.games.rtcw')
+
+class RTCWGameData(GameData):
+ def construct_task(self, **kwargs):
+ return RTCWTask(self, **kwargs)
+
+class RTCWTask(PackagingTask):
+ def fill_dest_dir(self, package, destdir):
+ if not super(RTCWTask, self).fill_dest_dir(package, destdir):
+ return False
+
+ if package.name not in ('rtcw-es-data', 'rtcw-fr-data'):
+ return True
+
+ zip_in = os.path.join(destdir, 'usr/share/games/rtcw/main', 'sp_pak1.pk3')
+ libdir = os.path.join(destdir, 'usr/lib/rtcw/main')
+ mkdir_p(libdir)
+ zip_out = os.path.join(libdir, 'sp_pak5.pk3')
+
+ with zipfile.ZipFile(zip_in, 'r') as zf_in:
+ with zipfile.ZipFile(zip_out, 'w') as zf_out:
+ txt = zf_in.open('text/EnglishUSA/escape1.txt').read()
+ zf_out.writestr('text/EnglishUSA/escape1.txt', txt)
+
+ return True
+
+GAME_DATA_SUBCLASS = RTCWGameData
--
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