[game-data-packager] 04/04: Morrowind: if building an expanded version, edit Morrowind.ini in-place

Simon McVittie smcv at debian.org
Wed Jan 20 00:43:38 UTC 2016


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

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

commit 71c184feecde16ef1700d65242ac5dada4949b97
Author: Simon McVittie <smcv at debian.org>
Date:   Tue Jan 19 23:48:03 2016 +0000

    Morrowind: if building an expanded version, edit Morrowind.ini in-place
    
    Keep a copy, Morrowind.ini.orig, so we have a base for future edits.
---
 game_data_packager/games/morrowind.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/game_data_packager/games/morrowind.py b/game_data_packager/games/morrowind.py
index f2e1ebc..af47e8a 100644
--- a/game_data_packager/games/morrowind.py
+++ b/game_data_packager/games/morrowind.py
@@ -41,6 +41,21 @@ class MorrowindTask(PackagingTask):
         os.symlink(datadir, subdir_expected_by_iniimporter)
 
         ini = os.path.join(datadir, 'Morrowind.ini')
+
+        initext = open(ini + '.orig', encoding='latin-1').read()
+
+        if package.name.startswith( # either of:
+                ('morrowind-tribunal', 'morrowind-complete')):
+            initext = initext + '\r\nGameFile1=Tribunal.esm\r\n'
+
+        if package.name.startswith('morrowind-bloodmoon'):
+            initext = initext + '\r\nGameFile1=Bloodmoon.esm\r\n'
+
+        if package.name.startswith('morrowind-complete'):
+            initext = initext + '\r\nGameFile2=Bloodmoon.esm\r\n'
+
+        open(ini, 'w', encoding='latin-1').write(initext)
+
         cfg = os.path.join(datadir, 'openmw.cfg')
 
         check_call(['openmw-iniimporter',

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