From 0e457a7739be363646336086dbf7b78382e8b6dd Mon Sep 17 00:00:00 2001 From: Matthias Paulmier Date: Fri, 22 Jun 2018 15:42:17 +0200 Subject: lib: Harmonize Exporter package usage Now the modules don't inherit Exporter anymore. We just get the import method from it since it is the only method that interests us. --- lib/Automake/ChannelDefs.pm | 5 ++--- lib/Automake/Channels.pm | 5 ++--- lib/Automake/CondStack.pm | 5 ++--- lib/Automake/Condition.pm | 7 ++++--- lib/Automake/ConfVars.pm | 5 ++--- lib/Automake/Config.in | 3 +-- lib/Automake/Configure_ac.pm | 5 ++--- lib/Automake/Errors.pm | 6 ++---- lib/Automake/File.pm | 5 ++--- lib/Automake/FileUtils.pm | 5 ++--- lib/Automake/General.pm | 5 ++--- lib/Automake/Getopt.pm | 8 ++++---- lib/Automake/Global.pm | 6 ++---- lib/Automake/LangHandling.pm | 6 ++---- lib/Automake/Location.pm | 6 ++---- lib/Automake/Options.pm | 5 ++--- lib/Automake/Requires.pm | 6 ++---- lib/Automake/Rule.pm | 20 ++++++++++---------- lib/Automake/RuleDef.pm | 6 +++--- lib/Automake/SilentRules.pm | 9 +++------ lib/Automake/Utils.pm | 6 ++---- lib/Automake/VarAppend.pm | 6 +++--- lib/Automake/VarDef.pm | 10 +++++----- lib/Automake/Variable.pm | 4 ++-- lib/Automake/Wrap.pm | 5 ++--- lib/Automake/XFile.pm | 4 ++-- 26 files changed, 69 insertions(+), 94 deletions(-) diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm index e4f7f4a20..c757f17a9 100644 --- a/lib/Automake/ChannelDefs.pm +++ b/lib/Automake/ChannelDefs.pm @@ -57,11 +57,10 @@ shorthand function to output on specific channels. use 5.006; use strict; -use Exporter; +use Exporter 'import'; -use vars qw (@ISA @EXPORT); +use vars qw (@EXPORT); -@ISA = qw (Exporter); @EXPORT = qw (&prog_error &error &fatal &verb &switch_warning &parse_WARNINGS &parse_warnings); diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm index 9d17fe5c7..c07a8f424 100644 --- a/lib/Automake/Channels.pm +++ b/lib/Automake/Channels.pm @@ -70,12 +70,11 @@ use 5.006; use strict; use Carp; -use Exporter; +use Exporter 'import'; use File::Basename; -use vars qw (@ISA @EXPORT %channels $me); +use vars qw (@EXPORT %channels $me); -@ISA = qw (Exporter); @EXPORT = qw ($exit_code $warnings_are_errors &reset_local_duplicates &reset_global_duplicates ®ister_channel &msg &exists_channel &channel_type diff --git a/lib/Automake/CondStack.pm b/lib/Automake/CondStack.pm index 361738191..1040f474d 100644 --- a/lib/Automake/CondStack.pm +++ b/lib/Automake/CondStack.pm @@ -22,11 +22,10 @@ use Automake::ChannelDefs; use Automake::Condition qw (TRUE FALSE); use Automake::Channels; use Automake::Global; -use Exporter; +use Exporter 'import'; -use vars qw (@ISA @EXPORT); +use vars qw (@EXPORT); -@ISA = qw (Exporter); @EXPORT = qw (@cond_stack &cond_stack_if &cond_stack_else &cond_stack_endif); diff --git a/lib/Automake/Condition.pm b/lib/Automake/Condition.pm index c028c24fe..ab88790e4 100644 --- a/lib/Automake/Condition.pm +++ b/lib/Automake/Condition.pm @@ -19,9 +19,10 @@ use 5.006; use strict; use Carp; -require Exporter; -use vars '@ISA', '@EXPORT_OK'; -@ISA = qw/Exporter/; +use Exporter 'import'; + +use vars qw (@EXPORT_OK); + @EXPORT_OK = qw/TRUE FALSE reduce_and reduce_or/; =head1 NAME diff --git a/lib/Automake/ConfVars.pm b/lib/Automake/ConfVars.pm index 006147e24..4a27184dd 100644 --- a/lib/Automake/ConfVars.pm +++ b/lib/Automake/ConfVars.pm @@ -28,11 +28,10 @@ use Automake::Location; use Automake::Utils; use Automake::VarDef; use Automake::Variable; -use Exporter; +use Exporter 'import'; -use vars qw (@ISA @EXPORT); +use vars qw (@EXPORT); -@ISA = qw (Exporter); @EXPORT = qw (%configure_vars %ignored_configure_vars $output_vars &define_standard_variables); diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in index 777fe3722..b006c8a75 100644 --- a/lib/Automake/Config.in +++ b/lib/Automake/Config.in @@ -20,9 +20,8 @@ package Automake::Config; use strict; use 5.006; -require Exporter; +use Exporter 'import'; -our @ISA = qw (Exporter); our @EXPORT = qw ($APIVERSION $PACKAGE $PACKAGE_BUGREPORT $VERSION $RELEASE_YEAR $libdir $perl_threads); diff --git a/lib/Automake/Configure_ac.pm b/lib/Automake/Configure_ac.pm index 18bfa5e03..97bc08117 100644 --- a/lib/Automake/Configure_ac.pm +++ b/lib/Automake/Configure_ac.pm @@ -25,11 +25,10 @@ use strict; use Automake::Channels; use Automake::ChannelDefs; -use Exporter; +use Exporter 'import'; -use vars qw (@ISA @EXPORT); +use vars qw (@EXPORT); -@ISA = qw (Exporter); @EXPORT = qw (&find_configure_ac &require_configure_ac); =head1 NAME diff --git a/lib/Automake/Errors.pm b/lib/Automake/Errors.pm index 96ddae21c..4bce87bf1 100644 --- a/lib/Automake/Errors.pm +++ b/lib/Automake/Errors.pm @@ -20,11 +20,9 @@ use 5.006; use Automake::Channels; use Automake::Global; -use Exporter; +use Exporter 'import'; -use vars '@ISA', '@EXPORT'; - -@ISA = qw (Exporter); +use vars qw (@EXPORT); @EXPORT = qw (err_am err_ac); diff --git a/lib/Automake/File.pm b/lib/Automake/File.pm index 89cc4776e..a9ba70b21 100644 --- a/lib/Automake/File.pm +++ b/lib/Automake/File.pm @@ -30,11 +30,10 @@ use Automake::RuleDef; use Automake::Utils; use Automake::VarDef; use Automake::Variable; -use Exporter; +use Exporter 'import'; -use vars qw (@ISA @EXPORT); +use vars qw (@EXPORT); -@ISA = qw (Exporter); @EXPORT = qw (file_contents_internal file_contents); # ($COMMENT, $VARIABLES, $RULES) diff --git a/lib/Automake/FileUtils.pm b/lib/Automake/FileUtils.pm index 43b66966a..a6839ff55 100644 --- a/lib/Automake/FileUtils.pm +++ b/lib/Automake/FileUtils.pm @@ -39,13 +39,12 @@ use strict; use Automake::Channels; use Automake::ChannelDefs; -use Exporter; +use Exporter 'import'; use File::stat; use IO::File; -use vars qw (@ISA @EXPORT); +use vars qw (@EXPORT); -@ISA = qw (Exporter); @EXPORT = qw (&contents &find_file &mtime &update_file &up_to_date_p diff --git a/lib/Automake/General.pm b/lib/Automake/General.pm index f9ec8c67f..3a3eda255 100644 --- a/lib/Automake/General.pm +++ b/lib/Automake/General.pm @@ -18,12 +18,11 @@ package Automake::General; use 5.006; use strict; -use Exporter; +use Exporter 'import'; use File::Basename; -use vars qw (@ISA @EXPORT); +use vars qw (@EXPORT); -@ISA = qw (Exporter); @EXPORT = qw (&uniq &none $me); # Variable we share with the main package. Be sure to have a single diff --git a/lib/Automake/Getopt.pm b/lib/Automake/Getopt.pm index c6614f2cc..b75981bda 100644 --- a/lib/Automake/Getopt.pm +++ b/lib/Automake/Getopt.pm @@ -36,12 +36,12 @@ use warnings FATAL => 'all'; use Carp qw/croak confess/; use Automake::ChannelDefs qw/fatal/; -use Exporter (); +use Exporter 'import'; use Getopt::Long (); -use vars qw (@ISA @EXPORT); -@ISA = qw (Exporter); -@EXPORT= qw/getopt/; +use vars qw (@EXPORT); + +@EXPORT= qw (getopt); =item C diff --git a/lib/Automake/Global.pm b/lib/Automake/Global.pm index 25a703608..f382aa35a 100644 --- a/lib/Automake/Global.pm +++ b/lib/Automake/Global.pm @@ -18,11 +18,9 @@ package Automake::Global; use 5.006; use strict; -use Exporter; +use Exporter 'import'; -use vars qw (@ISA @EXPORT); - -@ISA = qw (Exporter); +use vars qw (@EXPORT); @EXPORT = qw ($IGNORE_PATTERN $WHITE_PATTERN $COMMENT_PATTERN $RULE_PATTERN $ASSIGNMENT_PATTERN $GNITS_VERSION_PATTERN $IF_PATTERN $ELSE_PATTERN diff --git a/lib/Automake/LangHandling.pm b/lib/Automake/LangHandling.pm index bfbbb003c..8d1a8bad7 100644 --- a/lib/Automake/LangHandling.pm +++ b/lib/Automake/LangHandling.pm @@ -28,12 +28,10 @@ use Automake::Utils; use Automake::Variable; use Automake::VarDef; use Automake::Wrap qw (makefile_wrap); -use Exporter; +use Exporter 'import'; use File::Basename; -use vars '@ISA', '@EXPORT'; - -@ISA = qw (Exporter); +use vars qw (@EXPORT); @EXPORT = qw (check_user_variables lang_sub_obj lang_header_rewrite lang_vala_rewrite lang_yacc_rewrite lang_yaccxx_rewrite diff --git a/lib/Automake/Location.pm b/lib/Automake/Location.pm index 3d368ca9e..93274a534 100644 --- a/lib/Automake/Location.pm +++ b/lib/Automake/Location.pm @@ -17,11 +17,9 @@ package Automake::Location; use 5.006; -use Exporter; +use Exporter 'import'; -use vars qw (@ISA @EXPORT); - -@ISA = qw (Exporter); +use vars qw (@EXPORT); @EXPORT = qw (INTERNAL); diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm index ce123d629..210902959 100644 --- a/lib/Automake/Options.pm +++ b/lib/Automake/Options.pm @@ -22,11 +22,10 @@ use Automake::ChannelDefs; use Automake::Channels; use Automake::Config; use Automake::Version; -use Exporter; +use Exporter 'import'; -use vars qw (@ISA @EXPORT); +use vars qw (@EXPORT); -@ISA = qw (Exporter); @EXPORT = qw (option global_option set_option set_global_option unset_option unset_global_option diff --git a/lib/Automake/Requires.pm b/lib/Automake/Requires.pm index 8c88f2885..75c840d9a 100644 --- a/lib/Automake/Requires.pm +++ b/lib/Automake/Requires.pm @@ -28,11 +28,9 @@ use Automake::Utils; use Automake::Variable; use File::Basename; -use Exporter; +use Exporter 'import'; -use vars '@ISA', '@EXPORT'; - -@ISA = qw (Exporter); +use vars qw (@EXPORT); @EXPORT = qw (require_file require_file_with_macro require_libsource_with_macro require_queued_file_check_or_copy diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm index 7245bf2f1..411a415ce 100644 --- a/lib/Automake/Rule.pm +++ b/lib/Automake/Rule.pm @@ -26,16 +26,16 @@ use Automake::DisjConditions; use Automake::Item; use Automake::Options; use Automake::RuleDef; -require Exporter; - -use vars '@ISA', '@EXPORT'; -@ISA = qw/Automake::Item Exporter/; -@EXPORT = qw (reset register_suffix_rule next_in_suffix_chain - suffixes rules $KNOWN_EXTENSIONS_PATTERN - depend %dependencies %actions register_action - accept_extensions - reject_rule msg_rule msg_cond_rule err_rule err_cond_rule - rule rrule ruledef rruledef); +use Exporter 'import'; + +use vars qw (@ISA @EXPORT); + +@ISA = qw (Automake::Item); + +@EXPORT = qw (reset register_suffix_rule next_in_suffix_chain suffixes rules + $KNOWN_EXTENSIONS_PATTERN depend %dependencies %actions register_action + accept_extensions reject_rule msg_rule msg_cond_rule err_rule + err_cond_rule rule rrule ruledef rruledef); =head1 NAME diff --git a/lib/Automake/RuleDef.pm b/lib/Automake/RuleDef.pm index 928db9691..ba3874a17 100644 --- a/lib/Automake/RuleDef.pm +++ b/lib/Automake/RuleDef.pm @@ -21,11 +21,11 @@ use Carp; use Automake::ChannelDefs; use Automake::ItemDef; -require Exporter; +use Exporter 'import'; -use vars '@ISA', '@EXPORT'; +use vars qw (@ISA @EXPORT); -@ISA = qw/Automake::ItemDef Exporter/; +@ISA = qw (Automake::ItemDef); @EXPORT = qw (&RULE_AUTOMAKE &RULE_USER); =head1 NAME diff --git a/lib/Automake/SilentRules.pm b/lib/Automake/SilentRules.pm index ee4e94509..c57ddb599 100644 --- a/lib/Automake/SilentRules.pm +++ b/lib/Automake/SilentRules.pm @@ -17,15 +17,12 @@ package Automake::SilentRules; use Automake::Utils; use Automake::Variable; -use Exporter; +use Exporter 'import'; -use vars '@ISA', '@EXPORT'; - -@ISA = qw (Exporter); +use vars qw (@EXPORT); @EXPORT = qw (verbose_flag verbose_nodep_flag silent_flag - define_verbose_texinfo define_verbose_libtool - handle_silent); + define_verbose_texinfo define_verbose_libtool handle_silent); # Silent rules handling functions. diff --git a/lib/Automake/Utils.pm b/lib/Automake/Utils.pm index 61ff25563..08e91e5f5 100644 --- a/lib/Automake/Utils.pm +++ b/lib/Automake/Utils.pm @@ -25,12 +25,10 @@ use Automake::XFile; use Automake::ChannelDefs; use Automake::Variable 'var'; use Automake::Rule; -use Exporter; +use Exporter 'import'; use File::Basename; -use vars qw (@ISA @EXPORT); - -@ISA = qw (Exporter); +use vars qw (@EXPORT); @EXPORT = qw ($config_aux_dir $am_config_aux_dir $config_aux_dir_set_in_configure_ac $seen_maint_mode $relative_dir diff --git a/lib/Automake/VarAppend.pm b/lib/Automake/VarAppend.pm index 6c7b6e681..80044af5b 100644 --- a/lib/Automake/VarAppend.pm +++ b/lib/Automake/VarAppend.pm @@ -22,11 +22,11 @@ use Automake::Channels; use Automake::Condition qw (TRUE FALSE); use Automake::Item; use Automake::VarDef; -use Exporter; +use Exporter 'import'; -use vars '@ISA', '@EXPORT'; +use vars qw (@ISA @EXPORT); -@ISA = qw (Automake::Item Exporter); +@ISA = qw (Automake::Item); @EXPORT = qw (append_var_cur_cond first_assign_var am_check_definitions); diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm index d978b3189..dea315029 100644 --- a/lib/Automake/VarDef.pm +++ b/lib/Automake/VarDef.pm @@ -21,13 +21,13 @@ use Carp; use Automake::ChannelDefs; use Automake::ItemDef; -require Exporter; +use Exporter 'import'; -use vars '@ISA', '@EXPORT'; +use vars qw (@ISA @EXPORT); -@ISA = qw/Automake::ItemDef Exporter/; -@EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE - &VAR_ASIS &VAR_PRETTY &VAR_SILENT &VAR_SORTED); +@ISA = qw (Automake::ItemDef); +@EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE &VAR_ASIS &VAR_PRETTY + &VAR_SILENT &VAR_SORTED); =head1 NAME diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 7dc485dde..a37091fdd 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -33,11 +33,11 @@ use Automake::Location; use Automake::VarAppend; use Automake::VarDef; use Automake::Wrap 'makefile_wrap'; -require Exporter; +use Exporter 'import'; use vars '@ISA', '@EXPORT', '@EXPORT_OK'; -@ISA = qw/Automake::Item Exporter/; +@ISA = qw (Automake::Item); @EXPORT = qw (err_var msg_var msg_cond_var reject_var var rvar vardef rvardef variables diff --git a/lib/Automake/Wrap.pm b/lib/Automake/Wrap.pm index 34570ada2..62a767744 100644 --- a/lib/Automake/Wrap.pm +++ b/lib/Automake/Wrap.pm @@ -18,11 +18,10 @@ package Automake::Wrap; use 5.006; use strict; -require Exporter; +use Exporter 'import'; -use vars '@ISA', '@EXPORT_OK'; +use vars qw (@EXPORT_OK); -@ISA = qw/Exporter/; @EXPORT_OK = qw/wrap makefile_wrap/; =head1 NAME diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm index 259235f5f..bf40a812d 100644 --- a/lib/Automake/XFile.pm +++ b/lib/Automake/XFile.pm @@ -78,13 +78,13 @@ use Automake::ChannelDefs; use Automake::Channels qw(msg); use Automake::FileUtils; require DynaLoader; -require Exporter; +use Exporter 'import'; use File::Basename; use IO::File; use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA); -@ISA = qw(IO::File Exporter DynaLoader); +@ISA = qw(IO::File DynaLoader); $VERSION = "1.2"; -- cgit v1.2.1