This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=a9b22de4db4d42417c4cac74e7e537f48284e731 commit a9b22de4db4d42417c4cac74e7e537f48284e731 Author: Guillem Jover <[email protected]> AuthorDate: Thu Nov 21 02:46:08 2024 +0100 perl: Remove function prototypes These have many issues, perform implicit context coercion which can be rather surprising for callers, and are incompatible with function signatures, which we'll be using once the minimum Perl version supporting them has been bumped in our coding style baseline. --- dselect/methods/Dselect/Method.pm | 2 +- dselect/methods/ftp/install.pl | 12 +++++------ dselect/methods/ftp/setup.pl | 2 +- scripts/Dpkg/Arch.pm | 44 +++++++++++++++++++------------------- scripts/Dpkg/Checksums.pm | 6 +++--- scripts/Dpkg/Control/FieldsCore.pm | 28 ++++++++++++------------ scripts/Dpkg/ErrorHandling.pm | 16 +++++++------- scripts/Dpkg/Lock.pm | 2 +- scripts/Dpkg/Package.pm | 2 +- scripts/Dpkg/Path.pm | 18 ++++++++-------- scripts/Dpkg/Source/Functions.pm | 4 ++-- scripts/Dpkg/Vendor.pm | 10 ++++----- scripts/Dpkg/Version.pm | 14 ++++++------ scripts/dpkg-ar.pl | 4 ++-- scripts/dpkg-architecture.pl | 2 +- scripts/dpkg-buildapi.pl | 4 ++-- scripts/dpkg-checkbuilddeps.pl | 2 +- scripts/dpkg-fsys-usrunmess.pl | 2 +- scripts/dpkg-mergechangelogs.pl | 19 ++++++---------- scripts/dpkg-name.pl | 18 ++++++++-------- 20 files changed, 102 insertions(+), 109 deletions(-) diff --git a/dselect/methods/Dselect/Method.pm b/dselect/methods/Dselect/Method.pm index d5fe984f7..e8b4f8f48 100644 --- a/dselect/methods/Dselect/Method.pm +++ b/dselect/methods/Dselect/Method.pm @@ -57,7 +57,7 @@ if ($@) { our %CONFIG; -sub yesno($$) { +sub yesno { my ($d, $msg) = @_; my ($res, $r); diff --git a/dselect/methods/ftp/install.pl b/dselect/methods/ftp/install.pl index 75647bd61..2cdd8f3f9 100755 --- a/dselect/methods/ftp/install.pl +++ b/dselect/methods/ftp/install.pl @@ -205,7 +205,7 @@ foreach my $site (@{$CONFIG{site}}) { my $dldir = $CONFIG{dldir}; # md5sum -sub md5sum($) { +sub md5sum { my $fn = shift; my $m = qx(md5sum $fn); $m = (split(' ', $m))[0]; @@ -310,7 +310,7 @@ if($totsize == 0) { } } -sub download() { +sub download { my $i = 0; foreach my $site (@{$CONFIG{site}}) { @@ -447,7 +447,7 @@ my %files; # package-version => files... # check a deb or split deb file # return 1 if it a deb file, 2 if it is a split deb file # else 0 -sub chkdeb($) { +sub chkdeb { my ($fn) = @_; # check to see if it is a .deb file if (!system "dpkg-deb --info $fn >/dev/null 2>&1 && dpkg-deb --contents $fn >/dev/null 2>&1") { @@ -457,7 +457,7 @@ sub chkdeb($) { } return 0; } -sub getdebinfo($) { +sub getdebinfo { my ($fn) = @_; my $type = chkdeb($fn); my ($pkg, $ver); @@ -484,7 +484,7 @@ sub getdebinfo($) { } # process deb file to make sure we only keep latest versions -sub prcdeb($$) { +sub prcdeb { my ($dir, $fn) = @_; my ($pkg, $ver) = getdebinfo($fn); if(!defined($pkg) || !defined($ver)) { @@ -511,7 +511,7 @@ sub prcdeb($$) { } } -sub prcfile() { +sub prcfile { my ($fn) = $_; if (-f $fn and $fn ne '.') { my $dir = '.'; diff --git a/dselect/methods/ftp/setup.pl b/dselect/methods/ftp/setup.pl index 888291b87..ce0e0dc3b 100755 --- a/dselect/methods/ftp/setup.pl +++ b/dselect/methods/ftp/setup.pl @@ -108,7 +108,7 @@ if (! $CONFIG{done}) { edit_config('ftp', $methdir); my $ftp; -sub download() { +sub download { foreach (@{$CONFIG{site}}) { $ftp = do_connect(ftpsite => $_->[0], ftpdir => $_->[1], diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm index 83aadb10e..cadefb4d4 100644 --- a/scripts/Dpkg/Arch.pm +++ b/scripts/Dpkg/Arch.pm @@ -122,7 +122,7 @@ from the environment. =cut -sub get_raw_build_arch() +sub get_raw_build_arch { state $build_arch; @@ -149,7 +149,7 @@ if available. =cut -sub get_build_arch() +sub get_build_arch { return Dpkg::BuildEnv::get('DEB_BUILD_ARCH') || get_raw_build_arch(); } @@ -157,7 +157,7 @@ sub get_build_arch() { my %cc_host_gnu_type; - sub get_host_gnu_type() + sub get_host_gnu_type { my $CC = $ENV{CC} || 'gcc'; @@ -191,7 +191,7 @@ from the environment. =cut -sub get_raw_host_arch() +sub get_raw_host_arch { state $host_arch; @@ -231,7 +231,7 @@ if available. =cut -sub get_host_arch() +sub get_host_arch { return Dpkg::BuildEnv::get('DEB_HOST_ARCH') || get_raw_host_arch(); } @@ -242,7 +242,7 @@ Get an array with all currently known Debian architectures. =cut -sub get_valid_arches() +sub get_valid_arches { _load_cputable(); _load_ostable(); @@ -303,7 +303,7 @@ sub _load_ostable }); } -sub _load_abitable() +sub _load_abitable { _load_table('abitable', sub { if (m/^(?!\#)(\S+)\s+(\S+)/) { @@ -312,7 +312,7 @@ sub _load_abitable() }); } -sub _load_tupletable() +sub _load_tupletable { _load_cputable(); @@ -340,7 +340,7 @@ sub _load_tupletable() }); } -sub debtuple_to_gnutriplet(@) +sub debtuple_to_gnutriplet { my ($abi, $libc, $os, $cpu) = @_; @@ -353,7 +353,7 @@ sub debtuple_to_gnutriplet(@) return join('-', $cputable{$cpu}, $ostable{"$abi-$libc-$os"}); } -sub gnutriplet_to_debtuple($) +sub gnutriplet_to_debtuple { my $gnu = shift; return unless defined($gnu); @@ -389,7 +389,7 @@ Map a GNU triplet into a Debian multiarch triplet. =cut -sub gnutriplet_to_multiarch($) +sub gnutriplet_to_multiarch { my $gnu = shift; my ($cpu, $cdr) = split(/-/, $gnu, 2); @@ -407,14 +407,14 @@ Map a Debian architecture into a Debian multiarch triplet. =cut -sub debarch_to_multiarch($) +sub debarch_to_multiarch { my $arch = shift; return gnutriplet_to_multiarch(debarch_to_gnutriplet($arch)); } -sub debtuple_to_debarch(@) +sub debtuple_to_debarch { my ($abi, $libc, $os, $cpu) = @_; @@ -429,7 +429,7 @@ sub debtuple_to_debarch(@) } } -sub debarch_to_debtuple($) +sub debarch_to_debtuple { my $arch = shift; @@ -464,7 +464,7 @@ Map a Debian architecture into a GNU triplet. =cut -sub debarch_to_gnutriplet($) +sub debarch_to_gnutriplet { my $arch = shift; @@ -477,14 +477,14 @@ Map a GNU triplet into a Debian architecture. =cut -sub gnutriplet_to_debarch($) +sub gnutriplet_to_debarch { my $gnu = shift; return debtuple_to_debarch(gnutriplet_to_debtuple($gnu)); } -sub debwildcard_to_debtuple($) +sub debwildcard_to_debtuple { my $arch = shift; my @tuple = split /-/, $arch, 4; @@ -504,7 +504,7 @@ sub debwildcard_to_debtuple($) } } -sub debarch_to_abiattrs($) +sub debarch_to_abiattrs { my $arch = shift; my ($abi, $libc, $os, $cpu) = debarch_to_debtuple($arch); @@ -518,7 +518,7 @@ sub debarch_to_abiattrs($) } } -sub debarch_to_cpubits($) +sub debarch_to_cpubits { my $arch = shift; my $cpu; @@ -539,7 +539,7 @@ Debian architecture. No wildcard matching is performed. =cut -sub debarch_eq($$) +sub debarch_eq { my ($a, $b) = @_; @@ -560,7 +560,7 @@ architecture wildcard. =cut -sub debarch_is($$) +sub debarch_is { my ($real, $alias) = @_; @@ -587,7 +587,7 @@ Evaluate whether a Debian architecture is an architecture wildcard. =cut -sub debarch_is_wildcard($) +sub debarch_is_wildcard { my $arch = shift; diff --git a/scripts/Dpkg/Checksums.pm b/scripts/Dpkg/Checksums.pm index 3db1636c2..44bf466f1 100644 --- a/scripts/Dpkg/Checksums.pm +++ b/scripts/Dpkg/Checksums.pm @@ -76,7 +76,7 @@ Returns the list of supported checksums algorithms. =cut -sub checksums_get_list() { +sub checksums_get_list { my @list = sort keys %{$CHECKSUMS}; return @list; } @@ -88,7 +88,7 @@ supported. The checksum algorithm is case-insensitive. =cut -sub checksums_is_supported($) { +sub checksums_is_supported { my $alg = shift; return exists $CHECKSUMS->{lc($alg)}; } @@ -104,7 +104,7 @@ whether the checksum algorithm is considered cryptographically strong. =cut -sub checksums_get_property($$) { +sub checksums_get_property { my ($alg, $property) = @_; return unless checksums_is_supported($alg); diff --git a/scripts/Dpkg/Control/FieldsCore.pm b/scripts/Dpkg/Control/FieldsCore.pm index 38fa7741a..1fec429f9 100644 --- a/scripts/Dpkg/Control/FieldsCore.pm +++ b/scripts/Dpkg/Control/FieldsCore.pm @@ -1048,7 +1048,7 @@ except the first of each word (words are separated by a hyphen in field names). =cut -sub field_capitalize($) { +sub field_capitalize { my $field = lc(shift); # Use known fields first. @@ -1064,7 +1064,7 @@ Returns true if the field is official and known. =cut -sub field_is_official($) { +sub field_is_official { my $field = lc shift; return exists $FIELDS{$field}; @@ -1083,7 +1083,7 @@ Undef is returned for non-official fields. =cut -sub field_is_allowed_in($@) { +sub field_is_allowed_in { my ($field, @types) = @_; $field = lc $field; @@ -1117,7 +1117,7 @@ added to $to otherwise. =cut -sub field_transfer_single($$;$) { +sub field_transfer_single { my ($from, $to, $field) = @_; if (not defined $field) { warnings::warnif('deprecated', @@ -1164,7 +1164,7 @@ Returns the list of fields that have been added to $to. =cut -sub field_transfer_all($$) { +sub field_transfer_all { my ($from, $to) = @_; my (@res, $res); foreach my $k (keys %$from) { @@ -1182,7 +1182,7 @@ The list might be empty for types where the order does not matter much. =cut -sub field_ordered_list($) { +sub field_ordered_list { my $type = shift; if (exists $FIELD_ORDER{$type}) { @@ -1205,7 +1205,7 @@ Dpkg::Package::pkg_name_is_illegal() and Dpkg::Version::version_check(). =cut -sub field_parse_binary_source($) { +sub field_parse_binary_source { my $ctrl = shift; my $ctrl_type = $ctrl->get_type(); @@ -1244,7 +1244,7 @@ Debian package. =cut -sub field_list_src_dep() { +sub field_list_src_dep { my @list = map { $FIELDS{$_}{name} } sort { @@ -1264,7 +1264,7 @@ the stronger to the weaker. =cut -sub field_list_pkg_dep() { +sub field_list_pkg_dep { my @list = map { $FIELDS{$_}{name} } sort { @@ -1285,7 +1285,7 @@ Breaks, ...). Returns undef for fields which are not dependencies. =cut -sub field_get_dep_type($) { +sub field_get_dep_type { my $field = lc shift; return unless exists $FIELDS{$field}; @@ -1300,7 +1300,7 @@ FIELD_SEP_SPACE, FIELD_SEP_COMMA or FIELD_SEP_LINE. =cut -sub field_get_sep_type($) { +sub field_get_sep_type { my $field = lc shift; return $FIELDS{$field}{separator} if exists $FIELDS{$field}{separator}; @@ -1314,7 +1314,7 @@ types. %opts is optional. =cut -sub field_register($$;@) { +sub field_register { my ($field, $types, %opts) = @_; $field = lc $field; @@ -1336,7 +1336,7 @@ Return true if the field was inserted, otherwise false. =cut -sub field_insert_after($$@) { +sub field_insert_after { my ($type, $field, @fields) = @_; return 0 if not exists $FIELD_ORDER{$type}; @@ -1358,7 +1358,7 @@ Return true if the field was inserted, otherwise false. =cut -sub field_insert_before($$@) { +sub field_insert_before { my ($type, $field, @fields) = @_; return 0 if not exists $FIELD_ORDER{$type}; diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm index efe3a6f99..e2f2c2009 100644 --- a/scripts/Dpkg/ErrorHandling.pm +++ b/scripts/Dpkg/ErrorHandling.pm @@ -186,7 +186,7 @@ sub _typename_prefix return report_pretty(report_name($type), report_color($type)); } -sub report(@) +sub report { my ($type, $msg, @args) = @_; @@ -205,7 +205,7 @@ sub debug print report(REPORT_DEBUG, @args) if $level <= $debug_level; } -sub info($;@) +sub info { my @args = @_; @@ -219,28 +219,28 @@ sub notice warn report(REPORT_NOTICE, @args) if not $quiet_warnings; } -sub warning($;@) +sub warning { my @args = @_; warn report(REPORT_WARN, @args) if not $quiet_warnings; } -sub syserr($;@) +sub syserr { my ($msg, @args) = @_; die report(REPORT_ERROR, "$msg: $!", @args); } -sub error($;@) +sub error { my @args = @_; die report(REPORT_ERROR, @args); } -sub errormsg($;@) +sub errormsg { my @args = @_; @@ -254,7 +254,7 @@ sub printcmd print { *STDERR } report_pretty(" @cmd\n", report_color(REPORT_COMMAND)); } -sub subprocerr(@) +sub subprocerr { my ($p, @args) = @_; @@ -273,7 +273,7 @@ sub subprocerr(@) } } -sub usageerr(@) +sub usageerr { my ($msg, @args) = @_; diff --git a/scripts/Dpkg/Lock.pm b/scripts/Dpkg/Lock.pm index 176a670a3..31bd684d9 100644 --- a/scripts/Dpkg/Lock.pm +++ b/scripts/Dpkg/Lock.pm @@ -43,7 +43,7 @@ use Fcntl qw(:flock); use Dpkg::Gettext; use Dpkg::ErrorHandling; -sub file_lock($$) { +sub file_lock { my ($fh, $filename) = @_; # A strict dependency on libfile-fcntllock-perl being it an XS module, diff --git a/scripts/Dpkg/Package.pm b/scripts/Dpkg/Package.pm index 4741a6f45..d7d113294 100644 --- a/scripts/Dpkg/Package.pm +++ b/scripts/Dpkg/Package.pm @@ -46,7 +46,7 @@ use Exporter qw(import); use Dpkg::ErrorHandling; use Dpkg::Gettext; -sub pkg_name_is_illegal($) { +sub pkg_name_is_illegal { my $name = shift // ''; if ($name eq '') { diff --git a/scripts/Dpkg/Path.pm b/scripts/Dpkg/Path.pm index ae8c73464..4a40e0588 100644 --- a/scripts/Dpkg/Path.pm +++ b/scripts/Dpkg/Path.pm @@ -69,7 +69,7 @@ If no DEBIAN subdirectory is found, it will return undef. =cut -sub get_pkg_root_dir($) { +sub get_pkg_root_dir { my $file = shift; $file =~ s{/+$}{}; $file =~ s{/+[^/]+$}{} if not -d $file; @@ -87,7 +87,7 @@ Returns the filename relative to get_pkg_root_dir($file). =cut -sub relative_to_pkg_root($) { +sub relative_to_pkg_root { my $file = shift; my $pkg_root = get_pkg_root_dir($file); if (defined $pkg_root) { @@ -109,7 +109,7 @@ provided. =cut -sub guess_pkg_root_dir($) { +sub guess_pkg_root_dir { my $file = shift; my $root = get_pkg_root_dir($file); return $root if defined $root; @@ -135,7 +135,7 @@ $resolve_symlink is true then stat() is used, otherwise lstat() is used. =cut -sub check_files_are_the_same($$;$) { +sub check_files_are_the_same { my ($file1, $file2, $resolve_symlink) = @_; return 1 if $file1 eq $file2; @@ -162,7 +162,7 @@ filenames. =cut -sub canonpath($) { +sub canonpath { my $path = shift; $path = File::Spec->canonpath($path); my ($v, $dirs, $file) = File::Spec->splitpath($path); @@ -196,7 +196,7 @@ canonicalized by canonpath(). =cut -sub resolve_symlink($) { +sub resolve_symlink { my $symlink = shift; my $content = readlink($symlink); return unless defined $content; @@ -255,7 +255,7 @@ relative path or on the $PATH, undef otherwise. =cut -sub find_command($) { +sub find_command { my $cmd = shift; return if not $cmd; @@ -280,7 +280,7 @@ Return the path of all available control files for the given package. =cut -sub get_control_path($;$) { +sub get_control_path { my ($pkg, $filetype) = @_; my $control_file; my @exec = ('dpkg-query', '--control-path', $pkg); @@ -309,7 +309,7 @@ list if none of the files exists. =cut -sub find_build_file($) { +sub find_build_file { my $base = shift; my $host_arch = get_host_arch(); my ($abi, $libc, $host_os, $cpu) = debarch_to_debtuple($host_arch); diff --git a/scripts/Dpkg/Source/Functions.pm b/scripts/Dpkg/Source/Functions.pm index 0d1af067f..e091a4aa1 100644 --- a/scripts/Dpkg/Source/Functions.pm +++ b/scripts/Dpkg/Source/Functions.pm @@ -105,7 +105,7 @@ sub chmod_if_needed { # Use this instead of time() when the timestamp is going to be # used to set file timestamps. This avoids confusion when an # NFS server and NFS client disagree about what time it is. -sub fs_time($) { +sub fs_time { my $file = shift; my $is_temp = 0; if (not -e $file) { @@ -121,7 +121,7 @@ sub fs_time($) { return $mtime; } -sub is_binary($) { +sub is_binary { my $file = shift; # Perform the same check as diff(1), look for a NUL character in the first diff --git a/scripts/Dpkg/Vendor.pm b/scripts/Dpkg/Vendor.pm index fea37f1e1..f101246b5 100644 --- a/scripts/Dpkg/Vendor.pm +++ b/scripts/Dpkg/Vendor.pm @@ -84,7 +84,7 @@ sub get_vendor_dir { return $origins; } -=item $fields = get_vendor_info($name) +=item $fields = get_vendor_info([$name]) Returns a L<Dpkg::Control> object with the information parsed from the corresponding vendor file in $Dpkg::CONFDIR/origins/. If $name is omitted, @@ -96,7 +96,7 @@ if there's no file for the given vendor. my $vendor_sep_regex = qr{[^A-Za-z0-9]+}; -sub get_vendor_info(;$) { +sub get_vendor_info { my $vendor = shift || 'default'; my $vendor_key = lc $vendor =~ s{$vendor_sep_regex}{}gr; state %VENDOR_CACHE; @@ -110,7 +110,7 @@ sub get_vendor_info(;$) { return $fields; } -=item $name = get_vendor_file($name) +=item $name = get_vendor_file([$name]) Check if there's a file for the given vendor and returns its name. @@ -133,7 +133,7 @@ the dpkg 1.22.x release cycle. =cut -sub get_vendor_file(;$) { +sub get_vendor_file { my $vendor = shift || 'default'; my @names; @@ -174,7 +174,7 @@ If that file doesn't exist, it returns undef. =cut -sub get_current_vendor() { +sub get_current_vendor { my $f; if (Dpkg::BuildEnv::has('DEB_VENDOR')) { $f = get_vendor_info(Dpkg::BuildEnv::get('DEB_VENDOR')); diff --git a/scripts/Dpkg/Version.pm b/scripts/Dpkg/Version.pm index 5ead4854b..091a8bccd 100644 --- a/scripts/Dpkg/Version.pm +++ b/scripts/Dpkg/Version.pm @@ -265,7 +265,7 @@ If $a or $b are not valid version numbers, it dies with an error. =cut -sub version_compare($$) { +sub version_compare { my ($a, $b) = @_; my $va = Dpkg::Version->new($a, check => 1); defined($va) || error(g_('%s is not a valid version'), "$a"); @@ -285,7 +285,7 @@ have an input string containing the operator. =cut -sub version_compare_relation($$$) { +sub version_compare_relation { my ($a, $op, $b) = @_; my $res = version_compare($a, $b); @@ -314,7 +314,7 @@ they are obsolete aliases of ">=" and "<=". =cut -sub version_normalize_relation($) { +sub version_normalize_relation { my $op = shift; warning('relation %s is deprecated: use %s or %s', @@ -362,7 +362,7 @@ sub _version_order { } } -sub version_compare_string($$) { +sub version_compare_string { my @a = map { _version_order($_) } split(//, shift); my @b = map { _version_order($_) } split(//, shift); while (1) { @@ -386,7 +386,7 @@ $a is earlier than $b, 0 if they are equal and 1 if $a is later than $b. =cut -sub version_compare_part($$) { +sub version_compare_part { my @a = version_split_digits(shift); my @b = version_split_digits(shift); while (1) { @@ -414,7 +414,7 @@ return ("1", ".", "024", "~beta", "1", "+svn", "234"). =cut -sub version_split_digits($) { +sub version_split_digits { my $version = shift; return split /(?<=\d)(?=\D)|(?<=\D)(?=\d)/, $version; @@ -430,7 +430,7 @@ contains a description of the problem with the $version scalar. =cut -sub version_check($) { +sub version_check { my $version = shift; my $str; if (defined $version) { diff --git a/scripts/dpkg-ar.pl b/scripts/dpkg-ar.pl index 92cd8cf1a..fbedc31f6 100755 --- a/scripts/dpkg-ar.pl +++ b/scripts/dpkg-ar.pl @@ -29,12 +29,12 @@ textdomain('dpkg-dev'); my $action; -sub version() +sub version { printf(g_("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION); } -sub usage() +sub usage { printf(g_("Usage: %s [<option>...]\n"), $Dpkg::PROGNAME); diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index 11fb0bdbd..4f21cec75 100755 --- a/scripts/dpkg-architecture.pl +++ b/scripts/dpkg-architecture.pl @@ -179,7 +179,7 @@ my $req_variable_to_print; my $action = 'list'; my $force = 0; -sub action_needs($) { +sub action_needs { my $bits = shift; return (($req_info & $bits) == $bits); } diff --git a/scripts/dpkg-buildapi.pl b/scripts/dpkg-buildapi.pl index 2981eebb0..550d06941 100755 --- a/scripts/dpkg-buildapi.pl +++ b/scripts/dpkg-buildapi.pl @@ -28,12 +28,12 @@ use Dpkg::Control::Info; textdomain('dpkg-dev'); -sub version() +sub version { printf(g_("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION); } -sub usage() +sub usage { printf g_( 'Usage: %s [<option>...] [<command>]') diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl index 83d7e797b..d2b81e5a1 100755 --- a/scripts/dpkg-checkbuilddeps.pl +++ b/scripts/dpkg-checkbuilddeps.pl @@ -35,7 +35,7 @@ use Dpkg::Control::Info; textdomain('dpkg-dev'); -sub version() +sub version { printf g_("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; } diff --git a/scripts/dpkg-fsys-usrunmess.pl b/scripts/dpkg-fsys-usrunmess.pl index 25dc2597f..2e82772bf 100755 --- a/scripts/dpkg-fsys-usrunmess.pl +++ b/scripts/dpkg-fsys-usrunmess.pl @@ -597,7 +597,7 @@ sub prompt return 1; } -sub version() +sub version { printf "Debian %s version %s.\n", $PROGNAME, $PROGVERSION; } diff --git a/scripts/dpkg-mergechangelogs.pl b/scripts/dpkg-mergechangelogs.pl index f6d7879ae..460ea2b69 100755 --- a/scripts/dpkg-mergechangelogs.pl +++ b/scripts/dpkg-mergechangelogs.pl @@ -31,13 +31,6 @@ use Dpkg::Vendor qw(run_vendor_hook); textdomain('dpkg-dev'); -sub merge_entries($$$); -sub merge_block($$$;&); -sub merge_entry_item($$$$); -sub merge_conflict($$); -sub get_conflict_block($$); -sub join_lines($); - BEGIN { eval q{ use Algorithm::Merge qw(merge); @@ -214,7 +207,7 @@ sub compare_versions { # Merge changelog entries smartly by merging individually the different # parts constituting an entry -sub merge_entries($$$) { +sub merge_entries { my ($o, $a, $b) = @_; # NOTE: Only $o can be undef @@ -250,7 +243,7 @@ sub merge_entries($$$) { } } -sub join_lines($) { +sub join_lines { my $array = shift; return join("\n", @$array) if ref($array) eq 'ARRAY'; return $array; @@ -263,7 +256,7 @@ sub join_lines($) { # - - b => b # o a o => a # - a - => a -sub merge_block($$$;&) { +sub merge_block { my ($o, $a, $b, $preprocess) = @_; $preprocess //= \&join_lines; $o = $preprocess->($o) if defined $o; @@ -284,7 +277,7 @@ sub merge_block($$$;&) { return 1; } -sub merge_entry_item($$$$) { +sub merge_entry_item { my ($item, $o, $a, $b) = @_; if (blessed($o) and $o->isa('Dpkg::Changelog::Entry')) { $o = $o->get_part($item); @@ -304,13 +297,13 @@ sub merge_entry_item($$$$) { return merge_block($o, $a, $b); } -sub merge_conflict($$) { +sub merge_conflict { my ($a, $b) = @_; unshift @result, get_conflict_block($a, $b); $exitcode = 1; } -sub get_conflict_block($$) { +sub get_conflict_block { my ($a, $b) = @_; my (@a, @b); push @a, $a if defined $a; diff --git a/scripts/dpkg-name.pl b/scripts/dpkg-name.pl index 0d23ddd6a..07c12d1cc 100755 --- a/scripts/dpkg-name.pl +++ b/scripts/dpkg-name.pl @@ -43,12 +43,12 @@ my %options = ( architecture => 1, ); -sub version() +sub version { printf(g_("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION); } -sub usage() +sub usage { printf(g_("Usage: %s [<option>...] <file>...\n"), $Dpkg::PROGNAME); @@ -67,7 +67,7 @@ according to the 'underscores convention'. ")); } -sub fileexists($) +sub fileexists { my $filename = shift; @@ -79,7 +79,7 @@ sub fileexists($) } } -sub filesame($$) +sub filesame { my ($a, $b) = @_; my @sta = stat($a); @@ -89,7 +89,7 @@ sub filesame($$) return (@sta and @stb and $sta[0] == $stb[0] and $sta[1] == $stb[1]); } -sub getfields($) +sub getfields { my $filename = shift; @@ -103,7 +103,7 @@ sub getfields($) return $fields; } -sub getarch($$) +sub getarch { my ($filename, $fields) = @_; @@ -116,7 +116,7 @@ sub getarch($$) return $arch; } -sub getname($$$) +sub getname { my ($filename, $fields, $arch) = @_; @@ -138,7 +138,7 @@ sub getname($$$) return $name; } -sub getdir($$$) +sub getdir { my ($filename, $fields, $arch) = @_; my $dir; @@ -165,7 +165,7 @@ sub getdir($$$) return $dir; } -sub move($) +sub move { my $filename = shift; -- Dpkg.Org's dpkg

