[game-data-packager] 16/20: Use a suitable .desktop file for hexdd.wad
Simon McVittie
smcv at debian.org
Mon Jan 12 01:07:09 UTC 2015
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 6005cfb9b911557b34bc6361ceaac7f940d51fac
Author: Simon McVittie <smcv at debian.org>
Date: Mon Jan 12 00:23:29 2015 +0000
Use a suitable .desktop file for hexdd.wad
---
data/hexen-deathkings-data.desktop.in | 9 +++++++++
data/hexen.yaml | 1 +
lib/game_data_packager/games/doom_common.py | 19 ++++++++++++-------
3 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/data/hexen-deathkings-data.desktop.in b/data/hexen-deathkings-data.desktop.in
new file mode 100644
index 0000000..8af839d
--- /dev/null
+++ b/data/hexen-deathkings-data.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Hexen: Deathkings of the Dark Citadel
+GenericName=First Person Shooter Game
+TryExec=ENGINE
+Exec=ENGINE -iwad /usr/share/games/ENGINE/hexen.wad -file /usr/share/games/ENGINE/GAME.wad
+Icon=GAME.xpm
+Terminal=false
+Type=Application
+Categories=Game
diff --git a/data/hexen.yaml b/data/hexen.yaml
index 3970dae..92f0db7 100644
--- a/data/hexen.yaml
+++ b/data/hexen.yaml
@@ -71,6 +71,7 @@ files:
look_for: [hexen.wad]
hexdd.wad_1.1:
+ distinctive_name: false
size: 4440584
look_for: [hexdd.wad]
diff --git a/lib/game_data_packager/games/doom_common.py b/lib/game_data_packager/games/doom_common.py
index 4b46e2b..7d54f13 100644
--- a/lib/game_data_packager/games/doom_common.py
+++ b/lib/game_data_packager/games/doom_common.py
@@ -113,13 +113,18 @@ class DoomGameData(GameData):
appdir = os.path.join(destdir, 'usr/share/applications')
mkdir_p(appdir)
- subst(
- open(os.path.join(DATADIR, 'doom-common.desktop.in')),
- open(os.path.join(appdir, '%s.desktop' % package.name),
- 'w'),
- GAME=wad_base,
- LONG=(package.longname or self.longname),
- ENGINE=self.engine)
+ for basename in (package.name, 'doom-common'):
+ from_ = os.path.join(DATADIR, basename + '.desktop.in')
+ if os.path.exists(from_):
+ subst(open(from_),
+ open(os.path.join(appdir, '%s.desktop' % package.name),
+ 'w'),
+ GAME=wad_base,
+ LONG=(package.longname or self.longname),
+ ENGINE=self.engine)
+ break
+ else:
+ raise AssertionError('doom-common.desktop.in should have existed')
debdir = os.path.join(destdir, 'DEBIAN')
mkdir_p(debdir)
--
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