Patch for suppressing demo creation when full version is available
Alexandre Detiste
alexandre.detiste at gmail.com
Sun Jul 12 10:03:27 UTC 2015
>> Patrick Bottelberger <patrick.bottelberger at sigon.net>
> Hi all,
>
> i've made a small patch for G-D-P to suppress the creation of
> demo-packages, when full versions of non-english versions are to be
> created. For example, when creating grimfandango-de-data without
> explicitly specifying the package (via "game-data-packager grim
> /some/path/with/de/data"), grimfandango-demo-data would also be created,
> as it's demo-for grimfandango-en-data. So, my patch suppresses this, as
> it looks through all languages to get the information, that the creation
> of the demo is not needed. Would you please have a look at the patch,
> maybe try it with other languages and then apply it?
> Thank you!
>
>
> Bye
> Patrick
Hi,
I had the same problem with Gobliiins;
here is a simpler (bare bone) patch.
This now only check if "demo_for:" is present, but not it's content.
Value of demo_for would remain usefull for a GUI
& for integrity checks inside .yaml files.
(and make mandatory to first package the full game before the demo :-) )
If any full game is available (in a suitable $LANGUAGE) no demo is built.
This can allways be overriden with --demo arg.
I would bump this from logger.debug to logger.info level too.
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -2645,14 +2645,15 @@ class GameData(object):
'"%s" is neither available nor already installed.',
package.name, package.expansion_for)
- if not build_demos:
- for demo_for in package.demo_for:
- if self.packages[demo_for] in possible:
- # no point in packaging the demo if we have the full
+ if not build_demos and package.demo_for:
+ for p in possible:
+ if not p.demo_for:
+ # no point in packaging a demo if we have any full
# version
- logger.debug('will not produce "%s" because we have '
- 'the full version "%s"', package.name, demo_for)
+ logger.info('will not produce "%s" because we have '
+ 'the full version "%s"', package.name, p.name)
abort = True
+ break
if abort:
continue
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo.patch
Type: text/x-patch
Size: 3036 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20150712/cbbb7787/attachment.bin>
More information about the Pkg-games-devel
mailing list