[game-data-packager] 08/09: Add support for replacing a package's long description entirely

Simon McVittie smcv at debian.org
Mon Jan 4 09:04:50 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 84f906d6053f757f91baeb462362692eb8578c70
Author: Simon McVittie <smcv at debian.org>
Date:   Mon Jan 4 08:06:54 2016 +0000

    Add support for replacing a package's long description entirely
---
 data/wip/unreal.yaml           | 4 ++--
 game_data_packager/__init__.py | 6 +++++-
 game_data_packager/build.py    | 6 ++++++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/data/wip/unreal.yaml b/data/wip/unreal.yaml
index 0af4f27..ef3c916 100644
--- a/data/wip/unreal.yaml
+++ b/data/wip/unreal.yaml
@@ -32,9 +32,9 @@ packages:
 
   unreal-launcher-dependencies:
     short_description: dependencies for Unreal launcher
-    description: |
+    long_description: |
       game-data-packager provides a Gtk launcher for Unreal and Unreal Gold.
-      This package depends on that launcher and its runtime dependencies.
+      This empty package depends on that launcher and its runtime dependencies.
       It is a separate package so that the launcher can be installed for
       the native CPU architecture.
     depends:
diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index b543860..94d780a 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -212,6 +212,9 @@ class GameDataPackage(object):
         # 'data' / 'PWAD' / 'IWAD' / 'binaries'
         self.data_type = 'data'
 
+        # if not None, override the description completely
+        self.long_description = None
+
         # extra blurb of text added to .deb long description
         self.description = None
 
@@ -410,6 +413,7 @@ class GameDataPackage(object):
                 'expansion_for',
                 'expansion_for_ext',
                 'longname',
+                'long_description',
                 'short_description',
                 'url_misc',
                 'wiki',
@@ -790,7 +794,7 @@ class GameData(object):
                 'rip_cd', 'architecture', 'aliases', 'better_version', 'langs', 'mutually_exclusive',
                 'copyright', 'engine', 'lang', 'component', 'section', 'disks', 'provides',
                 'steam', 'gog', 'dotemu', 'origin', 'url_misc', 'wiki', 'copyright_notice',
-                'short_description', 'empty'):
+                'short_description', 'long_description', 'empty'):
             if k in d:
                 setattr(package, k, d[k])
 
diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index 067511c..0cca26b 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -1752,6 +1752,12 @@ class PackagingTask(object):
             long_desc += ' It contains free game data and may be redistributed.\n'
             long_desc += ' .\n'
 
+        if package.long_description is not None:
+            long_desc = package.long_description
+            long_desc = long_desc.rstrip('\n')
+            long_desc = ' ' + long_desc.replace('\n', '\n ')
+            return (short_desc, long_desc)
+
         if package.description:
             for line in package.description.splitlines():
                 line = line.rstrip() or '.'

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