diff options
author | Guillem Jover <guillem@debian.org> | 2015-02-15 23:18:31 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2015-03-30 20:22:38 +0200 |
commit | 01abe8afb95f4bafb1f192fb3fe451a95cd2e3f8 (patch) | |
tree | 2384393b6e59f3b852a9ec70a4733e5f4310847a | |
parent | 046ad868331a9f1581837404449b4320e6d09c36 (diff) | |
download | dpkg-01abe8afb95f4bafb1f192fb3fe451a95cd2e3f8.tar.gz |
perl: Rework use and exporter declarations
Place 'use' strict and warnings first, then Exporter 'our' declarations,
then Test module imports, then system module imports, then Dpkg module
imports, then 'use' parent and overload pragmas, separated by a blank
line for each block.
Split each exported symbol declaration into its own line to ease
modifications.
54 files changed, 358 insertions, 192 deletions
diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm index 3a47129fb..a190520e2 100644 --- a/dselect/methods/Dselect/Ftp.pm +++ b/dselect/methods/Dselect/Ftp.pm @@ -16,16 +16,25 @@ use strict; use warnings; our $VERSION = '0.02'; +our @EXPORT = qw( + %CONFIG + yesno + nb + do_connect + do_mdtm + view_mirrors + add_site + edit_site + edit_config + read_config + store_config +); use Exporter qw(import); - use Carp; use Net::FTP; use Data::Dumper; -our @EXPORT = qw(%CONFIG yesno do_connect do_mdtm add_site edit_site - edit_config read_config store_config view_mirrors nb); - my %CONFIG; sub nb { diff --git a/scripts/Dpkg.pm b/scripts/Dpkg.pm index 4e84dfe5e..2ed60a07c 100644 --- a/scripts/Dpkg.pm +++ b/scripts/Dpkg.pm @@ -30,10 +30,23 @@ use strict; use warnings; our $VERSION = '1.01'; +our @EXPORT_OK = qw( + $PROGNAME + $PROGVERSION + $CONFDIR + $ADMINDIR + $LIBDIR + $DATADIR +); +our @EXPORT = qw( + $version + $progname + $admindir + $dpkglibdir + $pkgdatadir +); use Exporter qw(import); -our @EXPORT_OK = qw($PROGNAME $PROGVERSION $CONFDIR $ADMINDIR $LIBDIR $DATADIR); -our @EXPORT = qw($version $progname $admindir $dpkglibdir $pkgdatadir); =head1 VARIABLES diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm index 9702bd09f..c71c7a69e 100644 --- a/scripts/Dpkg/Arch.pm +++ b/scripts/Dpkg/Arch.pm @@ -19,19 +19,31 @@ use strict; use warnings; our $VERSION = '0.01'; +our @EXPORT_OK = qw( + get_raw_build_arch + get_raw_host_arch + get_build_arch + get_host_arch + get_gcc_host_gnu_type + get_valid_arches + debarch_eq + debarch_is + debarch_is_wildcard + debarch_is_concerned + debarch_to_cpuattrs + debarch_to_gnutriplet + debarch_to_debtriplet + debarch_to_multiarch + debtriplet_to_debarch + debtriplet_to_gnutriplet + gnutriplet_to_debarch + gnutriplet_to_debtriplet + gnutriplet_to_multiarch +); use Exporter qw(import); -our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch - get_build_arch get_host_arch get_gcc_host_gnu_type - get_valid_arches debarch_eq debarch_is debarch_is_wildcard - debarch_is_concerned - debarch_to_cpuattrs - debarch_to_gnutriplet gnutriplet_to_debarch - debtriplet_to_gnutriplet gnutriplet_to_debtriplet - debtriplet_to_debarch debarch_to_debtriplet - gnutriplet_to_multiarch debarch_to_multiarch); - use POSIX qw(:errno_h); + use Dpkg (); use Dpkg::Gettext; use Dpkg::ErrorHandling; diff --git a/scripts/Dpkg/BuildProfiles.pm b/scripts/Dpkg/BuildProfiles.pm index 25dde7177..4d929c2c1 100644 --- a/scripts/Dpkg/BuildProfiles.pm +++ b/scripts/Dpkg/BuildProfiles.pm @@ -19,8 +19,12 @@ use strict; use warnings; our $VERSION = '1.00'; -our @EXPORT_OK = qw(get_build_profiles set_build_profiles parse_build_profiles - evaluate_restriction_formula); +our @EXPORT_OK = qw( + get_build_profiles + set_build_profiles + parse_build_profiles + evaluate_restriction_formula +); use Exporter qw(import); diff --git a/scripts/Dpkg/Changelog/Debian.pm b/scripts/Dpkg/Changelog/Debian.pm index 4058b03d4..c25c69a82 100644 --- a/scripts/Dpkg/Changelog/Debian.pm +++ b/scripts/Dpkg/Changelog/Debian.pm @@ -49,9 +49,10 @@ our $VERSION = '1.00'; use Dpkg::Gettext; use Dpkg::File; use Dpkg::Changelog qw(:util); -use parent qw(Dpkg::Changelog); use Dpkg::Changelog::Entry::Debian qw(match_header match_trailer); +use parent qw(Dpkg::Changelog); + use constant { FIRST_HEADING => g_('first heading'), NEXT_OR_EOF => g_('next heading or eof'), diff --git a/scripts/Dpkg/Changelog/Entry/Debian.pm b/scripts/Dpkg/Changelog/Entry/Debian.pm index 01b0ae472..bae0fbe57 100644 --- a/scripts/Dpkg/Changelog/Entry/Debian.pm +++ b/scripts/Dpkg/Changelog/Entry/Debian.pm @@ -20,20 +20,25 @@ use strict; use warnings; our $VERSION = '1.01'; +our @EXPORT_OK = qw( + $regex_header + $regex_trailer + match_header + match_trailer + find_closes +); use Exporter qw(import); -use Dpkg::Changelog::Entry; -use parent qw(Dpkg::Changelog::Entry); -our @EXPORT_OK = qw(match_header match_trailer find_closes - $regex_header $regex_trailer); - use Date::Parse; use Dpkg::Gettext; use Dpkg::Control::Fields; use Dpkg::Control::Changelog; +use Dpkg::Changelog::Entry; use Dpkg::Version; +use parent qw(Dpkg::Changelog::Entry); + =encoding utf8 =head1 NAME diff --git a/scripts/Dpkg/Changelog/Parse.pm b/scripts/Dpkg/Changelog/Parse.pm index e9595b01c..f79bb6eab 100644 --- a/scripts/Dpkg/Changelog/Parse.pm +++ b/scripts/Dpkg/Changelog/Parse.pm @@ -35,15 +35,17 @@ use strict; use warnings; our $VERSION = '1.00'; +our @EXPORT = qw( + changelog_parse +); + +use Exporter qw(import); use Dpkg (); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control::Changelog; -use Exporter qw(import); -our @EXPORT = qw(changelog_parse); - =over 4 =item my $fields = changelog_parse(%opt) diff --git a/scripts/Dpkg/Checksums.pm b/scripts/Dpkg/Checksums.pm index 55b638527..86f555f2e 100644 --- a/scripts/Dpkg/Checksums.pm +++ b/scripts/Dpkg/Checksums.pm @@ -21,17 +21,19 @@ use strict; use warnings; our $VERSION = '1.02'; +our @EXPORT = qw( + checksums_is_supported + checksums_get_list + checksums_get_property +); +use Exporter qw(import); use Carp; use Digest; use Dpkg::Gettext; use Dpkg::ErrorHandling; -use Exporter qw(import); -our @EXPORT = qw(checksums_get_list checksums_is_supported - checksums_get_property); - =encoding utf8 =head1 NAME diff --git a/scripts/Dpkg/Compression.pm b/scripts/Dpkg/Compression.pm index e4d6d9123..702d12d71 100644 --- a/scripts/Dpkg/Compression.pm +++ b/scripts/Dpkg/Compression.pm @@ -20,20 +20,25 @@ use strict; use warnings; our $VERSION = '1.02'; +our @EXPORT = qw( + $compression_re_file_ext + compression_is_supported + compression_get_list + compression_get_property + compression_guess_from_filename + compression_get_file_extension_regex + compression_get_default + compression_set_default + compression_get_default_level + compression_set_default_level + compression_is_valid_level +); + +use Exporter qw(import); use Dpkg::ErrorHandling; use Dpkg::Gettext; -use Exporter qw(import); -our @EXPORT = qw($compression_re_file_ext compression_get_list - compression_is_supported compression_get_property - compression_guess_from_filename - compression_get_file_extension_regex - compression_get_default compression_set_default - compression_get_default_level - compression_set_default_level - compression_is_valid_level); - =encoding utf8 =head1 NAME diff --git a/scripts/Dpkg/Compression/FileHandle.pm b/scripts/Dpkg/Compression/FileHandle.pm index 4ccd31584..4ddd78403 100644 --- a/scripts/Dpkg/Compression/FileHandle.pm +++ b/scripts/Dpkg/Compression/FileHandle.pm @@ -21,14 +21,14 @@ use warnings; our $VERSION = '1.01'; +use POSIX qw(:signal_h :sys_wait_h); +use Carp; + use Dpkg::Compression; use Dpkg::Compression::Process; use Dpkg::Gettext; use Dpkg::ErrorHandling; -use Carp; -use POSIX qw(:signal_h :sys_wait_h); - use parent qw(FileHandle Tie::Handle); # Useful reference to understand some kludges required to diff --git a/scripts/Dpkg/Control.pm b/scripts/Dpkg/Control.pm index 7b602b4c6..34350f259 100644 --- a/scripts/Dpkg/Control.pm +++ b/scripts/Dpkg/Control.pm @@ -19,6 +19,21 @@ use strict; use warnings; our $VERSION = '1.00'; +our @EXPORT = qw( + CTRL_UNKNOWN + CTRL_INFO_SRC + CTRL_INFO_PKG + CTRL_INDEX_SRC + CTRL_INDEX_PKG + CTRL_PKG_SRC + CTRL_PKG_DEB + CTRL_FILE_CHANGES + CTRL_FILE_VENDOR + CTRL_FILE_STATUS + CTRL_CHANGELOG +); + +use Exporter qw(import); use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -26,14 +41,8 @@ use Dpkg::Control::Types; use Dpkg::Control::Hash; use Dpkg::Control::Fields; -use Exporter qw(import); - use parent qw(Dpkg::Control::Hash); -our @EXPORT = qw(CTRL_UNKNOWN CTRL_INFO_SRC CTRL_INFO_PKG CTRL_INDEX_SRC - CTRL_INDEX_PKG CTRL_PKG_SRC CTRL_PKG_DEB CTRL_FILE_CHANGES - CTRL_FILE_VENDOR CTRL_FILE_STATUS CTRL_CHANGELOG); - =encoding utf8 =head1 NAME diff --git a/scripts/Dpkg/Control/Changelog.pm b/scripts/Dpkg/Control/Changelog.pm index 850bdc72f..379cad091 100644 --- a/scripts/Dpkg/Control/Changelog.pm +++ b/scripts/Dpkg/Control/Changelog.pm @@ -21,6 +21,7 @@ use warnings; our $VERSION = '1.00'; use Dpkg::Control; + use parent qw(Dpkg::Control); =encoding utf8 diff --git a/scripts/Dpkg/Control/Fields.pm b/scripts/Dpkg/Control/Fields.pm index 6f2eee4e3..d3f92725d 100644 --- a/scripts/Dpkg/Control/Fields.pm +++ b/scripts/Dpkg/Control/Fields.pm @@ -19,6 +19,7 @@ use strict; use warnings; our $VERSION = '1.00'; +our @EXPORT = @Dpkg::Control::FieldsCore::EXPORT; use Carp; use Exporter qw(import); @@ -26,8 +27,6 @@ use Exporter qw(import); use Dpkg::Control::FieldsCore; use Dpkg::Vendor qw(run_vendor_hook); -our @EXPORT = @Dpkg::Control::FieldsCore::EXPORT; - # Register vendor specifics fields foreach my $op (run_vendor_hook('register-custom-fields')) { next if not (defined $op and ref $op); # Skip when not implemented by vendor diff --git a/scripts/Dpkg/Control/FieldsCore.pm b/scripts/Dpkg/Control/FieldsCore.pm index bf724be08..1d0e56464 100644 --- a/scripts/Dpkg/Control/FieldsCore.pm +++ b/scripts/Dpkg/Control/FieldsCore.pm @@ -19,22 +19,33 @@ use strict; use warnings; our $VERSION = '1.00'; +our @EXPORT = qw( + field_capitalize + field_is_official + field_is_allowed_in + field_transfer_single + field_transfer_all + field_list_src_dep + field_list_pkg_dep + field_get_dep_type + field_get_sep_type + field_ordered_list + field_register + field_insert_after + field_insert_before + FIELD_SEP_UNKNOWN + FIELD_SEP_SPACE + FIELD_SEP_COMMA + FIELD_SEP_LINE +); use Exporter qw(import); + use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control::Types; use Dpkg::Checksums; -our @EXPORT = qw(field_capitalize field_is_official field_is_allowed_in - field_transfer_single field_transfer_all - field_list_src_dep field_list_pkg_dep field_get_dep_type - field_get_sep_type - field_ordered_list field_register - field_insert_after field_insert_before - FIELD_SEP_UNKNOWN FIELD_SEP_SPACE FIELD_SEP_COMMA - FIELD_SEP_LINE); - use constant { ALL_PKG => CTRL_INFO_PKG | CTRL_INDEX_PKG | CTRL_PKG_DEB | CTRL_FILE_STATUS, ALL_SRC => CTRL_INFO_SRC | CTRL_INDEX_SRC | CTRL_PKG_SRC, diff --git a/scripts/Dpkg/Control/Types.pm b/scripts/Dpkg/Control/Types.pm index bdcdd239a..09e12d155 100644 --- a/scripts/Dpkg/Control/Types.pm +++ b/scripts/Dpkg/Control/Types.pm @@ -17,11 +17,21 @@ use strict; use warnings; our $VERSION = '0.01'; +our @EXPORT = qw( + CTRL_UNKNOWN + CTRL_INFO_SRC + CTRL_INFO_PKG + CTRL_INDEX_SRC + CTRL_INDEX_PKG + CTRL_PKG_SRC + CTRL_PKG_DEB + CTRL_FILE_CHANGES + CTRL_FILE_VENDOR + CTRL_FILE_STATUS + CTRL_CHANGELOG +); use Exporter qw(import); -our @EXPORT = qw(CTRL_UNKNOWN CTRL_INFO_SRC CTRL_INFO_PKG CTRL_INDEX_SRC - CTRL_INDEX_PKG CTRL_PKG_SRC CTRL_PKG_DEB CTRL_FILE_CHANGES - CTRL_FILE_VENDOR CTRL_FILE_STATUS CTRL_CHANGELOG); =encoding utf8 diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index 06ddb0cfd..947cf13c8 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -50,6 +50,15 @@ use strict; use warnings; our $VERSION = '1.05'; +our @EXPORT = qw( + deps_concat + deps_parse + deps_eval_implication + deps_iterate + deps_compare +); + +use Exporter qw(import); use Dpkg::Version; use Dpkg::Arch qw(get_host_arch get_build_arch); @@ -57,10 +66,6 @@ use Dpkg::BuildProfiles qw(get_build_profiles); use Dpkg::ErrorHandling; use Dpkg::Gettext; -use Exporter qw(import); -our @EXPORT = qw(deps_concat deps_parse deps_eval_implication - deps_iterate deps_compare); - =item deps_eval_implication($rel_p, $v_p, $rel_q, $v_q) ($rel_p, $v_p) and ($rel_q, $v_q) express two dependencies as (relation, diff --git a/scripts/Dpkg/Dist/Files.pm b/scripts/Dpkg/Dist/Files.pm index 6d2d83832..c28c4eb0c 100644 --- a/scripts/Dpkg/Dist/Files.pm +++ b/scripts/Dpkg/Dist/Files.pm @@ -20,11 +20,11 @@ use warnings; our $VERSION = '0.01'; -use parent qw(Dpkg::Interface::Storable); - use Dpkg::Gettext; use Dpkg::ErrorHandling; +use parent qw(Dpkg::Interface::Storable); + sub new { my ($this, %opts) = @_; my $class = ref($this) || $this; diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm index a97054b2a..ce01d5ea6 100644 --- a/scripts/Dpkg/ErrorHandling.pm +++ b/scripts/Dpkg/ErrorHandling.pm @@ -17,15 +17,25 @@ use strict; use warnings; our $VERSION = '0.02'; +our @EXPORT_OK = qw( + report +); +our @EXPORT = qw( + report_options + info + warning + error + errormsg + syserr + subprocerr + usageerr +); + +use Exporter qw(import); use Dpkg (); use Dpkg::Gettext; -use Exporter qw(import); -our @EXPORT = qw(report_options info warning error errormsg - syserr subprocerr usageerr); -our @EXPORT_OK = qw(report); - my $quiet_warnings = 0; my $info_fh = \*STDOUT; diff --git a/scripts/Dpkg/Exit.pm b/scripts/Dpkg/Exit.pm index 2c6b06895..d4f901bec 100644 --- a/scripts/Dpkg/Exit.pm +++ b/scripts/Dpkg/Exit.pm @@ -20,11 +20,14 @@ use strict; use warnings; our $VERSION = '1.01'; +our @EXPORT_OK = qw( + push_exit_handler + pop_exit_handler + run_exit_handlers +); use Exporter qw(import); -our @EXPORT_OK = qw(push_exit_handler pop_exit_handler run_exit_handlers); - # XXX: Backwards compatibility, stop exporting on VERSION 2.00. ## no critic (Variables::ProhibitPackageVars) our @handlers = (); diff --git a/scripts/Dpkg/File.pm b/scripts/Dpkg/File.pm index 4eadca99b..c6ae3264c 100644 --- a/scripts/Dpkg/File.pm +++ b/scripts/Dpkg/File.pm @@ -20,14 +20,17 @@ use strict; use warnings; our $VERSION = '0.01'; +our @EXPORT = qw( + file_lock + file_slurp +); +use Exporter qw(import); use Fcntl qw(:flock); + use Dpkg::Gettext; use Dpkg::ErrorHandling; -use Exporter qw(import); -our @EXPORT = qw(file_lock file_slurp); - sub file_lock($$) { my ($fh, $filename) = @_; diff --git a/scripts/Dpkg/Getopt.pm b/scripts/Dpkg/Getopt.pm index 0c337decc..4d677f391 100644 --- a/scripts/Dpkg/Getopt.pm +++ b/scripts/Dpkg/Getopt.pm @@ -19,7 +19,9 @@ use strict; use warnings; our $VERSION = '0.01'; -our @EXPORT = qw(normalize_options); +our @EXPORT = qw( + normalize_options +); use Exporter qw(import); diff --git a/scripts/Dpkg/Gettext.pm b/scripts/Dpkg/Gettext.pm index c5bf331e5..9f9a81d31 100644 --- a/scripts/Dpkg/Gettext.pm +++ b/scripts/Dpkg/Gettext.pm @@ -27,7 +27,13 @@ use strict; use warnings; our $VERSION = '1.01'; -our @EXPORT = qw(g_ P_ textdomain ngettext _g); +our @EXPORT = qw( + textdomain + ngettext + g_ + P_ + _g +); use Exporter qw(import); diff --git a/scripts/Dpkg/IPC.pm b/scripts/Dpkg/IPC.pm index 147083251..818fa7c87 100644 --- a/scripts/Dpkg/IPC.pm +++ b/scripts/Dpkg/IPC.pm @@ -21,13 +21,16 @@ use strict; use warnings; our $VERSION = '1.01'; - -use Dpkg::ErrorHandling; -use Dpkg::Gettext; +our @EXPORT = qw( + spawn + wait_child +); use Carp; use Exporter qw(import); -our @EXPORT = qw(spawn wait_child); + +use Dpkg::ErrorHandling; +use Dpkg::Gettext; =encoding utf8 diff --git a/scripts/Dpkg/Package.pm b/scripts/Dpkg/Package.pm index a276f66ed..e49c01bd3 100644 --- a/scripts/Dpkg/Package.pm +++ b/scripts/Dpkg/Package.pm @@ -20,11 +20,13 @@ use strict; use warnings; our $VERSION = '0.01'; - -use Dpkg::Gettext; +our @EXPORT = qw( + pkg_name_is_illegal +); use Exporter qw(import); -our @EXPORT = qw(pkg_name_is_illegal); + +use Dpkg::Gettext; sub pkg_name_is_illegal($) { my $name = shift // ''; diff --git a/scripts/Dpkg/Path.pm b/scripts/Dpkg/Path.pm index d6dda5787..d97fdec17 100644 --- a/scripts/Dpkg/Path.pm +++ b/scripts/Dpkg/Path.pm @@ -20,6 +20,17 @@ use strict; use warnings; our $VERSION = '1.04'; +our @EXPORT_OK = qw( + canonpath + resolve_symlink + check_files_are_the_same + find_command + find_build_file + get_control_path + get_pkg_root_dir + guess_pkg_root_dir + relative_to_pkg_root +); use Exporter qw(import); use File::Spec; @@ -28,11 +39,6 @@ use Cwd qw(realpath); use Dpkg::Arch qw(get_host_arch debarch_to_debtriplet); use Dpkg::IPC; -our @EXPORT_OK = qw(get_pkg_root_dir relative_to_pkg_root - guess_pkg_root_dir check_files_are_the_same - resolve_symlink canonpath find_command - get_control_path find_build_file); - =encoding utf8 =head1 NAME diff --git a/scripts/Dpkg/Shlibs.pm b/scripts/Dpkg/Shlibs.pm index 7de8b2e75..3d4d10dcf 100644 --- a/scripts/Dpkg/Shlibs.pm +++ b/scripts/Dpkg/Shlibs.pm @@ -19,11 +19,15 @@ use strict; use warnings; our $VERSION = '0.02'; +our @EXPORT_OK = qw( + blank_library_paths + setup_library_paths + get_library_paths + add_library_dir + find_library +); use Exporter qw(import); -our @EXPORT_OK = qw(blank_library_paths add_library_dir get_library_paths - find_library setup_library_paths); - use File::Spec; use Dpkg::Gettext; diff --git a/scripts/Dpkg/Shlibs/Cppfilt.pm b/scripts/Dpkg/Shlibs/Cppfilt.pm index e2fe2a757..988836c3b 100644 --- a/scripts/Dpkg/Shlibs/Cppfilt.pm +++ b/scripts/Dpkg/Shlibs/Cppfilt.pm @@ -19,15 +19,18 @@ use strict; use warnings; our $VERSION = '0.01'; +our @EXPORT = qw( + cppfilt_demangle_cpp +); +our @EXPORT_OK = qw( + cppfilt_demangle +); use Exporter qw(import); +use IO::Handle; use Dpkg::ErrorHandling; use Dpkg::IPC; -use IO::Handle; - -our @EXPORT = qw(cppfilt_demangle_cpp); -our @EXPORT_OK = qw(cppfilt_demangle); # A hash of 'objects' referring to preforked c++filt processes for the distinct # demangling types. diff --git a/scripts/Dpkg/Shlibs/Objdump.pm b/scripts/Dpkg/Shlibs/Objdump.pm index b69a1ff9b..4be66a749 100644 --- a/scripts/Dpkg/Shlibs/Objdump.pm +++ b/scripts/Dpkg/Shlibs/Objdump.pm @@ -18,14 +18,14 @@ package Dpkg::Shlibs::Objdump; use strict; use warnings; +our $VERSION = '0.01'; + use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Path qw(find_command); use Dpkg::Arch qw(debarch_to_gnutriplet get_build_arch get_host_arch); use Dpkg::IPC; -our $VERSION = '0.01'; - # Decide which objdump to call our $OBJDUMP = 'objdump'; if (get_build_arch() ne get_host_arch()) { diff --git a/scripts/Dpkg/Shlibs/Symbol.pm b/scripts/Dpkg/Shlibs/Symbol.pm index 0c8965763..56bf17783 100644 --- a/scripts/Dpkg/Shlibs/Symbol.pm +++ b/scripts/Dpkg/Shlibs/Symbol.pm @@ -21,12 +21,13 @@ use warnings; our $VERSION = '0.01'; +use Storable (); + use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Util qw(:list); use Dpkg::Arch qw(debarch_is_concerned debarch_to_cpuattrs); use Dpkg::Version; -use Storable (); use Dpkg::Shlibs::Cppfilt; # Supported alias types in the order of matching preference diff --git a/scripts/Dpkg/Source/Archive.pm b/scripts/Dpkg/Source/Archive.pm index 1728f2329..2af113af3 100644 --- a/scripts/Dpkg/Source/Archive.pm +++ b/scripts/Dpkg/Source/Archive.pm @@ -20,17 +20,17 @@ use warnings; our $VERSION = '0.01'; -use Dpkg::Source::Functions qw(erasedir fixperms); -use Dpkg::Gettext; -use Dpkg::IPC; -use Dpkg::ErrorHandling; - use Carp; use File::Temp qw(tempdir); use File::Basename qw(basename); use File::Spec; use Cwd; +use Dpkg::Gettext; +use Dpkg::ErrorHandling; +use Dpkg::IPC; +use Dpkg::Source::Functions qw(erasedir fixperms); + use parent qw(Dpkg::Compression::FileHandle); sub create { diff --git a/scripts/Dpkg/Source/Functions.pm b/scripts/Dpkg/Source/Functions.pm index 70a1364ab..9d40e1687 100644 --- a/scripts/Dpkg/Source/Functions.pm +++ b/scripts/Dpkg/Source/Functions.pm @@ -17,16 +17,20 @@ use strict; use warnings; our $VERSION = '0.01'; +our @EXPORT_OK = qw( + erasedir + fixperms + fs_time + is_binary +); use Exporter qw(import); -our @EXPORT_OK = qw(erasedir fixperms fs_time is_binary); +use POSIX qw(:errno_h); use Dpkg::ErrorHandling; use Dpkg::Gettext; use Dpkg::IPC; -use POSIX qw(:errno_h); - sub erasedir { my $dir = shift; if (not lstat($dir)) { diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm index 699497ae5..2e3440c47 100644 --- a/scripts/Dpkg/Source/Package.pm +++ b/scripts/Dpkg/Source/Package.pm @@ -36,6 +36,16 @@ use strict; use warnings; our $VERSION = '1.01'; +our @EXPORT_OK = qw( + get_default_diff_ignore_regex + set_default_diff_ignore_regex + get_default_tar_ignore_pattern +); + +use Exporter qw(import); +use POSIX qw(:errno_h :sys_wait_h); +use Carp; +use File::Basename; use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -48,15 +58,6 @@ use Dpkg::Path qw(check_files_are_the_same find_command); use Dpkg::IPC; use Dpkg::Vendor qw(run_vendor_hook); -use Carp; -use POSIX qw(:errno_h :sys_wait_h); -use File::Basename; - -use Exporter qw(import); -our @EXPORT_OK = qw(get_default_diff_ignore_regex - set_default_diff_ignore_regex - get_default_tar_ignore_pattern); - my $diff_ignore_default_regex = ' # Ignore general backup files (?:^|/).*~$| diff --git a/scripts/Dpkg/Source/Package/V1.pm b/scripts/Dpkg/Source/Package/V1.pm index d595acb74..73cf82179 100644 --- a/scripts/Dpkg/Source/Package/V1.pm +++ b/scripts/Dpkg/Source/Package/V1.pm @@ -20,7 +20,11 @@ use warnings; our $VERSION = '0.01'; -use parent qw(Dpkg::Source::Package); +use POSIX qw(:errno_h); +use Cwd; +use File::Basename; +use File::Temp qw(tempfile); +use File::Spec; use Dpkg (); use Dpkg::Gettext; @@ -32,11 +36,7 @@ use Dpkg::Exit qw(push_exit_handler pop_exit_handler); use Dpkg::Source::Functions qw(erasedir); use Dpkg::Source::Package::V3::Native; -use POSIX qw(:errno_h); -use Cwd; -use File::Basename; -use File::Temp qw(tempfile); -use File::Spec; +use parent qw(Dpkg::Source::Package); our $CURRENT_MINOR_VERSION = '0'; diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index 00660607f..822041afc 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/scripts/Dpkg/Source/Package/V2.pm @@ -21,7 +21,15 @@ use warnings; our $VERSION = '0.01'; -use parent qw(Dpkg::Source::Package); +use POSIX qw(:errno_h); +use List::Util qw(first); +use Cwd; +use File::Basename; +use File::Temp qw(tempfile tempdir); +use File::Path qw(make_path); +use File::Spec; +use File::Find; +use File::Copy; use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -36,15 +44,7 @@ use Dpkg::Vendor qw(run_vendor_hook); use Dpkg::Control; use Dpkg::Changelog::Parse; -use List::Util qw(first); -use POSIX qw(:errno_h); -use Cwd; -use File::Basename; -use File::Temp qw(tempfile tempdir); -use File::Path qw(make_path); -use File::Spec; -use File::Find; -use File::Copy; +use parent qw(Dpkg::Source::Package); our $CURRENT_MINOR_VERSION = '0'; diff --git a/scripts/Dpkg/Source/Package/V3/Bzr.pm b/scripts/Dpkg/Source/Package/V3/Bzr.pm index 9abe3c43f..afcf730b6 100644 --- a/scripts/Dpkg/Source/Package/V3/Bzr.pm +++ b/scripts/Dpkg/Source/Package/V3/Bzr.pm @@ -26,8 +26,6 @@ use warnings; our $VERSION = '0.01'; -use parent qw(Dpkg::Source::Package); - use Cwd; use File::Basename; use File::Find; @@ -40,6 +38,8 @@ use Dpkg::Source::Archive; use Dpkg::Exit qw(push_exit_handler pop_exit_handler); use Dpkg::Source::Functions qw(erasedir); +use parent qw(Dpkg::Source::Package); + our $CURRENT_MINOR_VERSION = '0'; sub import { diff --git a/scripts/Dpkg/Source/Package/V3/Custom.pm b/scripts/Dpkg/Source/Package/V3/Custom.pm index 8a36d6d04..08d1a79c4 100644 --- a/scripts/Dpkg/Source/Package/V3/Custom.pm +++ b/scripts/Dpkg/Source/Package/V3/Custom.pm @@ -20,11 +20,11 @@ use warnings; our $VERSION = '0.01'; -use parent qw(Dpkg::Source::Package); - use Dpkg::Gettext; use Dpkg::ErrorHandling; +use parent qw(Dpkg::Source::Package); + our $CURRENT_MINOR_VERSION = '0'; sub parse_cmdline_option { diff --git a/scripts/Dpkg/Source/Package/V3/Git.pm b/scripts/Dpkg/Source/Package/V3/Git.pm index d73676eba..e0882c706 100644 --- a/scripts/Dpkg/Source/Package/V3/Git.pm +++ b/scripts/Dpkg/Source/Package/V3/Git.pm @@ -24,8 +24,6 @@ use warnings; our $VERSION = '0.02'; -use parent qw(Dpkg::Source::Package); - use Cwd qw(abs_path getcwd); use File::Basename; use File::Temp qw(tempdir); @@ -35,6 +33,8 @@ use Dpkg::ErrorHandling; use Dpkg::Exit qw(push_exit_handler pop_exit_handler); use Dpkg::Source::Functions qw(erasedir); +use parent qw(Dpkg::Source::Package); + our $CURRENT_MINOR_VERSION = '0'; # Remove variables from the environment that might cause git to do diff --git a/scripts/Dpkg/Source/Package/V3/Native.pm b/scripts/Dpkg/Source/Package/V3/Native.pm index 191596817..2b0fb22e2 100644 --- a/scripts/Dpkg/Source/Package/V3/Native.pm +++ b/scripts/Dpkg/Source/Package/V3/Native.pm @@ -20,7 +20,9 @@ use warnings; our $VERSION = '0.01'; -use parent qw(Dpkg::Source::Package); +use Cwd; +use File::Basename; +use File::Temp qw(tempfile); use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -30,9 +32,7 @@ use Dpkg::Version; use Dpkg::Source::Archive; use Dpkg::Source::Functions qw(erasedir); -use Cwd; -use File::Basename; -use File::Temp qw(tempfile); +use parent qw(Dpkg::Source::Package); our $CURRENT_MINOR_VERSION = '0'; diff --git a/scripts/Dpkg/Source/Package/V3/Quilt.pm b/scripts/Dpkg/Source/Package/V3/Quilt.pm index 4ac74d764..b2a69e9bb 100644 --- a/scripts/Dpkg/Source/Package/V3/Quilt.pm +++ b/scripts/Dpkg/Source/Package/V3/Quilt.pm @@ -20,8 +20,8 @@ use warnings; our $VERSION = '0.01'; -# Based on wig&pen implementation -use parent qw(Dpkg::Source::Package::V2); +use File::Spec; +use File::Copy; use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -32,8 +32,8 @@ use Dpkg::Source::Functions qw(erasedir fs_time); use Dpkg::Source::Quilt; use Dpkg::Exit; -use File::Spec; -use File::Copy; +# Based on wig&pen implementation +use parent qw(Dpkg::Source::Package::V2); our $CURRENT_MINOR_VERSION = '0'; diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm index 6297186ce..0904757f8 100644 --- a/scripts/Dpkg/Source/Patch.pm +++ b/scripts/Dpkg/Source/Patch.pm @@ -20,11 +20,6 @@ use warnings; our $VERSION = '0.01'; -use Dpkg::Gettext; -use Dpkg::IPC; -use Dpkg::ErrorHandling; -use Dpkg::Source::Functions qw(fs_time); - use POSIX qw(:errno_h :sys_wait_h); use File::Find; use File::Basename; @@ -34,6 +29,11 @@ use File::Compare; use Fcntl ':mode'; use Time::HiRes qw(stat); +use Dpkg::Gettext; +use Dpkg::ErrorHandling; +use Dpkg::IPC; +use Dpkg::Source::Functions qw(fs_time); + use parent qw(Dpkg::Compression::FileHandle); sub create { diff --git a/scripts/Dpkg/Source/Quilt.pm b/scripts/Dpkg/Source/Quilt.pm index 3a98c71c9..354d4e771 100644 --- a/scripts/Dpkg/Source/Quilt.pm +++ b/scripts/Dpkg/Source/Quilt.pm @@ -20,6 +20,12 @@ use warnings; our $VERSION = '0.02'; +use File::Spec; +use File::Copy; +use File::Find; +use File::Path qw(make_path); +use File::Basename; + use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Util qw(:list); @@ -27,12 +33,6 @@ use Dpkg::Source::Patch; use Dpkg::Source::Functions qw(erasedir fs_time); use Dpkg::Vendor qw(get_current_vendor); -use File::Spec; -use File::Copy; -use File::Find; -use File::Path qw(make_path); -use File::Basename; - sub new { my ($this, $dir, %opts) = @_; my $class = ref($this) || $this; diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm index 3ac1a517d..65c0d3c3c 100644 --- a/scripts/Dpkg/Substvars.pm +++ b/scripts/Dpkg/Substvars.pm @@ -21,14 +21,14 @@ use warnings; our $VERSION = '1.03'; +use POSIX qw(:errno_h); +use Carp; + use Dpkg (); use Dpkg::Arch qw(get_host_arch); use Dpkg::ErrorHandling; use Dpkg::Gettext; -use Carp; -use POSIX qw(:errno_h); - use parent qw(Dpkg::Interface::Storable); my $maxsubsts = 50; diff --git a/scripts/Dpkg/Util.pm b/scripts/Dpkg/Util.pm index 9d6085576..5ac919241 100644 --- a/scripts/Dpkg/Util.pm +++ b/scripts/Dpkg/Util.pm @@ -19,10 +19,15 @@ use strict; use warnings; our $VERSION = '0.01'; +our @EXPORT_OK = qw( + any + none +); +our %EXPORT_TAGS = ( + list => [ qw(any none) ], +); use Exporter qw(import); -our @EXPORT_OK = qw(any none); -our %EXPORT_TAGS = (list => [ qw(any none) ]); # XXX: Ideally we would use List::MoreUtils, but that's not a core module, # so to avoid the additional dependency we'll make do with the following diff --git a/scripts/Dpkg/Vars.pm b/scripts/Dpkg/Vars.pm index 6c1d51b0f..2253e39be 100644 --- a/scripts/Dpkg/Vars.pm +++ b/scripts/Dpkg/Vars.pm @@ -20,14 +20,17 @@ use strict; use warnings; our $VERSION = '0.03'; +our @EXPORT = qw( + get_source_package + set_source_package +); + +use Exporter qw(import); use Dpkg::ErrorHandling; use Dpkg::Gettext; use Dpkg::Package; -use Exporter qw(import); -our @EXPORT = qw(get_source_package set_source_package); - my $sourcepackage; sub get_source_package { diff --git a/scripts/Dpkg/Vendor.pm b/scripts/Dpkg/Vendor.pm index d619afe21..3a1ef6845 100644 --- a/scripts/Dpkg/Vendor.pm +++ b/scripts/Dpkg/Vendor.pm @@ -19,6 +19,16 @@ use strict; use warnings; our $VERSION = '1.01'; +our @EXPORT_OK = qw( + get_current_vendor + get_vendor_info + get_vendor_file + get_vendor_dir + get_vendor_object + run_vendor_hook +); + +use Exporter qw(import); use Dpkg (); use Dpkg::ErrorHandling; @@ -26,10 +36,6 @@ use Dpkg::Gettext; use Dpkg::BuildEnv; use Dpkg::Control::HashCore; -use Exporter qw(import); -our @EXPORT_OK = qw(get_vendor_info get_current_vendor get_vendor_file - get_vendor_dir get_vendor_object run_vendor_hook); - my $origins = "$Dpkg::CONFDIR/origins"; $origins = $ENV{DPKG_ORIGINS_DIR} if $ENV{DPKG_ORIGINS_DIR}; diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm index 2918f035f..7bf45da9d 100644 --- a/scripts/Dpkg/Vendor/Debian.pm +++ b/scripts/Dpkg/Vendor/Debian.pm @@ -24,14 +24,14 @@ use warnings; our $VERSION = '0.01'; -use parent qw(Dpkg::Vendor::Default); - use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control::Types; use Dpkg::BuildOptions; use Dpkg::Arch qw(get_host_arch debarch_to_debtriplet); +use parent qw(Dpkg::Vendor::Default); + =encoding utf8 =head1 NAME diff --git a/scripts/Dpkg/Version.pm b/scripts/Dpkg/Version.pm index 544c939ff..f6616adc9 100644 --- a/scripts/Dpkg/Version.pm +++ b/scripts/Dpkg/Version.pm @@ -22,16 +22,26 @@ use strict; use warnings; our $VERSION = '1.01'; +our @EXPORT = qw( + version_compare + version_compare_relation + version_normalize_relation + version_compare_string + version_compare_part + version_split_digits + version_check + REL_LT + REL_LE + REL_EQ + REL_GE + REL_GT +); -use Dpkg::ErrorHandling; -use Dpkg::Gettext; - -use Carp; use Exporter qw(import); -our @EXPORT = qw(version_compare version_compare_relation - version_normalize_relation version_compare_string - version_compare_part version_split_digits version_check - REL_LT REL_LE REL_EQ REL_GE REL_GT); +use Carp; + +use Dpkg::Gettext; +use Dpkg::ErrorHandling; use constant { REL_LT => '<<', diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm index 53efec5c2..38e33527f 100644 --- a/scripts/Test/Dpkg.pm +++ b/scripts/Test/Dpkg.pm @@ -19,7 +19,9 @@ use strict; use warnings; our $VERSION = '0.00'; -our @EXPORT_OK = qw(all_perl_files); +our @EXPORT_OK = qw( + all_perl_files +); use Exporter qw(import); use File::Find; diff --git a/scripts/dpkg-distaddfile.pl b/scripts/dpkg-distaddfile.pl index a0694e065..2269a7ca7 100755 --- a/scripts/dpkg-distaddfile.pl +++ b/scripts/dpkg-distaddfile.pl @@ -22,6 +22,7 @@ use strict; use warnings; use POSIX qw(:errno_h :fcntl_h); + use Dpkg (); use Dpkg::Gettext; use Dpkg::ErrorHandling; diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 2887961dd..3df42e7bd 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -25,6 +25,7 @@ use warnings; use Carp; use Encode; use POSIX qw(:errno_h :locale_h); + use Dpkg (); use Dpkg::Gettext; use Dpkg::Util qw(:list); diff --git a/scripts/dpkg-mergechangelogs.pl b/scripts/dpkg-mergechangelogs.pl index 4db706695..eacab5f5b 100755 --- a/scripts/dpkg-mergechangelogs.pl +++ b/scripts/dpkg-mergechangelogs.pl @@ -19,15 +19,15 @@ use warnings; use strict; +use Scalar::Util qw(blessed); +use Getopt::Long qw(:config posix_default bundling no_ignorecase); + use Dpkg (); use Dpkg::Changelog::Debian; use Dpkg::ErrorHandling; use Dpkg::Gettext; use Dpkg::Version; -use Getopt::Long qw(:config posix_default bundling no_ignorecase); -use Scalar::Util qw(blessed); - textdomain('dpkg-dev'); sub merge_entries($$$); diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 48e8ebe0e..dbb51003c 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -28,6 +28,10 @@ use strict; use warnings; +use Cwd; +use File::Basename; +use File::Spec; + use Dpkg (); use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -47,10 +51,6 @@ use Dpkg::Source::Package qw(get_default_diff_ignore_regex get_default_tar_ignore_pattern); use Dpkg::Vendor qw(run_vendor_hook); -use Cwd; -use File::Basename; -use File::Spec; - textdomain('dpkg-dev'); my $controlfile; diff --git a/scripts/t/Dpkg_Control.t b/scripts/t/Dpkg_Control.t index 76324da59..a64e31114 100644 --- a/scripts/t/Dpkg_Control.t +++ b/scripts/t/Dpkg_Control.t @@ -17,6 +17,7 @@ use strict; use warnings; use Test::More tests => 23; + use IO::String; BEGIN { diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t index ede18f7fb..3f8afb7b2 100644 --- a/scripts/t/Dpkg_Shlibs.t +++ b/scripts/t/Dpkg_Shlibs.t @@ -17,6 +17,7 @@ use strict; use warnings; use Test::More tests => 122; + use Cwd; use IO::String; |