Patch for suppressing demo creation when full version is available

Patrick Bottelberger patrick.bottelberger at sigon.net
Sun Jul 12 11:42:46 UTC 2015


Hi Alexandre,

the version i sent may be useful for more complicated scenarios, but 
ultimately it's your decision, which version to use.


Bye
Patrick

Am 12.07.2015 um 12:03 schrieb Alexandre Detiste:
> 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




More information about the Pkg-games-devel mailing list