Browse Source

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.
Guillem Jover 9 years ago
parent
commit
01abe8afb9
54 changed files with 358 additions and 192 deletions
  1. 13 4
      dselect/methods/Dselect/Ftp.pm
  2. 15 2
      scripts/Dpkg.pm
  3. 22 10
      scripts/Dpkg/Arch.pm
  4. 6 2
      scripts/Dpkg/BuildProfiles.pm
  5. 2 1
      scripts/Dpkg/Changelog/Debian.pm
  6. 10 5
      scripts/Dpkg/Changelog/Entry/Debian.pm
  7. 5 3
      scripts/Dpkg/Changelog/Parse.pm
  8. 6 4
      scripts/Dpkg/Checksums.pm
  9. 15 10
      scripts/Dpkg/Compression.pm
  10. 3 3
      scripts/Dpkg/Compression/FileHandle.pm
  11. 15 6
      scripts/Dpkg/Control.pm
  12. 1 0
      scripts/Dpkg/Control/Changelog.pm
  13. 1 2
      scripts/Dpkg/Control/Fields.pm
  14. 20 9
      scripts/Dpkg/Control/FieldsCore.pm
  15. 13 3
      scripts/Dpkg/Control/Types.pm
  16. 9 4
      scripts/Dpkg/Deps.pm
  17. 2 2
      scripts/Dpkg/Dist/Files.pm
  18. 15 5
      scripts/Dpkg/ErrorHandling.pm
  19. 5 2
      scripts/Dpkg/Exit.pm
  20. 6 3
      scripts/Dpkg/File.pm
  21. 3 1
      scripts/Dpkg/Getopt.pm
  22. 7 1
      scripts/Dpkg/Gettext.pm
  23. 7 4
      scripts/Dpkg/IPC.pm
  24. 5 3
      scripts/Dpkg/Package.pm
  25. 11 5
      scripts/Dpkg/Path.pm
  26. 7 3
      scripts/Dpkg/Shlibs.pm
  27. 7 4
      scripts/Dpkg/Shlibs/Cppfilt.pm
  28. 2 2
      scripts/Dpkg/Shlibs/Objdump.pm
  29. 2 1
      scripts/Dpkg/Shlibs/Symbol.pm
  30. 5 5
      scripts/Dpkg/Source/Archive.pm
  31. 7 3
      scripts/Dpkg/Source/Functions.pm
  32. 10 9
      scripts/Dpkg/Source/Package.pm
  33. 6 6
      scripts/Dpkg/Source/Package/V1.pm
  34. 10 10
      scripts/Dpkg/Source/Package/V2.pm
  35. 2 2
      scripts/Dpkg/Source/Package/V3/Bzr.pm
  36. 2 2
      scripts/Dpkg/Source/Package/V3/Custom.pm
  37. 2 2
      scripts/Dpkg/Source/Package/V3/Git.pm
  38. 4 4
      scripts/Dpkg/Source/Package/V3/Native.pm
  39. 4 4
      scripts/Dpkg/Source/Package/V3/Quilt.pm
  40. 5 5
      scripts/Dpkg/Source/Patch.pm
  41. 6 6
      scripts/Dpkg/Source/Quilt.pm
  42. 3 3
      scripts/Dpkg/Substvars.pm
  43. 7 2
      scripts/Dpkg/Util.pm
  44. 6 3
      scripts/Dpkg/Vars.pm
  45. 10 4
      scripts/Dpkg/Vendor.pm
  46. 2 2
      scripts/Dpkg/Vendor/Debian.pm
  47. 18 8
      scripts/Dpkg/Version.pm
  48. 3 1
      scripts/Test/Dpkg.pm
  49. 1 0
      scripts/dpkg-distaddfile.pl
  50. 1 0
      scripts/dpkg-genchanges.pl
  51. 3 3
      scripts/dpkg-mergechangelogs.pl
  52. 4 4
      scripts/dpkg-source.pl
  53. 1 0
      scripts/t/Dpkg_Control.t
  54. 1 0
      scripts/t/Dpkg_Shlibs.t

+ 13 - 4
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 {

+ 15 - 2
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
 

+ 22 - 10
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;

+ 6 - 2
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);
 

+ 2 - 1
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'),

+ 10 - 5
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

+ 5 - 3
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)

+ 6 - 4
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

+ 15 - 10
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

+ 3 - 3
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

+ 15 - 6
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

+ 1 - 0
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

+ 1 - 2
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

+ 20 - 9
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,

+ 13 - 3
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
 

+ 9 - 4
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,

+ 2 - 2
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;

+ 15 - 5
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;
 

+ 5 - 2
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 = ();

+ 6 - 3
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) = @_;
 

+ 3 - 1
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);
 

+ 7 - 1
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);
 

+ 7 - 4
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
 

+ 5 - 3
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 // '';

+ 11 - 5
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

+ 7 - 3
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;

+ 7 - 4
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.

+ 2 - 2
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()) {

+ 2 - 1
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

+ 5 - 5
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 {

+ 7 - 3
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)) {

+ 10 - 9
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
 (?:^|/).*~$|

+ 6 - 6
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';
 

+ 10 - 10
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';
 

+ 2 - 2
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 {

+ 2 - 2
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 {

+ 2 - 2
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

+ 4 - 4
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';
 

+ 4 - 4
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';
 

+ 5 - 5
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 {

+ 6 - 6
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;

+ 3 - 3
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;

+ 7 - 2
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

+ 6 - 3
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 {

+ 10 - 4
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};
 

+ 2 - 2
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

+ 18 - 8
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 => '<<',

+ 3 - 1
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;

+ 1 - 0
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;

+ 1 - 0
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);

+ 3 - 3
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($$$);

+ 4 - 4
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;

+ 1 - 0
scripts/t/Dpkg_Control.t

@@ -17,6 +17,7 @@ use strict;
 use warnings;
 
 use Test::More tests => 23;
+
 use IO::String;
 
 BEGIN {

+ 1 - 0
scripts/t/Dpkg_Shlibs.t

@@ -17,6 +17,7 @@ use strict;
 use warnings;
 
 use Test::More tests => 122;
+
 use Cwd;
 use IO::String;