empty dependency fields are correctly handled.
* scripts/Makefile.am: Include the new data files required by the
tests above.
+ * scrips/Dpkg/Fields.pm: New module containing 3 functions moved
+ out of controllib.pl (capit(), set_field_importance(),
+ sort_by_field_importance()).
+ * scripts/controllib.pl: Removed the 3 functions above.
+ * scripts/dpkg-shlibdeps.pl: Use Dpkg::Fields for capit().
+ * scripts/dpkg-genchanges.pl: Use Dpkg::Fields for capit() and
+ set_field_importance().
+ * scripts/dpkg-gencontrol.pl: Likewise.
+ * scripts/dpkg-source.pl: Likewise.
2007-11-20 Guillem Jover <guillem@debian.org>
[ Raphael Hertzog ]
* dpkg-shlibdeps now correctly identify private libraries (avoid many
warnings with perl/python modules).
+ * Move capit() to a Dpkg::Fields module and use it in dpkg-shlibdeps.
+ Closes: #452262
[ Updated man pages translations ]
* Swedish (Peter Karlsson)
usr/share/perl5/Dpkg/BuildOptions.pm
usr/share/perl5/Dpkg/ErrorHandling.pm
usr/share/perl5/Dpkg/Deps.pm
+usr/share/perl5/Dpkg/Fields.pm
usr/share/perl5/Dpkg/Path.pm
usr/share/perl5/Dpkg/Shlibs
usr/share/perl5/Dpkg/Shlibs.pm
--- /dev/null
+package Dpkg::Fields;
+
+use strict;
+use warnings;
+
+use Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(capit set_field_importance sort_field_by_importance);
+
+sub capit {
+ my @pieces = map { ucfirst(lc) } split /-/, $_[0];
+ return join '-', @pieces;
+}
+
+our %fieldimps;
+
+sub set_field_importance(@)
+{
+ my @fields = @_;
+ my $i = 1;
+
+ grep($fieldimps{$_} = $i++, @fields);
+}
+
+sub sort_field_by_importance($$)
+{
+ my ($a, $b) = @_;
+
+ if (defined $fieldimps{$a} && defined $fieldimps{$b}) {
+ $fieldimps{$a} <=> $fieldimps{$b};
+ } elsif (defined($fieldimps{$a})) {
+ -1;
+ } elsif (defined($fieldimps{$b})) {
+ 1;
+ } else {
+ $a cmp $b;
+ }
+}
+
+1;
Dpkg/BuildOptions.pm \
Dpkg/ErrorHandling.pm \
Dpkg/Deps.pm \
+ Dpkg/Fields.pm \
Dpkg/Gettext.pm \
Dpkg/Path.pm \
Dpkg/Shlibs.pm \
use Dpkg;
use Dpkg::Gettext;
use Dpkg::ErrorHandling qw(error internerr usageerr);
+use Dpkg::Fields qw(set_field_importance);
push(@INC,$dpkglibdir);
require 'controllib.pl';
use Dpkg::Gettext;
use Dpkg::ErrorHandling qw(warning error failure internerr syserr subprocerr);
use Dpkg::Arch qw(get_host_arch debarch_is);
+use Dpkg::Fields qw(capit sort_field_by_importance);
textdomain("dpkg-dev");
return @fowner;
}
-sub capit {
- my @pieces = map { ucfirst(lc) } split /-/, $_[0];
- return join '-', @pieces;
-}
-
sub substvars {
my ($v) = @_;
my $lhs;
return $v;
}
-my %fieldimps;
-
-sub set_field_importance(@)
-{
- my @fields = @_;
- my $i = 1;
-
- grep($fieldimps{$_} = $i++, @fields);
-}
-
-sub sort_field_by_importance($$)
-{
- my ($a, $b) = @_;
-
- if (defined $fieldimps{$a} && defined $fieldimps{$b}) {
- $fieldimps{$a} <=> $fieldimps{$b};
- } elsif (defined($fieldimps{$a})) {
- -1;
- } elsif (defined($fieldimps{$b})) {
- 1;
- } else {
- $a cmp $b;
- }
-}
-
sub outputclose {
my ($varlistfile) = @_;
use Dpkg::ErrorHandling qw(warning error failure unknown internerr syserr
subprocerr usageerr);
use Dpkg::Arch qw(get_host_arch debarch_eq debarch_is);
+use Dpkg::Fields qw(capit set_field_importance sort_field_by_importance);
push(@INC,$dpkglibdir);
require 'controllib.pl';
subprocerr usageerr);
use Dpkg::Arch qw(get_host_arch debarch_eq debarch_is);
use Dpkg::Deps qw(@pkg_dep_fields %dep_field_type);
+use Dpkg::Fields qw(capit set_field_importance);
push(@INC,$dpkglibdir);
require 'controllib.pl';
use Dpkg::Shlibs::Objdump;
use Dpkg::Shlibs::SymbolFile;
use Dpkg::Arch qw(get_host_arch);
+use Dpkg::Fields qw(capit);
our $host_arch= get_host_arch();
$warnable_error $quiet_warnings);
use Dpkg::Arch qw(debarch_eq);
use Dpkg::Deps qw(@src_dep_fields %dep_field_type);
+use Dpkg::Fields qw(capit set_field_importance);
my @filesinarchive;
my %dirincluded;