From 567bbf7b7b14b31385801b1fee47acfc5b6d2b01 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 13 Nov 2016 04:12:26 +0100 Subject: [PATCH] gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license. * gnulib-tool (--lgpl): Accept value 3orGPLv2. (func_import): Extend determination of license_incompatibilities. (func_create_testdir): Extend table of license compatibility. Handle also the licenses GPLv3+, GPL, LGPLv3+. --- ChangeLog | 8 ++++++++ gnulib-tool | 33 ++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a61a471e0..3fb31d4536 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2016-11-11 Bruno Haible + + gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license. + * gnulib-tool (--lgpl): Accept value 3orGPLv2. + (func_import): Extend determination of license_incompatibilities. + (func_create_testdir): Extend table of license compatibility. Handle + also the licenses GPLv3+, GPL, LGPLv3+. + 2016-11-12 Paul Eggert strftime: tune %q diff --git a/gnulib-tool b/gnulib-tool index 666057aead..5145d47bdf 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -264,7 +264,8 @@ Options for --import, --add/remove-import: placed (default \"tests\"). --aux-dir=DIRECTORY Directory relative to --dir where auxiliary build tools are placed (default comes from configure.ac). - --lgpl[=2|=3] Abort if modules aren't available under the LGPL. + --lgpl[=2|=3orGPLv2|=3] + Abort if modules aren't available under the LGPL. Also modify license template from GPL to LGPL. The version number of the LGPL can be specified; the default is currently LGPLv3. @@ -1299,7 +1300,7 @@ func_determine_path_separator --lgpl=* ) arg=`echo "X$1" | sed -e 's/^X--lgpl=//'` case "$arg" in - 2 | 3) ;; + 2 | 3orGPLv2 | 3) ;; *) func_fatal_error "invalid LGPL version number for --lgpl" ;; esac lgpl=$arg @@ -4707,7 +4708,13 @@ func_import () case "$lgpl" in yes | 3) case $license in - LGPL | LGPLv2+ | LGPLv3+) ;; + LGPLv2+ | 'LGPLv3+ or GPLv2' | LGPLv3+ | LGPL) ;; + *) func_append license_incompatibilities "$module $license$nl" ;; + esac + ;; + 3orGPLv2) + case $license in + LGPLv2+ | 'LGPLv3+ or GPLv2') ;; *) func_append license_incompatibilities "$module $license$nl" ;; esac ;; @@ -4751,7 +4758,7 @@ s,^\(.................................................[^ ]*\) *, if test -n "$lgpl"; then # Update license. case "$lgpl" in - yes | 3) + yes | 3 | 3orGPLv2) sed_transform_main_lib_file=$sed_transform_main_lib_file' s/GNU General/GNU Lesser General/g s/General Public License/Lesser General Public License/g @@ -5851,15 +5858,27 @@ func_create_testdir () 'public domain' | 'unlimited' | 'unmodifiable license text') ;; *) case "$requested_license" in + GPLv3+ | GPL) + case "$license" in + LGPLv2+ | 'LGPLv3+ or GPLv2' | LGPLv3+ | LGPL | GPLv2+ | GPLv3+ | GPL) ;; + *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; + esac + ;; GPLv2+) case "$license" in - GPLv2+ | LGPLv2+) ;; + LGPLv2+ | 'LGPLv3+ or GPLv2' | GPLv2+) ;; + *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; + esac + ;; + LGPLv3+ | LGPL) + case "$license" in + LGPLv2+ | 'LGPLv3+ or GPLv2' | LGPLv3+ | LGPL) ;; *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; esac ;; - LGPL) + 'LGPLv3+ or GPLv2') case "$license" in - LGPL | LGPLv2+) ;; + LGPLv2+ | 'LGPLv3+ or GPLv2') ;; *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; esac ;; -- 2.39.5