>From 65349591fb099e8076f477d16704b05ef8233e1c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 3 Aug 2022 14:51:20 +0200 Subject: [PATCH 06/12] gnulib-tool.py: Follow gnulib-tool changes, part 22. Follow gnulib-tool change 2016-10-15 Bruno Haible Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'. * pygnulib/GLModuleSystem.py (GLModule.getLicense): Special-case the 'parse-datetime' module. --- ChangeLog | 7 +++++++ gnulib-tool.py.TODO | 11 ----------- pygnulib/GLModuleSystem.py | 24 +++++++++++++++--------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2f3e0f127..2f88a72f90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2022-08-03 Bruno Haible + gnulib-tool.py: Follow gnulib-tool changes, part 22. + Follow gnulib-tool change + 2016-10-15 Bruno Haible + Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'. + * pygnulib/GLModuleSystem.py (GLModule.getLicense): Special-case the + 'parse-datetime' module. + gnulib-tool.py: Follow gnulib-tool changes, part 21. Follow gnulib-tool change 2016-10-16 Bruno Haible diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO index b71b7200ab..d5030c8231 100644 --- a/gnulib-tool.py.TODO +++ b/gnulib-tool.py.TODO @@ -1056,17 +1056,6 @@ Date: Sun Nov 13 04:12:26 2016 +0100 -------------------------------------------------------------------------------- -commit ff9debcf75301805b1db925cdcdfb248541c576d -Author: Bruno Haible -Date: Sat Oct 15 15:51:20 2016 +0200 - - Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'. - - * gnulib-tool (func_get_license): Special-case the 'parse-datetime' - module. - --------------------------------------------------------------------------------- - commit 9bdf6c8a0cdeb13c12e4b65dee9538c5468dbe1d Author: Bruno Haible Date: Sun Aug 19 14:06:50 2012 +0200 diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 319175dee8..25c34f8756 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -796,16 +796,22 @@ Include:|Link:|License:|Maintainer:)' '''GLModule.getLicense(self) -> str Get license and warn user if module lacks a license.''' - license = self.getLicense_Raw() - if not self.isTests(): + if str(self) == 'parse-datetime': + # This module is under a weaker license only for the purpose of some + # users who hand-edit it and don't use gnulib-tool. For the regular + # gnulib users they are under a stricter license. + return 'GPL' + else: + license = self.getLicense_Raw() + if not self.isTests(): + if not license: + if self.config['errors']: + raise GLError(18, str(self)) + else: # if not self.config['errors'] + sys.stderr.write('gnulib-tool: warning: module %s lacks a license\n' % str(self)) if not license: - if self.config['errors']: - raise GLError(18, str(self)) - else: # if not self.config['errors'] - sys.stderr.write('gnulib-tool: warning: module %s lacks a license\n' % str(self)) - if not license: - license = 'GPL' - return license + license = 'GPL' + return license def getLicense_Raw(self): '''GLModule.getLicense_Raw() -> str -- 2.34.1