From 0e894ddaa68792246bd03a5dcf3f2e56fd2aeb74 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 27 Oct 2017 22:06:58 +0200 Subject: Dpkg::Vendor::Debian: Use proper use_feature key We need to access the features within the feature area hash now. Missed in a previous refactoring. Fixes: commit 2125e8dd7388e2adb9b6c837f4832fe8f0f63b25 Reported-by: Mattia Rizzolo (on IRC) Closes: #881051 --- scripts/Dpkg/Vendor/Debian.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm index e0fd01113..980597b5c 100644 --- a/scripts/Dpkg/Vendor/Debian.pm +++ b/scripts/Dpkg/Vendor/Debian.pm @@ -204,7 +204,7 @@ sub _add_build_flags { # so that we do not need to worry about escaping the characters # on output. if ($build_path =~ m/[^-+:.0-9a-zA-Z~\/_]/) { - $use_feature{fixdebugpath} = 0; + $use_feature{reproducible}{fixdebugpath} = 0; } } -- cgit v1.2.3 From fe186374cd2a287723fe227fe37ea4a5373822c0 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Mon, 4 Dec 2017 15:12:50 +0800 Subject: Dpkg::Changelog: Print versions for incorrect changelog range warnings Within scripts operating on lots of different package changelogs, this can help track down where these warnings come from. Signed-off-by: Guillem Jover --- debian/changelog | 2 ++ scripts/Dpkg/Changelog.pm | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index cc537f866..8ed5546f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::Vendor::Debian: Use proper %use_feature key. This was causing perl errors on paths not accapted for fixdebugpath. Reported by Mattia Rizzolo , on IRC. Closes: #881051 + - Dpkg::Changelog: Print versions for incorrect changelog range warnings. + Thanks to Paul Wise . * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Changelog.pm b/scripts/Dpkg/Changelog.pm index db8e3eb09..35e48ef02 100644 --- a/scripts/Dpkg/Changelog.pm +++ b/scripts/Dpkg/Changelog.pm @@ -254,7 +254,7 @@ sub __sanity_check_range { push @versions, $version->as_string(); } if ((defined($r->{since}) and not exists $versions{$r->{since}})) { - warning(g_("'%s' option specifies non-existing version"), 'since'); + warning(g_("'%s' option specifies non-existing version '%s'"), 'since', $r->{since}); warning(g_('use newest entry that is earlier than the one specified')); foreach my $v (@versions) { if (version_compare_relation($v, REL_LT, $r->{since})) { @@ -270,7 +270,7 @@ sub __sanity_check_range { } } if ((defined($r->{from}) and not exists $versions{$r->{from}})) { - warning(g_("'%s' option specifies non-existing version"), 'from'); + warning(g_("'%s' option specifies non-existing version '%s'"), 'from', $r->{from}); warning(g_('use oldest entry that is later than the one specified')); my $oldest; foreach my $v (@versions) { @@ -281,12 +281,12 @@ sub __sanity_check_range { if (defined($oldest)) { $r->{from} = $oldest; } else { - warning(g_("no such entry found, ignoring '%s' parameter"), 'from'); + warning(g_("no such entry found, ignoring '%s' parameter '%s'"), 'from', $r->{from}); delete $r->{from}; # No version was oldest } } if (defined($r->{until}) and not exists $versions{$r->{until}}) { - warning(g_("'%s' option specifies non-existing version"), 'until'); + warning(g_("'%s' option specifies non-existing version '%s'"), 'until', $r->{until}); warning(g_('use oldest entry that is later than the one specified')); my $oldest; foreach my $v (@versions) { @@ -297,12 +297,12 @@ sub __sanity_check_range { if (defined($oldest)) { $r->{until} = $oldest; } else { - warning(g_("no such entry found, ignoring '%s' parameter"), 'until'); + warning(g_("no such entry found, ignoring '%s' parameter '%s'"), 'until', $r->{until}); delete $r->{until}; # No version was oldest } } if (defined($r->{to}) and not exists $versions{$r->{to}}) { - warning(g_("'%s' option specifies non-existing version"), 'to'); + warning(g_("'%s' option specifies non-existing version '%s'"), 'to', $r->{to}); warning(g_('use newest entry that is earlier than the one specified')); foreach my $v (@versions) { if (version_compare_relation($v, REL_LT, $r->{to})) { @@ -312,17 +312,17 @@ sub __sanity_check_range { } if (not exists $versions{$r->{to}}) { # No version was earlier - warning(g_("no such entry found, ignoring '%s' parameter"), 'to'); + warning(g_("no such entry found, ignoring '%s' parameter '%s'"), 'to', $r->{to}); delete $r->{to}; } } if (defined($r->{since}) and $data->[0]->get_version() eq $r->{since}) { - warning(g_("'since' option specifies most recent version, ignoring")); + warning(g_("'since' option specifies most recent version '%s', ignoring"), $r->{since}); delete $r->{since}; } if (defined($r->{until}) and $data->[-1]->get_version() eq $r->{until}) { - warning(g_("'until' option specifies oldest version, ignoring")); + warning(g_("'until' option specifies oldest version '%s', ignoring"), $r->{until}); delete $r->{until}; } ## use critic -- cgit v1.2.3 From d6ba39af48a8c8eadc1b1542fcd6db0edf2dbe7f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 29 Oct 2017 18:18:39 +0100 Subject: test: Consider *.PL also to be perl files --- debian/changelog | 1 + scripts/Test/Dpkg.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 85921f820..96cb3175a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -49,6 +49,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium * Test suite: - Skip Dpkg::OpenPGP test if gpg is not present. - Check POD in all perl scripts. + - Consider *.PL also to be perl files. [ Updated programs translations ] * Dutch (Frans Spiesschaert). Closes: #881401 diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm index 1b1a5d67e..f0a73f8af 100644 --- a/scripts/Test/Dpkg.pm +++ b/scripts/Test/Dpkg.pm @@ -65,7 +65,7 @@ sub test_get_perl_dirs sub all_perl_files { - my $filter = shift // qr/\.(?:pl|pm|t)$/; + my $filter = shift // qr/\.(?:PL|pl|pm|t)$/; my @files; my $scan_perl_files = sub { push @files, $File::Find::name if m/$filter/; -- cgit v1.2.3 From 33c866433dd4b186aae970e05c639b52ad5e7ece Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 29 Oct 2017 18:40:54 +0100 Subject: test: Infer automatically the unit test data directory We can easily know the name of the calling unit test, and can thus infer the pathname for the data directory, instead of having to duplicate the name, and potentially ending with it being out of sync. --- debian/changelog | 1 + scripts/Test/Dpkg.pm | 18 ++++++++++++++++-- scripts/t/Dpkg_Changelog.t | 2 +- scripts/t/Dpkg_Checksums.t | 2 +- scripts/t/Dpkg_Conf.t | 2 +- scripts/t/Dpkg_Control.t | 2 +- scripts/t/Dpkg_Control_Fields.t | 2 +- scripts/t/Dpkg_Control_Tests.t | 2 +- scripts/t/Dpkg_Dist_Files.t | 2 +- scripts/t/Dpkg_OpenPGP.t | 2 +- scripts/t/Dpkg_Shlibs.t | 2 +- scripts/t/Dpkg_Source_Patch.t | 2 +- scripts/t/Dpkg_Source_Quilt.t | 2 +- scripts/t/Dpkg_Substvars.t | 2 +- scripts/t/mk.t | 4 +++- 15 files changed, 32 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 96cb3175a..761acad10 100644 --- a/debian/changelog +++ b/debian/changelog @@ -50,6 +50,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Skip Dpkg::OpenPGP test if gpg is not present. - Check POD in all perl scripts. - Consider *.PL also to be perl files. + - Infer automatically the unit test data directory. [ Updated programs translations ] * Dutch (Frans Spiesschaert). Closes: #881401 diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm index f0a73f8af..2a3fec219 100644 --- a/scripts/Test/Dpkg.pm +++ b/scripts/Test/Dpkg.pm @@ -50,12 +50,26 @@ use File::Find; use IPC::Cmd qw(can_run); use Test::More; +sub _test_get_caller_dir +{ + my (undef, $path, undef) = caller 1; + + $path =~ s{\.t$}{}; + $path =~ s{^\./}{}; + + return $path; +} + sub test_get_data_path { my $path = shift; - my $srcdir = $ENV{srcdir} || '.'; - return "$srcdir/$path"; + if (defined $path) { + my $srcdir = $ENV{srcdir} || '.'; + return "$srcdir/$path"; + } else { + return _test_get_caller_dir(); + } } sub test_get_perl_dirs diff --git a/scripts/t/Dpkg_Changelog.t b/scripts/t/Dpkg_Changelog.t index 1ca238acd..ed9f8a965 100644 --- a/scripts/t/Dpkg_Changelog.t +++ b/scripts/t/Dpkg_Changelog.t @@ -29,7 +29,7 @@ BEGIN { use_ok('Dpkg::Vendor', qw(get_current_vendor)); }; -my $datadir = test_get_data_path('t/Dpkg_Changelog'); +my $datadir = test_get_data_path(); my $vendor = get_current_vendor(); diff --git a/scripts/t/Dpkg_Checksums.t b/scripts/t/Dpkg_Checksums.t index e549e640e..82a45fe31 100644 --- a/scripts/t/Dpkg_Checksums.t +++ b/scripts/t/Dpkg_Checksums.t @@ -23,7 +23,7 @@ BEGIN { use_ok('Dpkg::Checksums'); } -my $datadir = test_get_data_path('t/Dpkg_Checksums'); +my $datadir = test_get_data_path(); my @data = ( { diff --git a/scripts/t/Dpkg_Conf.t b/scripts/t/Dpkg_Conf.t index 2e55e3d59..940d18dd7 100644 --- a/scripts/t/Dpkg_Conf.t +++ b/scripts/t/Dpkg_Conf.t @@ -23,7 +23,7 @@ BEGIN { use_ok('Dpkg::Conf'); } -my $datadir = test_get_data_path('t/Dpkg_Conf'); +my $datadir = test_get_data_path(); my ($conf, $count, @opts); diff --git a/scripts/t/Dpkg_Control.t b/scripts/t/Dpkg_Control.t index 0f808fbdc..057cb21b6 100644 --- a/scripts/t/Dpkg_Control.t +++ b/scripts/t/Dpkg_Control.t @@ -26,7 +26,7 @@ BEGIN { use_ok('Dpkg::Control::Info'); } -my $datadir = test_get_data_path('t/Dpkg_Control'); +my $datadir = test_get_data_path(); sub parse_dsc { my $path = shift; diff --git a/scripts/t/Dpkg_Control_Fields.t b/scripts/t/Dpkg_Control_Fields.t index 7a6582287..c83efed96 100644 --- a/scripts/t/Dpkg_Control_Fields.t +++ b/scripts/t/Dpkg_Control_Fields.t @@ -26,7 +26,7 @@ BEGIN { use_ok('Dpkg::Control::FieldsCore'); } -#my $datadir = test_get_data_path('t/Dpkg_Control_Fields'); +#my $datadir = test_get_data_path(); my @src_dep_fields = qw( Build-Depends Build-Depends-Arch Build-Depends-Indep diff --git a/scripts/t/Dpkg_Control_Tests.t b/scripts/t/Dpkg_Control_Tests.t index 9c14a2e4e..27042dcfc 100644 --- a/scripts/t/Dpkg_Control_Tests.t +++ b/scripts/t/Dpkg_Control_Tests.t @@ -23,7 +23,7 @@ BEGIN { use_ok('Dpkg::Control::Tests'); } -my $datadir = test_get_data_path('t/Dpkg_Control_Tests'); +my $datadir = test_get_data_path(); sub parse_tests { my $path = shift; diff --git a/scripts/t/Dpkg_Dist_Files.t b/scripts/t/Dpkg_Dist_Files.t index b29973d38..44d42d058 100644 --- a/scripts/t/Dpkg_Dist_Files.t +++ b/scripts/t/Dpkg_Dist_Files.t @@ -21,7 +21,7 @@ use Test::Dpkg qw(:paths); use_ok('Dpkg::Dist::Files'); -my $datadir = test_get_data_path('t/Dpkg_Dist_Files'); +my $datadir = test_get_data_path(); my $expected; my %expected = ( diff --git a/scripts/t/Dpkg_OpenPGP.t b/scripts/t/Dpkg_OpenPGP.t index 84b8401f3..0d2e4afef 100644 --- a/scripts/t/Dpkg_OpenPGP.t +++ b/scripts/t/Dpkg_OpenPGP.t @@ -31,7 +31,7 @@ use_ok('Dpkg::OpenPGP'); report_options(quiet_warnings => 1); -my $datadir = test_get_data_path('t/Dpkg_OpenPGP'); +my $datadir = test_get_data_path(); my $tmpdir = 't.tmp/Dpkg_OpenPGP'; mkdir $tmpdir; diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t index 39163d75b..2310f4f1c 100644 --- a/scripts/t/Dpkg_Shlibs.t +++ b/scripts/t/Dpkg_Shlibs.t @@ -31,7 +31,7 @@ my $tmp; my @tmp; my %tmp; -my $datadir = test_get_data_path('t/Dpkg_Shlibs'); +my $datadir = test_get_data_path(); my @librarypaths; diff --git a/scripts/t/Dpkg_Source_Patch.t b/scripts/t/Dpkg_Source_Patch.t index d81a1a39d..d0e167dbd 100644 --- a/scripts/t/Dpkg_Source_Patch.t +++ b/scripts/t/Dpkg_Source_Patch.t @@ -25,7 +25,7 @@ BEGIN { use_ok('Dpkg::Source::Patch'); } -my $datadir = test_get_data_path('t/Dpkg_Source_Patch'); +my $datadir = test_get_data_path(); my $tmpdir = 't.tmp/Dpkg_Source_Patch'; sub test_patch_escape { diff --git a/scripts/t/Dpkg_Source_Quilt.t b/scripts/t/Dpkg_Source_Quilt.t index af0071dea..96c3be04d 100644 --- a/scripts/t/Dpkg_Source_Quilt.t +++ b/scripts/t/Dpkg_Source_Quilt.t @@ -23,7 +23,7 @@ BEGIN { use_ok('Dpkg::Source::Quilt'); } -my $datadir = test_get_data_path('t/Dpkg_Source_Quilt'); +my $datadir = test_get_data_path(); my $quilt; my (@series_got, @series_exp); diff --git a/scripts/t/Dpkg_Substvars.t b/scripts/t/Dpkg_Substvars.t index ded25ddc8..bb8e14039 100644 --- a/scripts/t/Dpkg_Substvars.t +++ b/scripts/t/Dpkg_Substvars.t @@ -24,7 +24,7 @@ use Dpkg::Arch qw(get_host_arch); use_ok('Dpkg::Substvars'); -my $datadir = test_get_data_path('t/Dpkg_Substvars'); +my $datadir = test_get_data_path(); my $expected; diff --git a/scripts/t/mk.t b/scripts/t/mk.t index e711270c7..7eaf40cc8 100644 --- a/scripts/t/mk.t +++ b/scripts/t/mk.t @@ -17,6 +17,8 @@ use strict; use warnings; use Test::More tests => 6; +use Test::Dpkg qw(:paths); + use File::Spec::Functions qw(rel2abs); use Dpkg (); @@ -25,7 +27,7 @@ use Dpkg::IPC; use Dpkg::Vendor; my $srcdir = $ENV{srcdir} || '.'; -my $datadir = "$srcdir/t/mk"; +my $datadir = test_get_data_path(); # Turn these into absolute names so that we can safely switch to the test # directory with «make -C». -- cgit v1.2.3 From 876855ff96f6dd72cbb92fa57bc316576f585737 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 29 Oct 2017 18:40:54 +0100 Subject: test: Infer automatically the unit test temp directory Add new test_get_temp_path() function, and replace all hardcoded settings of the temporary directory and its creation. --- debian/changelog | 1 + scripts/Test/Dpkg.pm | 13 +++++++++++++ scripts/t/Dpkg_Compression.t | 4 ++-- scripts/t/Dpkg_OpenPGP.t | 4 +--- scripts/t/Dpkg_Path.t | 4 ++-- scripts/t/Dpkg_Source_Patch.t | 2 +- scripts/t/dpkg_buildpackage.t | 6 ++---- scripts/t/dpkg_source.t | 6 ++---- 8 files changed, 24 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 761acad10..813b17053 100644 --- a/debian/changelog +++ b/debian/changelog @@ -51,6 +51,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Check POD in all perl scripts. - Consider *.PL also to be perl files. - Infer automatically the unit test data directory. + - Infer automatically the unit test temp directory. [ Updated programs translations ] * Dutch (Frans Spiesschaert). Closes: #881401 diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm index 2a3fec219..5eea6184a 100644 --- a/scripts/Test/Dpkg.pm +++ b/scripts/Test/Dpkg.pm @@ -24,6 +24,7 @@ our @EXPORT_OK = qw( all_perl_modules test_get_perl_dirs test_get_data_path + test_get_temp_path test_needs_author test_needs_module test_needs_command @@ -42,11 +43,14 @@ our %EXPORT_TAGS = ( all_perl_modules test_get_perl_dirs test_get_data_path + test_get_temp_path ) ], ); use Exporter qw(import); use File::Find; +use File::Basename; +use File::Path qw(make_path); use IPC::Cmd qw(can_run); use Test::More; @@ -72,6 +76,15 @@ sub test_get_data_path } } +sub test_get_temp_path +{ + my $path = shift // _test_get_caller_dir(); + $path = 't.tmp/' . fileparse($path); + + make_path($path); + return $path; +} + sub test_get_perl_dirs { return qw(t src/t lib utils/t scripts dselect); diff --git a/scripts/t/Dpkg_Compression.t b/scripts/t/Dpkg_Compression.t index 3a2be1107..3babe5fca 100644 --- a/scripts/t/Dpkg_Compression.t +++ b/scripts/t/Dpkg_Compression.t @@ -17,12 +17,12 @@ use strict; use warnings; use Test::More tests => 13; +use Test::Dpkg qw(:paths); use_ok('Dpkg::Compression'); use_ok('Dpkg::Compression::FileHandle'); -my $tmpdir = 't.tmp/Dpkg_Compression'; -mkdir $tmpdir; +my $tmpdir = test_get_temp_path(); my @lines = ("One\n", "Two\n", "Three\n"); my $fh; diff --git a/scripts/t/Dpkg_OpenPGP.t b/scripts/t/Dpkg_OpenPGP.t index 0d2e4afef..b39613149 100644 --- a/scripts/t/Dpkg_OpenPGP.t +++ b/scripts/t/Dpkg_OpenPGP.t @@ -32,9 +32,7 @@ use_ok('Dpkg::OpenPGP'); report_options(quiet_warnings => 1); my $datadir = test_get_data_path(); -my $tmpdir = 't.tmp/Dpkg_OpenPGP'; - -mkdir $tmpdir; +my $tmpdir = test_get_temp_path(); openpgp_sig_to_asc("$datadir/package_1.0.orig.tar.sig", "$tmpdir/package_1.0.orig.tar.sig2asc"); diff --git a/scripts/t/Dpkg_Path.t b/scripts/t/Dpkg_Path.t index deb63bab7..fbf883d64 100644 --- a/scripts/t/Dpkg_Path.t +++ b/scripts/t/Dpkg_Path.t @@ -17,14 +17,14 @@ use strict; use warnings; use Test::More tests => 16; +use Test::Dpkg qw(:paths); use_ok('Dpkg::Path', 'canonpath', 'resolve_symlink', 'check_files_are_the_same', 'get_pkg_root_dir', 'guess_pkg_root_dir', 'relative_to_pkg_root'); -my $tmpdir = 't.tmp/Dpkg_Path'; +my $tmpdir = test_get_temp_path(); -mkdir $tmpdir; mkdir "$tmpdir/a"; mkdir "$tmpdir/a/b"; mkdir "$tmpdir/a/b/c"; diff --git a/scripts/t/Dpkg_Source_Patch.t b/scripts/t/Dpkg_Source_Patch.t index d0e167dbd..f50f15be2 100644 --- a/scripts/t/Dpkg_Source_Patch.t +++ b/scripts/t/Dpkg_Source_Patch.t @@ -26,7 +26,7 @@ BEGIN { } my $datadir = test_get_data_path(); -my $tmpdir = 't.tmp/Dpkg_Source_Patch'; +my $tmpdir = test_get_temp_path(); sub test_patch_escape { my ($name, $symlink, $patchname, $desc) = @_; diff --git a/scripts/t/dpkg_buildpackage.t b/scripts/t/dpkg_buildpackage.t index 2b4345539..dd4f67a6f 100644 --- a/scripts/t/dpkg_buildpackage.t +++ b/scripts/t/dpkg_buildpackage.t @@ -17,7 +17,7 @@ use strict; use warnings; use Test::More; -use Test::Dpkg qw(:needs test_neutralize_checksums); +use Test::Dpkg qw(:needs :paths test_neutralize_checksums); use File::Spec::Functions qw(rel2abs); use File::Compare; @@ -34,7 +34,7 @@ plan tests => 12; my $srcdir = rel2abs($ENV{srcdir} || '.'); my $datadir = "$srcdir/t/dpkg_buildpackage"; -my $tmpdir = 't.tmp/dpkg_buildpackage'; +my $tmpdir = test_get_temp_path(); $ENV{$_} = rel2abs($ENV{$_}) foreach qw(DPKG_DATADIR DPKG_ORIGINS_DIR); @@ -48,8 +48,6 @@ delete $ENV{SOURCE_DATE_EPOCH}; # Delete other variables that can affect the tests. delete $ENV{$_} foreach grep { m/^DEB_/ } keys %ENV; -make_path($tmpdir); - chdir $tmpdir; my $tmpl_format = <<'TMPL_FORMAT'; diff --git a/scripts/t/dpkg_source.t b/scripts/t/dpkg_source.t index cdbedceb3..a0c343846 100644 --- a/scripts/t/dpkg_source.t +++ b/scripts/t/dpkg_source.t @@ -17,7 +17,7 @@ use strict; use warnings; use Test::More tests => 8; -use Test::Dpkg qw(test_neutralize_checksums); +use Test::Dpkg qw(:paths test_neutralize_checksums); use File::Spec::Functions qw(rel2abs); use File::Compare; @@ -28,15 +28,13 @@ use Dpkg::Substvars; my $srcdir = rel2abs($ENV{srcdir} || '.'); my $datadir = "$srcdir/t/dpkg_source"; -my $tmpdir = 't.tmp/dpkg_source'; +my $tmpdir = test_get_temp_path(); $ENV{$_} = rel2abs($ENV{$_}) foreach qw(DPKG_DATADIR DPKG_ORIGINS_DIR); # Delete variables that can affect the tests. delete $ENV{SOURCE_DATE_EPOCH}; -make_path($tmpdir); - chdir $tmpdir; my $tmpl_format = <<'TMPL_FORMAT'; -- cgit v1.2.3 From b29058ea75ce28f95b373b0c36deffd4b57d466b Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sun, 3 Dec 2017 03:37:23 +0100 Subject: Dpkg::Shlibs::SymbolFile: Check that $state->{seen} exists instead of $state being defined Fixes: commit 0d2b3cee25b74dd3fd9ddc3a469b8b144368c963 Closes: #880166 Signed-off-by: Guillem Jover --- debian/changelog | 3 +++ scripts/Dpkg/Shlibs/SymbolFile.pm | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 813b17053..820135a0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,9 @@ dpkg (1.19.1) UNRELEASED; urgency=medium Reported by Mattia Rizzolo , on IRC. Closes: #881051 - Dpkg::Changelog: Print versions for incorrect changelog range warnings. Thanks to Paul Wise . + - Check that $state->{seen} exists instead of $state being just defined. + Fixes regression in dpkg-gensymbols symbols output. + Thanks to Dmitry Shachnev . Closes: #880166 * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm index d03ce2598..b36d542ce 100644 --- a/scripts/Dpkg/Shlibs/SymbolFile.pm +++ b/scripts/Dpkg/Shlibs/SymbolFile.pm @@ -204,7 +204,7 @@ sub parse { my ($self, $fh, $file, %opts) = @_; my $state = $opts{state} //= {}; - if (defined $state) { + if (exists $state->{seen}) { return if exists $state->{seen}{$file}; # Avoid include loops } else { $self->{file} = $file; -- cgit v1.2.3 From 797ed78bd87c77b6fa9c3867d0fefa90bb21014c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 5 Dec 2017 01:56:15 +0100 Subject: scripts/mk: Add new buildtools variables This adds support for AS, STRIP, OBJCOPY, OBJDUMP, NM, AR and RANLIB. Prompted-by: Helmut Grohne --- debian/changelog | 2 ++ scripts/mk/buildtools.mk | 14 ++++++++++++++ scripts/t/mk.t | 7 +++++++ scripts/t/mk/buildtools.mk | 14 ++++++++++++++ 4 files changed, 37 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 820135a0f..9b6533fc9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium * Fix directory traversal with dpkg-deb --raw-extract, by guaranteeing that the DEBIAN pathname does not exist. Closes: #879982 Reported by Jakub Wilk . + * Add new AS, STRIP, OBJCOPY, OBJDUMP, NM, AR and RANLIB buildtools + variables to buildtools.mk. Prompted by Helmut Grohne . * Perl modules: - Check that $tarname is defined before use in Dpkg::Source::Package::V1. Thanks to Christoph Biedl . diff --git a/scripts/mk/buildtools.mk b/scripts/mk/buildtools.mk index d5638f50e..c3b44bb8a 100644 --- a/scripts/mk/buildtools.mk +++ b/scripts/mk/buildtools.mk @@ -1,5 +1,6 @@ # This Makefile snippet defines the following variables for host tools: # +# AS: assembler # CPP: C preprocessor # CC: C compiler # CXX: C++ compiler @@ -9,6 +10,12 @@ # F77: Fortran 77 compiler # FC: Fortran 9x compiler # LD: linker +# STRIP: strip objects +# OBJCOPY: copy objects +# OBJDUMP: dump objects +# NM: names lister +# AR: archiver +# RANLIB: archive index generator # PKG_CONFIG: pkg-config tool # # All the above variables have a counterpart variable for the build tool, @@ -44,6 +51,7 @@ export $(1)_FOR_BUILD endif endef +$(eval $(call dpkg_buildtool_setvar,AS,as)) $(eval $(call dpkg_buildtool_setvar,CPP,gcc -E)) $(eval $(call dpkg_buildtool_setvar,CC,gcc)) $(eval $(call dpkg_buildtool_setvar,CXX,g++)) @@ -53,4 +61,10 @@ $(eval $(call dpkg_buildtool_setvar,GCJ,gcj)) $(eval $(call dpkg_buildtool_setvar,F77,f77)) $(eval $(call dpkg_buildtool_setvar,FC,f77)) $(eval $(call dpkg_buildtool_setvar,LD,ld)) +$(eval $(call dpkg_buildtool_setvar,STRIP,strip)) +$(eval $(call dpkg_buildtool_setvar,OBJCOPY,objcopy)) +$(eval $(call dpkg_buildtool_setvar,OBJDUMP,objdump)) +$(eval $(call dpkg_buildtool_setvar,NM,nm)) +$(eval $(call dpkg_buildtool_setvar,AR,ar)) +$(eval $(call dpkg_buildtool_setvar,RANLIB,ranlib)) $(eval $(call dpkg_buildtool_setvar,PKG_CONFIG,pkg-config)) diff --git a/scripts/t/mk.t b/scripts/t/mk.t index 7eaf40cc8..0062e993c 100644 --- a/scripts/t/mk.t +++ b/scripts/t/mk.t @@ -82,6 +82,7 @@ $ENV{"TEST_$_"} = $buildflag{$_} foreach keys %buildflag; test_makefile('buildflags.mk'); my %buildtools = ( + AS => 'as', CPP => 'gcc -E', CC => 'gcc', CXX => 'g++', @@ -91,6 +92,12 @@ my %buildtools = ( F77 => 'f77', FC => 'f77', LD => 'ld', + STRIP => 'strip', + OBJCOPY => 'objcopy', + OBJDUMP => 'objdump', + NM => 'nm', + AR => 'ar', + RANLIB => 'ranlib', PKG_CONFIG => 'pkg-config', ); diff --git a/scripts/t/mk/buildtools.mk b/scripts/t/mk/buildtools.mk index 8bba96430..0077791b5 100644 --- a/scripts/t/mk/buildtools.mk +++ b/scripts/t/mk/buildtools.mk @@ -1,6 +1,8 @@ include $(srcdir)/mk/buildtools.mk test: + test "$(AS)" = "$(TEST_AS)" + test "$(AS_FOR_BUILD)" = "$(TEST_AS_FOR_BUILD)" test "$(CC)" = "$(TEST_CC)" test "$(CC_FOR_BUILD)" = "$(TEST_CC_FOR_BUILD)" test "$(CXX)" = "$(TEST_CXX)" @@ -17,5 +19,17 @@ test: test "$(FC_FOR_BUILD)" = "$(TEST_FC_FOR_BUILD)" test "$(LD)" = "$(TEST_LD)" test "$(LD_FOR_BUILD)" = "$(TEST_LD_FOR_BUILD)" + test "$(STRIP)" = "$(TEST_STRIP)" + test "$(STRIP_FOR_BUILD)" = "$(TEST_STRIP_FOR_BUILD)" + test "$(OBJCOPY)" = "$(TEST_OBJCOPY)" + test "$(OBJCOPY_FOR_BUILD)" = "$(TEST_OBJCOPY_FOR_BUILD)" + test "$(OBJDUMP)" = "$(TEST_OBJDUMP)" + test "$(OBJDUMP_FOR_BUILD)" = "$(TEST_OBJDUMP_FOR_BUILD)" + test "$(NM)" = "$(TEST_NM)" + test "$(NM_FOR_BUILD)" = "$(TEST_NM_FOR_BUILD)" + test "$(AR)" = "$(TEST_AR)" + test "$(AR_FOR_BUILD)" = "$(TEST_AR_FOR_BUILD)" + test "$(RANLIB)" = "$(TEST_RANLIB)" + test "$(RANLIB_FOR_BUILD)" = "$(TEST_RANLIB_FOR_BUILD)" test "$(PKG_CONFIG)" = "$(TEST_PKG_CONFIG)" test "$(PKG_CONFIG_FOR_BUILD)" = "$(TEST_PKG_CONFIG_FOR_BUILD)" -- cgit v1.2.3 From 2f5816d8be40b449d2473b22f9e0c33b32f3bd78 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 10 Dec 2017 12:07:42 +0100 Subject: scripts: Reject negated values in Architecture field Add new positive options argument to arch validators, as the Architecture field should not accept negated architectures. We preserve the current functions default behavior and add a new option to control whether to reject negated architectures. Fixes: commit d355b340f3a6cde7fc1cb5649d82fbebd3b97ea1 Stable-Candidate: 1.18.x --- debian/changelog | 3 +++ scripts/Dpkg/Arch.pm | 28 ++++++++++++++++++++++------ scripts/dpkg-genchanges.pl | 4 ++-- scripts/dpkg-gencontrol.pl | 2 +- scripts/t/Dpkg_Arch.t | 9 ++++++++- 5 files changed, 36 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 9b6533fc9..2d4f616f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium Reported by Jakub Wilk . * Add new AS, STRIP, OBJCOPY, OBJDUMP, NM, AR and RANLIB buildtools variables to buildtools.mk. Prompted by Helmut Grohne . + * Restore rejecting negated architectures in Architecture field in + dpkg-gencontrol and dpkg-genchanges. Regression introduced in dpkg 1.18.5. * Perl modules: - Check that $tarname is defined before use in Dpkg::Source::Package::V1. Thanks to Christoph Biedl . @@ -30,6 +32,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Check that $state->{seen} exists instead of $state being just defined. Fixes regression in dpkg-gensymbols symbols output. Thanks to Dmitry Shachnev . Closes: #880166 + - Add new positive options argument to arch validators in Dpkg::Arch. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm index c3e891526..14709d6cc 100644 --- a/scripts/Dpkg/Arch.pm +++ b/scripts/Dpkg/Arch.pm @@ -36,7 +36,7 @@ use strict; use warnings; use feature qw(state); -our $VERSION = '1.02'; +our $VERSION = '1.03'; our @EXPORT_OK = qw( get_raw_build_arch get_raw_host_arch @@ -599,17 +599,25 @@ sub debarch_is_wildcard($) return 0; } -=item $bool = debarch_is_illegal($arch) +=item $bool = debarch_is_illegal($arch, %options) Validate an architecture name. +If the "positive" option is set to a true value, only positive architectures +will be accepted, otherwise negated architectures are allowed. + =cut sub debarch_is_illegal { - my ($arch) = @_; + my ($arch, %opts) = @_; + my $arch_re = qr/[a-zA-Z0-9][a-zA-Z0-9-]*/; - return $arch !~ m/^!?[a-zA-Z0-9][a-zA-Z0-9-]*$/; + if ($opts{positive}) { + return $arch !~ m/^$arch_re$/; + } else { + return $arch !~ m/^!?$arch_re$/; + } } =item $bool = debarch_is_concerned($arch, @arches) @@ -651,15 +659,18 @@ sub debarch_is_concerned Parse an architecture list. +If the "positive" option is set to a true value, only positive architectures +will be accepted, otherwise negated architectures are allowed. + =cut sub debarch_list_parse { - my $arch_list = shift; + my ($arch_list, %opts) = @_; my @arch_list = split ' ', $arch_list; foreach my $arch (@arch_list) { - if (debarch_is_illegal($arch)) { + if (debarch_is_illegal($arch, %opts)) { error(g_("'%s' is not a legal architecture in list '%s'"), $arch, $arch_list); } @@ -676,6 +687,11 @@ __END__ =head1 CHANGES +=head2 Version 1.03 (dpkg 1.19.1) + +New argument: Accept a "positive" option in debarch_is_illegal() and +debarch_list_parse(). + =head2 Version 1.02 (dpkg 1.18.19) New import tags: ":all", ":getters", ":parsers", ":mappers", ":operators". diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 84bdc4ba6..4f4b33608 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -369,7 +369,7 @@ foreach my $pkg ($control->get_packages()) { # No files for this package... warn if it's unexpected if (((build_has_any(BUILD_ARCH_INDEP) and debarch_eq('all', $a)) or (build_has_any(BUILD_ARCH_DEP) and - (any { debarch_is($host_arch, $_) } debarch_list_parse($a)))) and + (any { debarch_is($host_arch, $_) } debarch_list_parse($a, positive => 1)))) and (@restrictions == 0 or evaluate_restriction_formula(\@restrictions, \@profiles))) { @@ -388,7 +388,7 @@ foreach my $pkg ($control->get_packages()) { $f2pricf{$_} = $v foreach (@f); } elsif (m/^Architecture$/) { if (build_has_any(BUILD_ARCH_DEP) and - (any { debarch_is($host_arch, $_) } debarch_list_parse($v))) { + (any { debarch_is($host_arch, $_) } debarch_list_parse($v, positive => 1))) { $v = $host_arch; } elsif (!debarch_eq('all', $v)) { $v = ''; diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 2e656a246..1c92e66dd 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -217,7 +217,7 @@ foreach (keys %{$pkg}) { if (debarch_eq('all', $v)) { $fields->{$_} = $v; } else { - my @archlist = debarch_list_parse($v); + my @archlist = debarch_list_parse($v, positive => 1); if (none { debarch_is($host_arch, $_) } @archlist) { error(g_("current host architecture '%s' does not " . diff --git a/scripts/t/Dpkg_Arch.t b/scripts/t/Dpkg_Arch.t index 525817085..0ef9d1899 100644 --- a/scripts/t/Dpkg_Arch.t +++ b/scripts/t/Dpkg_Arch.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 16367; +use Test::More tests => 16369; use_ok('Dpkg::Arch', qw(debarch_to_debtuple debarch_to_multiarch debarch_eq debarch_is debarch_is_wildcard @@ -148,9 +148,16 @@ my @arch_ref; @arch_new = debarch_list_parse('amd64 !arm64 linux-i386 !kfreebsd-any'); is_deeply(\@arch_new, \@arch_ref, 'parse valid arch list'); +@arch_ref = qw(amd64 arm64 linux-i386 kfreebsd-any); +@arch_new = debarch_list_parse('amd64 arm64 linux-i386 kfreebsd-any', positive => 1); +is_deeply(\@arch_new, \@arch_ref, 'parse valid positive arch list'); + eval { @arch_new = debarch_list_parse('!amd64!arm64') }; ok($@, 'parse concatenated arches failed'); +eval { @arch_new = debarch_list_parse('amd64 !arm64 !mips', positive => 1) }; +ok($@, 'parse disallowed negated arches failed'); + is(debarch_to_abiattrs(undef), undef, 'undef ABI attrs'); is_deeply([ debarch_to_abiattrs('amd64') ], [ qw(64 little) ], 'amd64 ABI attrs'); -- cgit v1.2.3 From ee0855cc66076691de4796be48f8a0d889fde001 Mon Sep 17 00:00:00 2001 From: "Manuel A. Fernandez Montecelo" Date: Tue, 16 Jan 2018 00:43:51 +0100 Subject: arch: Add support for riscv64 CPU [guillem@debian.org: - Update unit-tests. ] Closes: #822914 Stable-Candidate: 1.18.x Signed-off-by: Guillem Jover --- data/cputable | 1 + debian/changelog | 3 +++ scripts/t/Dpkg_Arch.t | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/data/cputable b/data/cputable index a2bd7d687..9f2a8e0e4 100644 --- a/data/cputable +++ b/data/cputable @@ -41,6 +41,7 @@ powerpc powerpc (powerpc|ppc) 32 big powerpcel powerpcle powerpcle 32 little ppc64 powerpc64 (powerpc|ppc)64 64 big ppc64el powerpc64le powerpc64le 64 little +riscv64 riscv64 riscv64 64 little s390 s390 s390 32 big s390x s390x s390x 64 big sh3 sh3 sh3 32 little diff --git a/debian/changelog b/debian/changelog index 2d4f616f2..74bab5d95 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,9 @@ dpkg (1.19.1) UNRELEASED; urgency=medium variables to buildtools.mk. Prompted by Helmut Grohne . * Restore rejecting negated architectures in Architecture field in dpkg-gencontrol and dpkg-genchanges. Regression introduced in dpkg 1.18.5. + * Architecture support: + - Add support for riscv64 CPU. Closes: #822914 + Thanks to Manuel A. Fernandez Montecelo * Perl modules: - Check that $tarname is defined before use in Dpkg::Source::Package::V1. Thanks to Christoph Biedl . diff --git a/scripts/t/Dpkg_Arch.t b/scripts/t/Dpkg_Arch.t index 0ef9d1899..9d2aaf361 100644 --- a/scripts/t/Dpkg_Arch.t +++ b/scripts/t/Dpkg_Arch.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 16369; +use Test::More tests => 16832; use_ok('Dpkg::Arch', qw(debarch_to_debtuple debarch_to_multiarch debarch_eq debarch_is debarch_is_wildcard @@ -169,7 +169,7 @@ is(gnutriplet_to_debarch(undef), undef, 'undef gnutriplet'); is(gnutriplet_to_debarch('unknown-unknown-unknown'), undef, 'unknown gnutriplet'); is(gnutriplet_to_debarch('x86_64-linux-gnu'), 'amd64', 'known gnutriplet'); -is(scalar get_valid_arches(), 524, 'expected amount of known architectures'); +is(scalar get_valid_arches(), 539, 'expected amount of known architectures'); { local $ENV{CC} = 'false'; -- cgit v1.2.3 From 81591e0f2590052ff221964c8c554bbbd39763b5 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 13 Jan 2018 02:34:46 +0100 Subject: Dpkg::Vendor::Debian: Mark hurd-i386 as having built-in PIE support Requested-by: Samuel Thibault --- debian/changelog | 2 ++ scripts/Dpkg/Vendor/Debian.pm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 74bab5d95..f83b8b6ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium Fixes regression in dpkg-gensymbols symbols output. Thanks to Dmitry Shachnev . Closes: #880166 - Add new positive options argument to arch validators in Dpkg::Arch. + - Mark hurd-i386 as having gcc builtin PIE in Dpkg::Vendor::Debian. + Requested by Samuel Thibault . * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm index 980597b5c..08ed8250d 100644 --- a/scripts/Dpkg/Vendor/Debian.pm +++ b/scripts/Dpkg/Vendor/Debian.pm @@ -267,7 +267,7 @@ sub _add_build_flags { # Mask builtin features that are not enabled by default in the compiler. my %builtin_pie_arch = map { $_ => 1 } qw( - amd64 arm64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 + amd64 arm64 armel armhf hurd-i386 i386 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64el powerpc ppc64 ppc64el s390x sparc sparc64 ); if (not exists $builtin_pie_arch{$arch}) { -- cgit v1.2.3 From cfb7a0e98b05e41cdbe9f695fd9f625c7a119b81 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 10 Dec 2017 13:36:11 +0100 Subject: dpkg-gensymbols: Print "error" instead of "warning" when these are fatal It's confusing to emit the compare problems as warnings when they cause the program to exit with an error exit code. Closes: #881488 --- debian/changelog | 2 ++ scripts/dpkg-gensymbols.pl | 31 +++++++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index f83b8b6ce..7883dacf9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium variables to buildtools.mk. Prompted by Helmut Grohne . * Restore rejecting negated architectures in Architecture field in dpkg-gencontrol and dpkg-genchanges. Regression introduced in dpkg 1.18.5. + * Fix dpkg-gensymbols to print "error" instead of "warning" when these + are fatal. Closes: #881488 * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl index 09b0aa6d6..ef0992883 100755 --- a/scripts/dpkg-gensymbols.pl +++ b/scripts/dpkg-gensymbols.pl @@ -253,27 +253,34 @@ if ($stdout) { # Check if generated files differs from reference file my $exitcode = 0; + +sub compare_problem +{ + my ($level, $msg, @args) = @_; + + if ($compare >= $level) { + errormsg($msg, @args); + $exitcode = $level; + } else { + warning($msg, @args) unless $quiet; + } +} + if ($compare || ! $quiet) { # Compare if (my @libs = $symfile->get_new_libs($ref_symfile)) { - warning(g_('new libraries appeared in the symbols file: %s'), "@libs") - unless $quiet; - $exitcode = 4 if ($compare >= 4); + compare_problem(4, g_('new libraries appeared in the symbols file: %s'), "@libs"); } if (my @libs = $symfile->get_lost_libs($ref_symfile)) { - warning(g_('some libraries disappeared in the symbols file: %s'), "@libs") - unless $quiet; - $exitcode = 3 if ($compare >= 3); + compare_problem(3, g_('some libraries disappeared in the symbols file: %s'), "@libs"); } if ($symfile->get_new_symbols($ref_symfile)) { - warning(g_('some new symbols appeared in the symbols file: %s'), - g_('see diff output below')) unless $quiet; - $exitcode = 2 if ($compare >= 2); + compare_problem(2, g_('some new symbols appeared in the symbols file: %s'), + g_('see diff output below')); } if ($symfile->get_lost_symbols($ref_symfile)) { - warning(g_('some symbols or patterns disappeared in the symbols file: %s'), - g_('see diff output below')) unless $quiet; - $exitcode = 1 if ($compare >= 1); + compare_problem(1, g_('some symbols or patterns disappeared in the symbols file: %s'), + g_('see diff output below')) } } -- cgit v1.2.3 From 28fee8b445cd94bf7efd76f6c3fd0c62bdf94b6d Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 3 Jan 2018 01:54:51 +0100 Subject: spec/R³: Rename DPKG_GAIN_ROOT_CMD to DEB_GAIN_ROOT_CMD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This variable should not be dpkg specific, as it is supposed to be set by any builder driving the package build, and not just dpkg itself. Introduce ephemereal backwards compatibility by mapping the old name to the new one, even thught there are no known users. --- debian/changelog | 4 ++++ doc/rootless-builds.txt | 14 +++++++++----- man/dpkg-buildpackage.man | 2 +- scripts/dpkg-buildpackage.pl | 4 +++- 4 files changed, 17 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 7883dacf9..bd41680a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,10 @@ dpkg (1.19.1) UNRELEASED; urgency=medium dpkg-gencontrol and dpkg-genchanges. Regression introduced in dpkg 1.18.5. * Fix dpkg-gensymbols to print "error" instead of "warning" when these are fatal. Closes: #881488 + * Rename DPKG_GAIN_ROOT_CMD to DEB_GAIN_ROOT_CMD in the R³ support, as + the variable is expected to be set by any builder, not just dpkg. And + introduce ephemereal backwards compatibility even though there are no + known users. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/doc/rootless-builds.txt b/doc/rootless-builds.txt index 98e387709..29b034a8d 100644 --- a/doc/rootless-builds.txt +++ b/doc/rootless-builds.txt @@ -93,21 +93,25 @@ Gain Root API ------------- The builder will provide a command to promote a given command to (fake)root -by exposing it in the environment variable "DPKG_GAIN_ROOT_CMD". Tools that +by exposing it in the environment variable "DEB_GAIN_ROOT_CMD". Tools that need this promotion will then use it like the following: - $DPKG_GAIN_ROOT_CMD cmd-that-needs-root ... + $DEB_GAIN_ROOT_CMD cmd-that-needs-root ... This command is subject to the same requirements as the "gain-root-command" that dpkg-buildpackage accepts via its "-r/--root-command" option, which means that it can contain space-separated parameters. If dpkg-buildpackage is called with "-r/--root-command", then dpkg-buildpackage shall use that value -as the value for DPKG_GAIN_ROOT_CMD. +as the value for "DEB_GAIN_ROOT_CMD". The variable SHOULD only be provided when there is a need for it. Notably when "Rules-Requires-Root" is either "no" or "binary-targets" the variable SHOULD NOT be defined. +(The "DEB_GAIN_ROOT_CMD" variable used to be named "DPKG_GAIN_ROOT_CMD" +starting with dpkg 1.19.0 and before dpkg 1.19.1 when this specification +got released as stable. The old name MUST not be used.) + Common cases ------------ @@ -128,7 +132,7 @@ dpkg-deb --build must either default to resetting all owner/group values to 0:0 when not run under (fake)root OR provide an interface so dh_builddeb can provide the owner/group value to dpkg-deb --build. -dpkg-buildpackage must export DPKG_GAIN_ROOT_CMD (for starters, doing this +dpkg-buildpackage must export DEB_GAIN_ROOT_CMD (for starters, doing this unconditionally would be fine). @@ -143,7 +147,7 @@ When the field is present: * dh_testroot will be a no-op when Rules-Requires-Root is set to "no". * Otherwise, dh_testroot will either verify that it is run under (fake)root - (as usual) OR assert that DPKG_GAIN_ROOT_CMD is defined. + (as usual) OR assert that DEB_GAIN_ROOT_CMD is defined. * debhelper build systems will be patched to check for the "debhelper/upstream-make-install" keyword and use the "Gain Root API" diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man index 12c121c49..165e63ff2 100644 --- a/man/dpkg-buildpackage.man +++ b/man/dpkg-buildpackage.man @@ -519,7 +519,7 @@ standalone should be supported. parameters forwarded. Any variable that is output by its \fB\-s\fP option is integrated in the build environment. .TP -.B DPKG_GAIN_ROOT_CMD +.B DEB_GAIN_ROOT_CMD This variable is set to \fIgain-root-command\fP when the field \fBRules\-Requires\-Root\fP is set to a value different to \fBno\fP and \fBbinary-targets\fP. diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 3a9ba5b3d..4b3e2b9d6 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -720,7 +720,9 @@ sub parse_rules_requires_root { 'Rules-Requires-Root'); } elsif ($keywords_impl) { # Set only on . - $ENV{DPKG_GAIN_ROOT_CMD} = join ' ', @rootcommand; + $ENV{DEB_GAIN_ROOT_CMD} = join ' ', @rootcommand; + # XXX: For ephemeral backwards compatibility. + $ENV{DPKG_GAIN_ROOT_CMD} = $ENV{DEB_GAIN_ROOT_CMD}; } return %rrr; -- cgit v1.2.3 From f6095fa5db1e4d277a0660806875375d60286250 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 3 Jan 2018 01:57:30 +0100 Subject: dpkg-buildpackage: Do not set DEB_GAIN_ROOT_CMD on The specification is clear on this, and we should not be setting this variable when the values are different to "no" and "binary-targets". --- debian/changelog | 2 ++ scripts/dpkg-buildpackage.pl | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index bd41680a4..c6080560c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium the variable is expected to be set by any builder, not just dpkg. And introduce ephemereal backwards compatibility even though there are no known users. + * Do not set DEB_GAIN_ROOT_CMD in dpkg-buildpackage when the R³ value is + , following the specification. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 4b3e2b9d6..d790b3177 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -723,6 +723,11 @@ sub parse_rules_requires_root { $ENV{DEB_GAIN_ROOT_CMD} = join ' ', @rootcommand; # XXX: For ephemeral backwards compatibility. $ENV{DPKG_GAIN_ROOT_CMD} = $ENV{DEB_GAIN_ROOT_CMD}; + } else { + # We should not provide the variable otherwise. + delete $ENV{DEB_GAIN_ROOT_CMD}; + # XXX: For ephemeral backwards compatibility. + delete $ENV{DPKG_GAIN_ROOT_CMD}; } return %rrr; -- cgit v1.2.3 From 566a4b61b6c3359c3d4cffa05519ecbc967b292c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 3 Jan 2018 02:20:20 +0100 Subject: spec/R³: Add new DEB_RULES_REQUIRES_ROOT variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This variable is set by the builder to notify debian/rules that it supports this specification. Wordsmithing-by: Niels Thykier --- debian/changelog | 1 + doc/rootless-builds.txt | 9 +++++++++ man/dpkg-buildpackage.man | 7 +++++++ scripts/dpkg-buildpackage.pl | 3 +++ 4 files changed, 20 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 4b630810a..0a1789908 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium , following the specification. * Specify that DEB_GAIN_ROOT_CMD in R³ should preserve the environment. Proposed by Josh Triplett . + * Specify new DEB_RULES_REQUIRES_ROOT variable for R³ support. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/doc/rootless-builds.txt b/doc/rootless-builds.txt index 68617d5b4..a17a5ad17 100644 --- a/doc/rootless-builds.txt +++ b/doc/rootless-builds.txt @@ -52,6 +52,15 @@ The values are defined as: a command, it MUST behave like "Rules-Requires-Root" was set to "binary-targets", i.e. run "debian/rules binary" under (fake)root. +When the builder supports this specification, it MUST notify this fact to +the rules file via the "DEB_RULES_REQUIRES_ROOT" environment variable, with +the value it has obtained from the Rules-Requires-Root field or some builder +specific override mechanism, which will denote the level of support the +builder has choosen to commit to take effect during the build. When set, +it MUST be a valid value for the Rules-Requires-Root field. If unset, +the build system SHOULD assume that the builder does not recognize the +Rules-Requires-Root field at all. + It is always permissible for a builder to ignore this field and fall back to running the binary targets under (fake)root. This is to ensure backwards compatibility when builds are performed by legacy builders or older versions diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man index 165e63ff2..76545ebb8 100644 --- a/man/dpkg-buildpackage.man +++ b/man/dpkg-buildpackage.man @@ -519,6 +519,13 @@ standalone should be supported. parameters forwarded. Any variable that is output by its \fB\-s\fP option is integrated in the build environment. .TP +.B DEB_RULES_REQUIRES_ROOT +This variable is set to the value obtained from the \fBRules\-Requires\-Root\fP +field or from the command-line. +When set, it will be a valid value for the \fBRules\-Requires\-Root\fP field. +It is used to notify \fBdebian/rules\fP whether the \fBrootless\-builds.txt\fP +specification is supported. +.TP .B DEB_GAIN_ROOT_CMD This variable is set to \fIgain-root-command\fP when the field \fBRules\-Requires\-Root\fP is set to a value different to \fBno\fP and diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index d790b3177..bd0a6f6a6 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -715,6 +715,9 @@ sub parse_rules_requires_root { setup_rootcommand(); } + # Notify the childs we do support R³. + $ENV{DEB_RULES_REQUIRES_ROOT} = join ' ', sort keys %rrr; + if ($keywords_base > 1 or $keywords_base and $keywords_impl) { error(g_('%s field contains both global and implementation specific keywords'), 'Rules-Requires-Root'); -- cgit v1.2.3 From 585db35d2356193e679dff3eb73d99e65c575f7b Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 28 Oct 2017 12:56:42 +0200 Subject: dpkg-buildpackage: Add new --rules-requires-root This new option makes it possible to force falling back to the legacy behavior of assuming that debian/rules files require root. --- debian/changelog | 1 + man/dpkg-buildpackage.man | 4 ++++ scripts/dpkg-buildpackage.pl | 8 +++++++- 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 0a1789908..fcfcf6aff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium * Specify that DEB_GAIN_ROOT_CMD in R³ should preserve the environment. Proposed by Josh Triplett . * Specify new DEB_RULES_REQUIRES_ROOT variable for R³ support. + * Add new --rules-requires-root option to dpkg-buildpackage. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man index 76545ebb8..906351100 100644 --- a/man/dpkg-buildpackage.man +++ b/man/dpkg-buildpackage.man @@ -276,6 +276,10 @@ Do not check built-in build dependencies and conflicts (since dpkg 1.18.2). These are the distribution specific implicit build dependencies usually required in a build environment, the so called Build-Essential package set. .TP +.B \-\-rules\-requires\-root +Do not honor the \fBRules\-Requires\-Root\fP field, falling back to its +legacy default value (since dpkg 1.19.1). +.TP .BR \-nc ", " \-\-no\-pre\-clean Do not clean the source tree (long option since dpkg 1.18.8). Implies \fB\-b\fP if nothing else has been selected among \fB\-F\fP, diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index bd0a6f6a6..49c7173a4 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -80,6 +80,7 @@ sub usage { do not check builtin build dependencies. -P, --build-profiles= assume comma-separated build profiles as active. + --rules-requires-root assume legacy Rules-Requires-Root field value. -R, --rules-file= rules file to execute (default is debian/rules). -T, --rules-target= call debian/rules . --as-root ensure -T calls the target with root rights. @@ -169,6 +170,7 @@ my $host_type = ''; my $target_arch = ''; my $target_type = ''; my @build_profiles = (); +my $rrr_override; my @call_target = (); my $call_target_as_root = 0; my $since; @@ -309,6 +311,8 @@ while (@ARGV) { } elsif (/^(?:--target=|--rules-target=|-T)(.+)$/) { my $arg = $1; push @call_target, split /,/, $arg; + } elsif (/^--rules-requires-root$/) { + $rrr_override = 'binary-targets'; } elsif (/^--as-root$/) { $call_target_as_root = 1; } elsif (/^--pre-clean$/) { @@ -683,10 +687,12 @@ sub parse_rules_requires_root { my $ctrl = shift; my %rrr; - my $rrr = $ctrl->{'Rules-Requires-Root'} // 'binary-targets'; + my $rrr; my $keywords_base; my $keywords_impl; + $rrr = $rrr_override // $ctrl->{'Rules-Requires-Root'} // 'binary-targets'; + foreach my $keyword (split ' ', $rrr) { if ($keyword =~ m{/}) { if ($keyword =~ m{^dpkg/target/(.*)$}p and $target_official{$1}) { -- cgit v1.2.3 From dde2a51557ccde71a536d5e4a9af236bcb45be9c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 3 Feb 2018 03:24:00 +0100 Subject: Dpkg::Source::Package::V2: Print one building line per existing tarball Lumping all found tarballs into a single line makes the output more confusing. --- debian/changelog | 1 + scripts/Dpkg/Source/Package/V2.pm | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 659c055a7..252efd994 100644 --- a/debian/changelog +++ b/debian/changelog @@ -51,6 +51,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Add new positive options argument to arch validators in Dpkg::Arch. - Mark hurd-i386 as having gcc builtin PIE in Dpkg::Vendor::Debian. Requested by Samuel Thibault . + - Dpkg::Source::Package::V2: Print one building line per existing tarball. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index 818e32ddc..5fdd24957 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/scripts/Dpkg/Source/Package/V2.pm @@ -428,8 +428,10 @@ sub _generate_patch { $self->_upstream_tarball_template()) unless $tarfile; if ($opts{usage} eq 'build') { - info(g_('building %s using existing %s'), - $self->{fields}{'Source'}, "@origtarballs"); + foreach my $origtarfile (@origtarballs) { + info(g_('building %s using existing %s'), + $self->{fields}{'Source'}, $origtarfile); + } } # Unpack a second copy for comparison -- cgit v1.2.3 From e226e6cf5507eebd4888d3d11e1b65752af6752f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 3 Feb 2018 03:24:00 +0100 Subject: Dpkg::Source::Package: Print building lines for upstream tarball signatures When we are picking up upstream tarball signatures, we should also print them as being used to create the source package. Closes: #888787 --- debian/changelog | 2 ++ scripts/Dpkg/Source/Package/V1.pm | 5 ++++- scripts/Dpkg/Source/Package/V2.pm | 18 ++++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 252efd994..541b0c206 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Mark hurd-i386 as having gcc builtin PIE in Dpkg::Vendor::Debian. Requested by Samuel Thibault . - Dpkg::Source::Package::V2: Print one building line per existing tarball. + - Dpkg::Source::Package: Print building lines for upstream tarball + signatures. Closes: #888787 * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Source/Package/V1.pm b/scripts/Dpkg/Source/Package/V1.pm index 001d9ecd3..38c2498f4 100644 --- a/scripts/Dpkg/Source/Package/V1.pm +++ b/scripts/Dpkg/Source/Package/V1.pm @@ -413,7 +413,10 @@ sub do_build { if ($tarname and -e "$tarname.sig" and not -e "$tarname.asc") { openpgp_sig_to_asc("$tarname.sig", "$tarname.asc"); } - $self->add_file($tarsign) if $tarsign and -e $tarsign; + if ($tarsign and -e $tarsign) { + info(g_('building %s using existing %s'), $sourcepackage, $tarsign); + $self->add_file($tarsign); + } if ($sourcestyle =~ m/[kpKP]/) { if (stat($origdir)) { diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index 5fdd24957..13e5d7456 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/scripts/Dpkg/Source/Package/V2.pm @@ -399,7 +399,7 @@ sub _generate_patch { # Identify original tarballs my ($tarfile, %addonfile); my $comp_ext_regex = compression_get_file_extension_regex(); - my @origtarballs; + my @origtarfiles; foreach my $file (sort $self->find_original_tarballs()) { if ($file =~ /\.orig\.tar\.$comp_ext_regex$/) { if (defined($tarfile)) { @@ -407,20 +407,26 @@ sub _generate_patch { 'one is allowed'), $tarfile, $file); } $tarfile = $file; - push @origtarballs, $file; + push @origtarfiles, $file; $self->add_file($file); if (-e "$file.sig" and not -e "$file.asc") { openpgp_sig_to_asc("$file.sig", "$file.asc"); } - $self->add_file("$file.asc") if -e "$file.asc"; + if (-e "$file.asc") { + push @origtarfiles, "$file.asc"; + $self->add_file("$file.asc") + } } elsif ($file =~ /\.orig-([[:alnum:]-]+)\.tar\.$comp_ext_regex$/) { $addonfile{$1} = $file; - push @origtarballs, $file; + push @origtarfiles, $file; $self->add_file($file); if (-e "$file.sig" and not -e "$file.asc") { openpgp_sig_to_asc("$file.sig", "$file.asc"); } - $self->add_file("$file.asc") if -e "$file.asc"; + if (-e "$file.asc") { + push @origtarfiles, "$file.asc"; + $self->add_file("$file.asc"); + } } } @@ -428,7 +434,7 @@ sub _generate_patch { $self->_upstream_tarball_template()) unless $tarfile; if ($opts{usage} eq 'build') { - foreach my $origtarfile (@origtarballs) { + foreach my $origtarfile (@origtarfiles) { info(g_('building %s using existing %s'), $self->{fields}{'Source'}, $origtarfile); } -- cgit v1.2.3 From f6e152b63f9eb183313807898be0569f5321bdf6 Mon Sep 17 00:00:00 2001 From: Jack Bates Date: Tue, 30 Jan 2018 20:46:27 +0000 Subject: scripts/mk: Export architecture variables by default The dpkg-architecture(1) man page states that these variables are exported, and that's what dpkg-buildpackage does itself when setting up the build environment. Doing this is always safe. Closes: #888964 Signed-off-by: Guillem Jover --- debian/changelog | 3 +++ scripts/mk/architecture.mk | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 541b0c206..ad63a24d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,9 @@ dpkg (1.19.1) UNRELEASED; urgency=medium * Specify new DEB_RULES_REQUIRES_ROOT variable for R³ support. * Add new --rules-requires-root option to dpkg-buildpackage. * Declare R³ specification as "recommendation, stable" with version 1.0. + * Export architecture variables by default from architecture.mk, as + documented in dpkg-architecture(1). Closes: #88896 + Thanks to Jack Bates * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/scripts/mk/architecture.mk b/scripts/mk/architecture.mk index 8520c5b2a..0af96019d 100644 --- a/scripts/mk/architecture.mk +++ b/scripts/mk/architecture.mk @@ -4,7 +4,7 @@ dpkg_lazy_eval ?= $$(or $$(value DPKG_CACHE_$(1)),$$(eval DPKG_CACHE_$(1) := $$(shell $(2)))$$(value DPKG_CACHE_$(1))) -dpkg_architecture_setvar = $(1) ?= $(call dpkg_lazy_eval,$(1),dpkg-architecture -q$(1)) +dpkg_architecture_setvar = export $(1) ?= $(call dpkg_lazy_eval,$(1),dpkg-architecture -q$(1)) $(foreach machine,BUILD HOST TARGET,\ $(foreach var,ARCH ARCH_ABI ARCH_LIBC ARCH_OS ARCH_CPU ARCH_BITS ARCH_ENDIAN GNU_CPU GNU_SYSTEM GNU_TYPE MULTIARCH,\ -- cgit v1.2.3 From 79b681f5675ce9068b5b5e93da0def5f93c9c247 Mon Sep 17 00:00:00 2001 From: Helge Kreutzmann Date: Thu, 22 Feb 2018 18:22:19 +0100 Subject: Update German scripts translation Update to 599t. --- scripts/po/de.po | 65 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 29 deletions(-) (limited to 'scripts') diff --git a/scripts/po/de.po b/scripts/po/de.po index 841792f4d..0922cf0e3 100644 --- a/scripts/po/de.po +++ b/scripts/po/de.po @@ -1,13 +1,13 @@ # German translation of the scripts in the dpkg package # This file is distributed under the same license as the dpkg package. -# (C) Helge Kreutzmann , 2007-2017. +# (C) Helge Kreutzmann , 2007-2018. # msgid "" msgstr "" "Project-Id-Version: dpkg-dev 1.18.8\n" "Report-Msgid-Bugs-To: debian-dpkg@lists.debian.org\n" -"POT-Creation-Date: 2017-10-17 01:57+0200\n" -"PO-Revision-Date: 2017-10-17 21:29+0200\n" +"POT-Creation-Date: 2018-02-22 18:08+0100\n" +"PO-Revision-Date: 2018-02-22 18:21+0100\n" "Last-Translator: Helge Kreutzmann \n" "Language-Team: German \n" "Language: de\n" @@ -259,6 +259,8 @@ msgid "" " -P, --build-profiles=\n" " assume comma-separated build profiles as " "active.\n" +" --rules-requires-root assume legacy Rules-Requires-Root field " +"value.\n" " -R, --rules-file= rules file to execute (default is debian/" "rules).\n" " -T, --rules-target= call debian/rules .\n" @@ -319,7 +321,10 @@ msgstr "" " eingebaute Bauabhängigkeiten nicht prüfen\n" " -P, --build-profiles=\n" " Kommata-getrennte übergebene Bauprofile als aktiv\n" -" annehmen -R, --rules-file=\n" +" annehmen\n" +" --rules-requires-root\n" +" alten Feldwert »Rules-Requires-Root« annehmen\n" +" -R, --rules-file=\n" " auszuführende rules-Datei (Vorgabe: debian/rules)\n" " -T, --rules-target=\n" " debian/rules mit der korrekten Umgebung " @@ -454,23 +459,6 @@ msgstr "-E und -W sind veraltet, sie haben keine Wirkung" msgid "unknown option or argument %s" msgstr "unbekannte Option oder Argument %s" -#: scripts/dpkg-buildpackage.pl -msgid "using a gain-root-command while being root" -msgstr "Verwendung eines root-werde-Befehls, obwohl bereits root" - -#: scripts/dpkg-buildpackage.pl -msgid "" -"fakeroot not found, either install the fakeroot\n" -"package, specify a command with the -r option, or run this as root" -msgstr "" -"Fakeroot nicht gefunden; installieren Sie entweder das Fakeroot-Paket,\n" -"geben Sie einen Befehl mit der Option -r an oder führen Sie dies als root aus" - -#: scripts/dpkg-buildpackage.pl -#, perl-format -msgid "gain-root-command '%s' not found" -msgstr "root-werde-Befehl »%s« nicht gefunden" - #: scripts/dpkg-buildpackage.pl #, perl-format msgid "option %s is only meaningful with option %s" @@ -553,6 +541,23 @@ msgstr "" msgid "unable to determine %s" msgstr "%s kann nicht bestimmt werden" +#: scripts/dpkg-buildpackage.pl +msgid "using a gain-root-command while being root" +msgstr "Verwendung eines root-werde-Befehls, obwohl bereits root" + +#: scripts/dpkg-buildpackage.pl +msgid "" +"fakeroot not found, either install the fakeroot\n" +"package, specify a command with the -r option, or run this as root" +msgstr "" +"Fakeroot nicht gefunden; installieren Sie entweder das Fakeroot-Paket,\n" +"geben Sie einen Befehl mit der Option -r an oder führen Sie dies als root aus" + +#: scripts/dpkg-buildpackage.pl +#, perl-format +msgid "gain-root-command '%s' not found" +msgstr "root-werde-Befehl »%s« nicht gefunden" + #: scripts/dpkg-buildpackage.pl #, perl-format msgid "disallowed target in %s field keyword %s" @@ -2268,8 +2273,8 @@ msgstr "" #: scripts/Dpkg/Changelog.pm #, perl-format -msgid "'%s' option specifies non-existing version" -msgstr "Option »%s« gibt nicht existierende Version an" +msgid "'%s' option specifies non-existing version '%s'" +msgstr "Option »%s« gibt nicht existierende Version »%s« an" #: scripts/Dpkg/Changelog.pm msgid "use newest entry that is earlier than the one specified" @@ -2285,16 +2290,18 @@ msgstr "ältester Eintrag wird verwendet, der neuer als der angegebene ist" #: scripts/Dpkg/Changelog.pm #, perl-format -msgid "no such entry found, ignoring '%s' parameter" -msgstr "kein solcher Eintrag gefunden, Parameter »%s« wird ignoriert" +msgid "no such entry found, ignoring '%s' parameter '%s'" +msgstr "kein solcher Eintrag gefunden, »%s«-Parameter »%s« wird ignoriert" #: scripts/Dpkg/Changelog.pm -msgid "'since' option specifies most recent version, ignoring" -msgstr "Option »since« gibt die neuste Version an, wird ignoriert" +#, perl-format +msgid "'since' option specifies most recent version '%s', ignoring" +msgstr "Option »since« gibt die neuste Version »%s« an, wird ignoriert" #: scripts/Dpkg/Changelog.pm -msgid "'until' option specifies oldest version, ignoring" -msgstr "Option »until« gibt die älteste Version an, wird ignoriert" +#, perl-format +msgid "'until' option specifies oldest version '%s', ignoring" +msgstr "Option »until« gibt die älteste Version »%s« an, wird ignoriert" #: scripts/Dpkg/Changelog/Debian.pm msgid "first heading" -- cgit v1.2.3 From f7488217a506871f1aed58373220a76ea2e170ab Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 6 Feb 2017 03:17:32 +0100 Subject: Dpkg::Deps: Turn virtualpkg tracking from an arrayyref into a hashref This is more extensible and more clear. --- debian/changelog | 1 + scripts/Dpkg/Deps.pm | 19 ++++++++++++++----- scripts/dpkg-genbuildinfo.pl | 3 +-- 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 6fae00607..efd84ec45 100644 --- a/debian/changelog +++ b/debian/changelog @@ -59,6 +59,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::Source::Package::V2: Print one building line per existing tarball. - Dpkg::Source::Package: Print building lines for upstream tarball signatures. Closes: #888787 + - Dpkg::Deps: Turn virtualpkg tracking from an arrayyref into a hashref. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index 3560e1a72..df8d9f4ec 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -1423,9 +1423,15 @@ field (if present). sub add_provided_package { my ($self, $pkg, $rel, $ver, $by) = @_; + my $v = { + package => $pkg, + relation => $rel, + version => $ver, + provider => $by, + }; $self->{virtualpkg}{$pkg} //= []; - push @{$self->{virtualpkg}{$pkg}}, [ $by, $rel, $ver ]; + push @{$self->{virtualpkg}{$pkg}}, $v; } =item ($check, $param) = $facts->check_package($package) @@ -1453,7 +1459,10 @@ sub check_package { return (1, $self->{pkg}{$pkg}[0]{version}); } if (exists $self->{virtualpkg}{$pkg}) { - return (1, $self->{virtualpkg}{$pkg}); + my $arrayref = [ map { [ + $_->{provider}, $_->{relation}, $_->{version} + ] } @{$self->{virtualpkg}{$pkg}} ]; + return (1, $arrayref); } return (0, undef); } @@ -1510,11 +1519,11 @@ sub _evaluate_simple_dep { } } foreach my $virtpkg ($self->_find_virtual_packages($pkg)) { - next if defined $virtpkg->[1] and $virtpkg->[1] ne REL_EQ; + next if defined $virtpkg->{relation} and $virtpkg->{relation} ne REL_EQ; if (defined $dep->{relation}) { - next if not defined $virtpkg->[2]; - return 1 if version_compare_relation($virtpkg->[2], + next if not defined $virtpkg->{version}; + return 1 if version_compare_relation($virtpkg->{version}, $dep->{relation}, $dep->{version}); } else { diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl index 45c45089d..96b06093a 100755 --- a/scripts/dpkg-genbuildinfo.pl +++ b/scripts/dpkg-genbuildinfo.pl @@ -232,8 +232,7 @@ sub collect_installed_builddeps { # virtual package: we cannot know for sure which implementation # is the one that has been used, so let's add them all... foreach my $provided (@{$facts->{virtualpkg}->{$pkg_name}}) { - my ($provided_by, $provided_rel, $provided_ver) = @{$provided}; - push @unprocessed_pkgs, $provided_by; + push @unprocessed_pkgs, $provided->{provider}; } } # else: it is a package in an OR dependency that has been otherwise -- cgit v1.2.3 From 83272497c5be8c4e703ab179906cf904465fe775 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 6 Feb 2017 03:52:50 +0100 Subject: Dpkg::Deps: Accept $archqual for add_provided_package() method --- debian/changelog | 1 + scripts/Dpkg/Deps.pm | 14 ++++++++++---- scripts/dpkg-checkbuilddeps.pl | 2 +- scripts/dpkg-genbuildinfo.pl | 3 ++- scripts/dpkg-gencontrol.pl | 3 ++- 5 files changed, 16 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index efd84ec45..a73e91077 100644 --- a/debian/changelog +++ b/debian/changelog @@ -60,6 +60,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::Source::Package: Print building lines for upstream tarball signatures. Closes: #888787 - Dpkg::Deps: Turn virtualpkg tracking from an arrayyref into a hashref. + - Dpkg::Deps: Accept $archqual for add_provided_package() method. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index df8d9f4ec..3612eb303 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -49,7 +49,7 @@ All the deps_* functions are exported by default. use strict; use warnings; -our $VERSION = '1.06'; +our $VERSION = '1.07'; our @EXPORT = qw( deps_concat deps_parse @@ -1413,18 +1413,20 @@ sub add_installed_package { push @{$self->{pkg}{$pkg}}, $p; } -=item $facts->add_provided_package($virtual, $relation, $version, $by) +=item $facts->add_provided_package($virtual, $relation, $version, $by, $archqual) Records that the "$by" package provides the $virtual package. $relation and $version correspond to the associated relation given in the Provides -field (if present). +field (if present). $archqual corresponds to the package arch qualifier +(if present). =cut sub add_provided_package { - my ($self, $pkg, $rel, $ver, $by) = @_; + my ($self, $pkg, $rel, $ver, $by, $archqual) = @_; my $v = { package => $pkg, + archqual => $archqual, relation => $rel, version => $ver, provider => $by, @@ -1536,6 +1538,10 @@ sub _evaluate_simple_dep { =head1 CHANGES +=head2 Version 1.07 (dpkg 1.19.1) + +New argument: Add $archqual to $dep->add_provided_package(). + =head2 Version 1.06 (dpkg 1.18.7; module version bumped on dpkg 1.18.24) New option: Add tests_dep option to Dpkg::Deps::deps_parse(). diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl index 80b309f14..738afa042 100755 --- a/scripts/dpkg-checkbuilddeps.pl +++ b/scripts/dpkg-checkbuilddeps.pl @@ -173,7 +173,7 @@ sub parse_status { { $facts->add_provided_package($_->{package}, $_->{relation}, $_->{version}, - $package); + $package, $_->{archqual}); } } } diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl index 96b06093a..c2916c2b2 100755 --- a/scripts/dpkg-genbuildinfo.pl +++ b/scripts/dpkg-genbuildinfo.pl @@ -115,7 +115,8 @@ sub parse_status { deps_iterate($provides, sub { my $dep = shift; $facts->add_provided_package($dep->{package}, $dep->{relation}, - $dep->{version}, $package); + $dep->{version}, $package, + $dep->{archqual}); }); } diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 1c92e66dd..517db351b 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -263,7 +263,8 @@ if (exists $pkg->{'Provides'}) { if ($subdep->isa('Dpkg::Deps::Simple')) { $facts->add_provided_package($subdep->{package}, $subdep->{relation}, $subdep->{version}, - $fields->{'Package'}); + $fields->{'Package'}, + $subdep->{archqual}); } } } -- cgit v1.2.3 From cba523f59c2d8f18d8b1e9940681579f871034ce Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 22 Mar 2018 03:59:28 +0100 Subject: Dpkg::Vendor::Debian: Split pie builtin arches one per line This makes changing them easier to see when diffing. --- scripts/Dpkg/Vendor/Debian.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm index 08ed8250d..d7af8e3b7 100644 --- a/scripts/Dpkg/Vendor/Debian.pm +++ b/scripts/Dpkg/Vendor/Debian.pm @@ -267,8 +267,23 @@ sub _add_build_flags { # Mask builtin features that are not enabled by default in the compiler. my %builtin_pie_arch = map { $_ => 1 } qw( - amd64 arm64 armel armhf hurd-i386 i386 kfreebsd-amd64 kfreebsd-i386 - mips mipsel mips64el powerpc ppc64 ppc64el s390x sparc sparc64 + amd64 + arm64 + armel + armhf + hurd-i386 + i386 + kfreebsd-amd64 + kfreebsd-i386 + mips + mipsel + mips64el + powerpc + ppc64 + ppc64el + s390x + sparc + sparc64 ); if (not exists $builtin_pie_arch{$arch}) { $builtin_feature{hardening}{pie} = 0; -- cgit v1.2.3 From 544dd8967940aeee11b47b53a8df6f88110a9a16 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 22 Mar 2018 04:00:07 +0100 Subject: Dpkg::Vendor::Debian: Mark riscv64 as having gcc built-in PIE support --- debian/changelog | 1 + scripts/Dpkg/Vendor/Debian.pm | 1 + 2 files changed, 2 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index a73e91077..ed4d8e796 100644 --- a/debian/changelog +++ b/debian/changelog @@ -61,6 +61,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium signatures. Closes: #888787 - Dpkg::Deps: Turn virtualpkg tracking from an arrayyref into a hashref. - Dpkg::Deps: Accept $archqual for add_provided_package() method. + - Dpkg::Vendor::Debian: Mark riscv64 as having gcc builtin PIE. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm index d7af8e3b7..814948e83 100644 --- a/scripts/Dpkg/Vendor/Debian.pm +++ b/scripts/Dpkg/Vendor/Debian.pm @@ -281,6 +281,7 @@ sub _add_build_flags { powerpc ppc64 ppc64el + riscv64 s390x sparc sparc64 -- cgit v1.2.3 From 94728ead2cc22af5043b16483aab1e4f5a50223c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 29 Apr 2018 01:26:10 +0200 Subject: Revert "Dpkg::Deps: Accept $archqual for add_provided_package() method" This reverts commit 83272497c5be8c4e703ab179906cf904465fe775. This commit introduced a regression in the author test suite. And there's a patch by Johannes 'josch' Schauer which should be fixing this and other problems. If this is needed after all, we will need to refactor the functions first to take a hash instead of a long list of arguments. --- debian/changelog | 1 - scripts/Dpkg/Deps.pm | 14 ++++---------- scripts/dpkg-checkbuilddeps.pl | 2 +- scripts/dpkg-genbuildinfo.pl | 3 +-- scripts/dpkg-gencontrol.pl | 3 +-- 5 files changed, 7 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 3d59b4278..59d2cffd6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -74,7 +74,6 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::Source::Package: Print building lines for upstream tarball signatures. Closes: #888787 - Dpkg::Deps: Turn virtualpkg tracking from an arrayyref into a hashref. - - Dpkg::Deps: Accept $archqual for add_provided_package() method. - Dpkg::Vendor::Debian: Mark riscv64 as having gcc builtin PIE. * Documentation: - Update gettext minimal version in README. diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index 3612eb303..df8d9f4ec 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -49,7 +49,7 @@ All the deps_* functions are exported by default. use strict; use warnings; -our $VERSION = '1.07'; +our $VERSION = '1.06'; our @EXPORT = qw( deps_concat deps_parse @@ -1413,20 +1413,18 @@ sub add_installed_package { push @{$self->{pkg}{$pkg}}, $p; } -=item $facts->add_provided_package($virtual, $relation, $version, $by, $archqual) +=item $facts->add_provided_package($virtual, $relation, $version, $by) Records that the "$by" package provides the $virtual package. $relation and $version correspond to the associated relation given in the Provides -field (if present). $archqual corresponds to the package arch qualifier -(if present). +field (if present). =cut sub add_provided_package { - my ($self, $pkg, $rel, $ver, $by, $archqual) = @_; + my ($self, $pkg, $rel, $ver, $by) = @_; my $v = { package => $pkg, - archqual => $archqual, relation => $rel, version => $ver, provider => $by, @@ -1538,10 +1536,6 @@ sub _evaluate_simple_dep { =head1 CHANGES -=head2 Version 1.07 (dpkg 1.19.1) - -New argument: Add $archqual to $dep->add_provided_package(). - =head2 Version 1.06 (dpkg 1.18.7; module version bumped on dpkg 1.18.24) New option: Add tests_dep option to Dpkg::Deps::deps_parse(). diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl index 738afa042..80b309f14 100755 --- a/scripts/dpkg-checkbuilddeps.pl +++ b/scripts/dpkg-checkbuilddeps.pl @@ -173,7 +173,7 @@ sub parse_status { { $facts->add_provided_package($_->{package}, $_->{relation}, $_->{version}, - $package, $_->{archqual}); + $package); } } } diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl index c2916c2b2..96b06093a 100755 --- a/scripts/dpkg-genbuildinfo.pl +++ b/scripts/dpkg-genbuildinfo.pl @@ -115,8 +115,7 @@ sub parse_status { deps_iterate($provides, sub { my $dep = shift; $facts->add_provided_package($dep->{package}, $dep->{relation}, - $dep->{version}, $package, - $dep->{archqual}); + $dep->{version}, $package); }); } diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 517db351b..1c92e66dd 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -263,8 +263,7 @@ if (exists $pkg->{'Provides'}) { if ($subdep->isa('Dpkg::Deps::Simple')) { $facts->add_provided_package($subdep->{package}, $subdep->{relation}, $subdep->{version}, - $fields->{'Package'}, - $subdep->{archqual}); + $fields->{'Package'}); } } } -- cgit v1.2.3 From 5cc92fcf27b65c069a7e21da491debb0afa692a4 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 31 Mar 2018 17:22:39 +0200 Subject: Dpkg: Fix default DATADIR Even though we always override it from the build system the default pathname got out-of-sync with the repository when the architecture tables got moved into the data directory. Fixes: commit 97309bef8b664c2d58cb689a3e82848021ae9bad --- scripts/Dpkg.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Dpkg.pm b/scripts/Dpkg.pm index 0d171c080..7f06b15e6 100644 --- a/scripts/Dpkg.pm +++ b/scripts/Dpkg.pm @@ -107,7 +107,7 @@ our $PROGPATCH = $ENV{DPKG_PROGPATCH} // 'patch'; our $CONFDIR = '/etc/dpkg'; our $ADMINDIR = '/var/lib/dpkg'; our $LIBDIR = '.'; -our $DATADIR = '..'; +our $DATADIR = '../data'; $DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR}; -- cgit v1.2.3 From 22685bcfa8aa4b13bfd95a117320fc0bedfa6715 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 31 Mar 2018 17:47:14 +0200 Subject: build: Add CPAN distribution machinery Add a new dist-cpan target that takes care of preparing a perl distribution to be uploaded to CPAN. Only the modules are shipped, some of which do require dpkg tools being installed though. Closes: #821177 --- Makefile.am | 4 ++- configure.ac | 9 ++++++- cpan.am | 48 ++++++++++++++++++++++++++++++++++ debian/changelog | 1 + scripts/.gitignore | 1 + scripts/Build.PL.in | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ scripts/Test/Dpkg.pm | 20 +++++++++++--- 7 files changed, 152 insertions(+), 5 deletions(-) create mode 100644 cpan.am create mode 100644 scripts/Build.PL.in (limited to 'scripts') diff --git a/Makefile.am b/Makefile.am index 31e82a7a8..4cd8376f6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -179,9 +179,11 @@ update-po: $(MAKE) -C dselect/po update-po $(MAKE) -C man update-po +include $(top_srcdir)/cpan.am + # If we create the dist tarball from the git repository, make sure # that we're not forgetting some files... -dist-hook: +dist-hook: dist-cpan echo $(VERSION) >$(distdir)/.dist-version if [ -e .git ]; then \ for file in `git ls-files | grep -v .gitignore`; do \ diff --git a/configure.ac b/configure.ac index 2e09c63e1..822f6f654 100644 --- a/configure.ac +++ b/configure.ac @@ -3,8 +3,14 @@ m4_pattern_forbid([^_?DPKG_]) AC_PREREQ(2.60) -AC_INIT([dpkg], m4_esyscmd([./get-version]), [debian-dpkg@lists.debian.org]) +AC_INIT([dpkg], m4_esyscmd([./get-version]), [debian-dpkg@lists.debian.org], + [dpkg], [https://wiki.debian.org/Teams/Dpkg]) AC_SUBST([PACKAGE_COPYRIGHT_HOLDER], ['Dpkg Developers']) +AC_SUBST([PACKAGE_VCS_TYPE], [git]) +AC_SUBST([PACKAGE_VCS_URL], [https://anonscm.debian.org/git/dpkg/dpkg.git]) +AC_SUBST([PACKAGE_VCS_WEB], [https://anonscm.debian.org/cgit/dpkg/dpkg.git]) +AC_SUBST([PACKAGE_BUG_WEB], [https://bugs.debian.org/src:dpkg]) +AC_SUBST([PACKAGE_CPAN_NAME], [Dpkg]) AC_CONFIG_SRCDIR([lib/dpkg/dpkg.h]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) @@ -208,6 +214,7 @@ AC_CONFIG_FILES([ doc/Doxyfile man/Makefile po/Makefile.in + scripts/Build.PL scripts/Makefile scripts/mk/Makefile scripts/po/Makefile.in diff --git a/cpan.am b/cpan.am new file mode 100644 index 000000000..0cf4967ad --- /dev/null +++ b/cpan.am @@ -0,0 +1,48 @@ +CPAN_DIST_NAME = $(PACKAGE_CPAN_NAME) +CPAN_DIST_VERSION = $(PACKAGE_VERSION) +CPAN_DIST = $(CPAN_DIST_NAME)-$(CPAN_DIST_VERSION) +CPAN_DIST_ARCHIVE = $(CPAN_DIST).tar.gz + +dist-cpan: + : # Create the CPAN source tree. + mkdir -p $(CPAN_DIST) + mkdir -p $(CPAN_DIST)/lib + mkdir -p $(CPAN_DIST)/t + cp -fpR $(top_srcdir)/data $(CPAN_DIST) + cp -fpR $(top_srcdir)/t/* \ + $(top_srcdir)/scripts/t/Dpkg* \ + $(top_srcdir)/scripts/t/origins \ + $(CPAN_DIST)/t + $(do_perl_subst) <$(top_srcdir)/scripts/Dpkg.pm \ + >$(CPAN_DIST)/lib/Dpkg.pm + cp -fpR $(top_srcdir)/scripts/Dpkg.pm \ + $(top_srcdir)/scripts/Dpkg \ + $(CPAN_DIST)/lib/ + cp -fpR $(top_srcdir)/scripts/Test $(CPAN_DIST)/lib/ + cp -fpR $(top_srcdir)/scripts/Build.PL $(CPAN_DIST) + + : # Fix permissions of the distributed files. + chmod a+x $(CPAN_DIST)/Build.PL + find $(CPAN_DIST) \ + -type d ! -perm 755 -exec chmod u+rwx,go+rx {} ';' -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; || \ + chmod -R a+r $(CPAN_DIST) + + : # Prepare the CPAN distribution. + cd $(CPAN_DIST) && ./Build.PL + cd $(CPAN_DIST) && ./Build manifest + cd $(CPAN_DIST) && ./Build distsign + + : # Pack the CPAN distribution. + $(TAR) -caf $(CPAN_DIST_ARCHIVE) -C $(CPAN_DIST) -Hustar \ + --sort=name --owner=root:0 --group=root:0 $(CPAN_DIST) + + : # Cleanup the CPAN source tree. + find $(CPAN_DIST) -type d ! -perm -200 -exec chmod u+w {} ';' + rm -rf $(CPAN_DIST) + +# Ignore the CPAN archive for distcleancheck. +distcleancheck_listfiles = \ + find -type f \( -name $(CPAN_DIST_ARCHIVE) -o -print \) diff --git a/debian/changelog b/debian/changelog index 59d2cffd6..372dcdcde 100644 --- a/debian/changelog +++ b/debian/changelog @@ -90,6 +90,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium instead of passing the positive form manually. - Enable clang -Wdocumentation warning if available. - Enable gcc-7 -Wregister warning if available. + - Add CPAN distribution machinery for the perl modules. Closes: #821177 * Packaging: - Install update-alternatives policykit-1 file. - Add Breaks to libdpkg-perl against pkg-kde-tools (<< 0.15.28~), as diff --git a/scripts/.gitignore b/scripts/.gitignore index 0d1f29ac9..a93412826 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -1,3 +1,4 @@ +Build.PL dpkg-architecture dpkg-buildflags dpkg-buildpackage diff --git a/scripts/Build.PL.in b/scripts/Build.PL.in new file mode 100644 index 000000000..40de90e41 --- /dev/null +++ b/scripts/Build.PL.in @@ -0,0 +1,74 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Module::Build (); + +if (-e 'Build.PL.in') { + die "error: This is an in-tree build, not a proper perl distribution.\n" . + "To create one please configure normally and then run 'make dist'.\n"; +} + +my $class = Module::Build->subclass( + class => 'Module::Build::Dpkg', + code => q{ + BEGIN { + $ENV{DPKG_TEST_MODE} = 'cpan'; + $ENV{DPKG_DATADIR} = 'data'; + $ENV{DPKG_ORIGINS_DIR} = 't/origins'; + } + }, +); + +my $build = $class->new( + dist_name => '@PACKAGE_CPAN_NAME@', + dist_abstract => 'Debian Package Manager Perl modules', + dist_version => '@PACKAGE_VERSION@', + dist_author => '@PACKAGE_COPYRIGHT_HOLDER@ <@PACKAGE_BUGREPORT@>', + license => 'GPL_2', + + # Set only to avoid warnings. + module_name => '@PACKAGE_CPAN_NAME@', + + meta_merge => { + resources => { + homepage => '@PACKAGE_URL@', + repository => { + type => '@PACKAGE_VCS_TYPE@', + url => '@PACKAGE_VCS_URL@', + web => '@PACKAGE_VCS_WEB@', + }, + bugtracker => { + web => '@PACKAGE_BUG_WEB@', + }, + }, + keywords => [ qw(dpkg debian perl) ], + }, + + sign => 1, + dynamic_config => 0, + + configure_requires => { + 'Module::Build' => '0.4004', + }, + test_requires => { + 'TAP::Harness' => 0, + 'Test::More' => 0, + 'Test::Pod' => 0, + 'Test::Strict' => 0, + }, + recommands => { + 'Algorithm::Merge' => 0, + 'File::FcntlLock' => 0, + 'Locale::gettext' => 0, + + }, + requires => { + 'perl' => '@PERL_MIN_VERSION@', + }, +); + +$build->create_build_script(); + +1; diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm index 5eea6184a..4900e1f91 100644 --- a/scripts/Test/Dpkg.pm +++ b/scripts/Test/Dpkg.pm @@ -54,6 +54,12 @@ use File::Path qw(make_path); use IPC::Cmd qw(can_run); use Test::More; +my $test_mode; + +BEGIN { + $test_mode = $ENV{DPKG_TEST_MODE} // 'dpkg'; +} + sub _test_get_caller_dir { my (undef, $path, undef) = caller 1; @@ -69,8 +75,12 @@ sub test_get_data_path my $path = shift; if (defined $path) { - my $srcdir = $ENV{srcdir} || '.'; - return "$srcdir/$path"; + if ($test_mode eq 'cpan') { + return $path; + } else { + my $srcdir = $ENV{srcdir} || '.'; + return "$srcdir/$path"; + } } else { return _test_get_caller_dir(); } @@ -87,7 +97,11 @@ sub test_get_temp_path sub test_get_perl_dirs { - return qw(t src/t lib utils/t scripts dselect); + if ($test_mode eq 'cpan') { + return qw(t lib); + } else { + return qw(t src/t lib utils/t scripts dselect); + } } sub all_perl_files -- cgit v1.2.3 From d6c8af723fb79f96e1bcc3d87e952e0a7a9eea0e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 1 Apr 2018 03:23:10 +0200 Subject: dpkg-checkbuilddeps: Fix indentation --- scripts/dpkg-checkbuilddeps.pl | 69 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 35 deletions(-) (limited to 'scripts') diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl index 80b309f14..c5a65e1ab 100755 --- a/scripts/dpkg-checkbuilddeps.pl +++ b/scripts/dpkg-checkbuilddeps.pl @@ -138,48 +138,47 @@ if ($bc_value) { } if (@unmet) { - errormsg(g_('Unmet build dependencies: %s'), - join(' ', map { $_->output() } @unmet)); + errormsg(g_('Unmet build dependencies: %s'), + join(' ', map { $_->output() } @unmet)); } if (@conflicts) { - errormsg(g_('Build conflicts: %s'), - join(' ', map { $_->output() } @conflicts)); + errormsg(g_('Build conflicts: %s'), + join(' ', map { $_->output() } @conflicts)); } exit 1 if @unmet || @conflicts; # Silly little status file parser that returns a Dpkg::Deps::KnownFacts sub parse_status { - my $status = shift; - - my $facts = Dpkg::Deps::KnownFacts->new(); - local $/ = ''; - open(my $status_fh, '<', $status) - or syserr(g_('cannot open %s'), $status); - while (<$status_fh>) { - next unless /^Status: .*ok installed$/m; - - my ($package) = /^Package: (.*)$/m; - my ($version) = /^Version: (.*)$/m; - my ($arch) = /^Architecture: (.*)$/m; - my ($multiarch) = /^Multi-Arch: (.*)$/m; - $facts->add_installed_package($package, $version, $arch, - $multiarch); - - if (/^Provides: (.*)$/m) { - my $provides = deps_parse($1, reduce_arch => 1, union => 1); - next if not defined $provides; - foreach (grep { $_->isa('Dpkg::Deps::Simple') } - $provides->get_deps()) - { - $facts->add_provided_package($_->{package}, - $_->{relation}, $_->{version}, - $package); - } - } - } - close $status_fh; - - return $facts; + my $status = shift; + + my $facts = Dpkg::Deps::KnownFacts->new(); + local $/ = ''; + open(my $status_fh, '<', $status) + or syserr(g_('cannot open %s'), $status); + while (<$status_fh>) { + next unless /^Status: .*ok installed$/m; + + my ($package) = /^Package: (.*)$/m; + my ($version) = /^Version: (.*)$/m; + my ($arch) = /^Architecture: (.*)$/m; + my ($multiarch) = /^Multi-Arch: (.*)$/m; + $facts->add_installed_package($package, $version, $arch, $multiarch); + + if (/^Provides: (.*)$/m) { + my $provides = deps_parse($1, reduce_arch => 1, union => 1); + next if not defined $provides; + foreach (grep { $_->isa('Dpkg::Deps::Simple') } + $provides->get_deps()) + { + $facts->add_provided_package($_->{package}, + $_->{relation}, $_->{version}, + $package); + } + } + } + close $status_fh; + + return $facts; } # This function checks the build dependencies passed in as the first -- cgit v1.2.3 From 9dab03c99a64cd15536f153e0705ec16e686c2d5 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 12 Apr 2018 05:52:02 +0200 Subject: dpkg-source: Do not emit perl warnings on source formats w/o options At least the format "3.0 (native)" supports no format specific options, which makes the describe_cmdline_options() return an empty list. --- debian/changelog | 2 ++ scripts/dpkg-source.pl | 1 + 2 files changed, 3 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 3542c13fc..0d4410be9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -57,6 +57,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium using this new protocol, to safely lock the dpkg database w/o risk of race conditions with other dpkg instances or frontends supporting the same protocol. Thanks to Julian Andres Klode . + * Do not emit perl warnings in dpkg-source --help on source formats w/o + options. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 5c356c31a..107408d79 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -578,6 +578,7 @@ sub get_format_help { $srcpkg->upgrade_object_type(); # Fails if format is unsupported my @cmdline = $srcpkg->describe_cmdline_options(); + return '' unless @cmdline; my $help_build = my $help_extract = ''; my $help; -- cgit v1.2.3 From b9090a05af10b4f12adbc796fdc846c667ac7670 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 8 Apr 2018 22:34:35 +0200 Subject: Dpkg::Shlibs::Objdump: Remove duplicate assignment in reset() method --- scripts/Dpkg/Shlibs/Objdump.pm | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Dpkg/Shlibs/Objdump.pm b/scripts/Dpkg/Shlibs/Objdump.pm index 91cc06488..2694f596f 100644 --- a/scripts/Dpkg/Shlibs/Objdump.pm +++ b/scripts/Dpkg/Shlibs/Objdump.pm @@ -268,7 +268,6 @@ sub reset { $self->{file} = ''; $self->{id} = ''; - $self->{SONAME} = ''; $self->{HASH} = ''; $self->{GNU_HASH} = ''; $self->{SONAME} = ''; -- cgit v1.2.3 From c972dfdcd85d92a39998b81a0fb23dc63935b137 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 8 Apr 2018 22:38:27 +0200 Subject: Dpkg::Shlibs::Objdump: Fix ELF program detection An ELF executable is defined by whether the object has the EXEC_P flag defined or an interpreter in the program header. The former applies to statically linked programs, the latter to dynamically linked programs and possibly some shared libraries that can be executed, such as the ones provided by glibc. This is now more relevant as PIE makes normal executables show up as shared objects, so they do not contain the EXEC_P flag, and were not being detected as executables. --- debian/changelog | 2 ++ scripts/Dpkg/Shlibs/Objdump.pm | 10 ++++++++-- scripts/t/Dpkg_Shlibs.t | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 0d4410be9..5098e7f2d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -87,6 +87,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium signatures. Closes: #888787 - Dpkg::Deps: Turn virtualpkg tracking from an arrayyref into a hashref. - Dpkg::Vendor::Debian: Mark riscv64 as having gcc builtin PIE. + - Dpkg::Shlibs::Objdump: Fix ELF program detection, for PIE binaries and + executable libraries. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Shlibs/Objdump.pm b/scripts/Dpkg/Shlibs/Objdump.pm index 2694f596f..d0a7b56cb 100644 --- a/scripts/Dpkg/Shlibs/Objdump.pm +++ b/scripts/Dpkg/Shlibs/Objdump.pm @@ -270,6 +270,7 @@ sub reset { $self->{id} = ''; $self->{HASH} = ''; $self->{GNU_HASH} = ''; + $self->{INTERP} = 0; $self->{SONAME} = ''; $self->{NEEDED} = []; $self->{RPATH} = []; @@ -324,7 +325,7 @@ sub parse_objdump_output { $section = 'dyninfo'; next; } elsif (/^Program Header:/) { - $section = 'header'; + $section = 'program'; next; } elsif (/^Version definitions:/) { $section = 'verdef'; @@ -363,6 +364,10 @@ sub parse_objdump_output { $self->{RPATH} = [ split /:/, $rpath ]; } } + } elsif ($section eq 'program') { + if (/^\s*INTERP\s+/) { + $self->{INTERP} = 1; + } } elsif ($section eq 'none') { if (/^\s*.+:\s*file\s+format\s+(\S+)$/) { $self->{format} = $1; @@ -535,7 +540,8 @@ sub get_needed_libraries { sub is_executable { my $self = shift; - return exists $self->{flags}{EXEC_P} && $self->{flags}{EXEC_P}; + return (exists $self->{flags}{EXEC_P} && $self->{flags}{EXEC_P}) || + (exists $self->{INTERP} && $self->{INTERP}); } sub is_public_library { diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t index 2310f4f1c..a271af587 100644 --- a/scripts/t/Dpkg_Shlibs.t +++ b/scripts/t/Dpkg_Shlibs.t @@ -21,7 +21,7 @@ use Test::Dpkg qw(:needs :paths); use Cwd; -plan tests => 148; +plan tests => 150; use Dpkg::Path qw(find_command); @@ -104,7 +104,7 @@ $obj->parse_objdump_output($objdump); close $objdump; ok($obj->is_public_library(), 'libc6 is a public library'); -ok(!$obj->is_executable(), 'libc6 is not an executable'); +ok($obj->is_executable(), 'libc6 is an executable'); is($obj->{SONAME}, 'libc.so.6', 'SONAME'); is($obj->{HASH}, '0x13d99c', 'HASH'); @@ -350,6 +350,8 @@ open $objdump, '<', "$datadir/objdump.glib-ia64" or die "$datadir/objdump.glib-ia64: $!"; $obj->parse_objdump_output($objdump); close $objdump; +ok($obj->is_public_library(), 'glib-ia64 is a public library'); +ok(!$obj->is_executable(), 'glib-ia64 is not an executable'); $sym = $obj->get_symbol('IA__g_free'); is_deeply( $sym, { name => 'IA__g_free', version => '', -- cgit v1.2.3 From fd8f838450ab89e3011c1a48061e0247d205ea96 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 8 Apr 2018 22:42:10 +0200 Subject: scripts: Refresh test data and update code to match --- scripts/t/Dpkg_Shlibs.t | 3 +- scripts/t/Dpkg_Shlibs/objdump.basictags-amd64 | 89 ++- scripts/t/Dpkg_Shlibs/objdump.basictags-i386 | 93 ++-- scripts/t/Dpkg_Shlibs/objdump.basictags-mips | 91 ++- scripts/t/Dpkg_Shlibs/objdump.ls | 771 +++++++++++++++++--------- scripts/t/Dpkg_Shlibs/objdump.patterns | 377 +++++++------ scripts/t/Dpkg_Shlibs/objdump.spacesyms | 151 +++-- 7 files changed, 911 insertions(+), 664 deletions(-) (limited to 'scripts') diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t index a271af587..4dc98bb3f 100644 --- a/scripts/t/Dpkg_Shlibs.t +++ b/scripts/t/Dpkg_Shlibs.t @@ -382,7 +382,8 @@ sub check_spacesym { debug => '', type => 'F', weak => '', local => '', global => 1, visibility => $visibility, hidden => '', defined => 1 }, $name); - ok(defined $obj->{dynrelocs}{$name}, "dynreloc found for $name"); + ok(defined $obj->{dynrelocs}{$name . "@@" . $version}, + "dynreloc found for $name"); } check_spacesym('symdefaultvernospacedefault', 'Base'); diff --git a/scripts/t/Dpkg_Shlibs/objdump.basictags-amd64 b/scripts/t/Dpkg_Shlibs/objdump.basictags-amd64 index 93d7ea467..aa533761b 100644 --- a/scripts/t/Dpkg_Shlibs/objdump.basictags-amd64 +++ b/scripts/t/Dpkg_Shlibs/objdump.basictags-amd64 @@ -2,46 +2,45 @@ ./t/Dpkg_Shlibs/libobjdump.basictags-amd64.so: file format elf32-i386 architecture: i386, flags 0x00000150: HAS_SYMS, DYNAMIC, D_PAGED -start address 0x00000480 +start address 0x00000450 Program Header: LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000724 memsz 0x00000724 flags r-x - LOAD off 0x00000724 vaddr 0x00001724 paddr 0x00001724 align 2**12 - filesz 0x00000120 memsz 0x00000124 flags rw- - DYNAMIC off 0x00000730 vaddr 0x00001730 paddr 0x00001730 align 2**2 - filesz 0x000000e8 memsz 0x000000e8 flags rw- - NOTE off 0x000000f4 vaddr 0x000000f4 paddr 0x000000f4 align 2**2 + filesz 0x000006d0 memsz 0x000006d0 flags r-x + LOAD off 0x00000f18 vaddr 0x00001f18 paddr 0x00001f18 align 2**12 + filesz 0x000000f8 memsz 0x000000fc flags rw- + DYNAMIC off 0x00000f20 vaddr 0x00001f20 paddr 0x00001f20 align 2**2 + filesz 0x000000d0 memsz 0x000000d0 flags rw- + NOTE off 0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**2 filesz 0x00000024 memsz 0x00000024 flags r-- -EH_FRAME off 0x00000628 vaddr 0x00000628 paddr 0x00000628 align 2**2 - filesz 0x00000044 memsz 0x00000044 flags r-- +EH_FRAME off 0x000005b8 vaddr 0x000005b8 paddr 0x000005b8 align 2**2 + filesz 0x0000004c memsz 0x0000004c flags r-- STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4 filesz 0x00000000 memsz 0x00000000 flags rw- + RELRO off 0x00000f18 vaddr 0x00001f18 paddr 0x00001f18 align 2**0 + filesz 0x000000e8 memsz 0x000000e8 flags r-- Dynamic Section: NEEDED libc.so.6 SONAME libbasictags.so.1 - INIT 0x00000424 - FINI 0x00000614 - INIT_ARRAY 0x00001724 + INIT 0x00000404 + FINI 0x000005a4 + INIT_ARRAY 0x00001f18 INIT_ARRAYSZ 0x00000004 - FINI_ARRAY 0x00001728 + FINI_ARRAY 0x00001f1c FINI_ARRAYSZ 0x00000004 - GNU_HASH 0x00000118 - STRTAB 0x00000278 - SYMTAB 0x00000168 - STRSZ 0x00000117 + GNU_HASH 0x00000138 + STRTAB 0x00000288 + SYMTAB 0x00000188 + STRSZ 0x00000103 SYMENT 0x00000010 - PLTGOT 0x0000182c - PLTRELSZ 0x00000010 - PLTREL 0x00000011 - JMPREL 0x00000414 - REL 0x000003d4 - RELSZ 0x00000040 + PLTGOT 0x00002000 + REL 0x000003cc + RELSZ 0x00000038 RELENT 0x00000008 - VERNEED 0x000003b4 + VERNEED 0x000003ac VERNEEDNUM 0x00000001 - VERSYM 0x00000390 + VERSYM 0x0000038c RELCOUNT 0x00000003 Version References: @@ -52,32 +51,28 @@ DYNAMIC SYMBOL TABLE: 00000000 w D *UND* 00000000 _ITM_deregisterTMCloneTable 00000000 w DF *UND* 00000000 GLIBC_2.1.3 __cxa_finalize 00000000 w D *UND* 00000000 __gmon_start__ -00000000 w D *UND* 00000000 _Jv_RegisterClasses 00000000 w D *UND* 00000000 _ITM_registerTMCloneTable -00001844 g D .data 00000000 Base _edata -000005f0 g DF .text 00000002 Base symbol26_little -00001848 g D .bss 00000000 Base _end -000005d0 g DF .text 00000002 Base symbol21_amd64 -00001844 g D .bss 00000000 Base __bss_start -000005e0 g DF .text 00000002 Base symbol25_64 -00000424 g DF .init 00000000 Base _init -00000600 g DF .text 00000002 Base symbol31_randomtag -00000614 g DF .fini 00000000 Base _fini -00000610 g DF .text 00000002 Base symbol51_untagged -000005c0 g DF .text 00000002 Base symbol11_optional +00002010 g D .data 00000000 Base _edata +00000580 g DF .text 00000002 Base symbol26_little +00002014 g D .bss 00000000 Base _end +00000560 g DF .text 00000002 Base symbol21_amd64 +00002010 g D .bss 00000000 Base __bss_start +00000570 g DF .text 00000002 Base symbol25_64 +00000404 g DF .init 00000000 Base _init +00000590 g DF .text 00000002 Base symbol31_randomtag +000005a4 g DF .fini 00000000 Base _fini +000005a0 g DF .text 00000002 Base symbol51_untagged +00000550 g DF .text 00000002 Base symbol11_optional DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE -00001724 R_386_RELATIVE *ABS* -00001728 R_386_RELATIVE *ABS* -00001840 R_386_RELATIVE *ABS* -00001818 R_386_GLOB_DAT _ITM_deregisterTMCloneTable -0000181c R_386_GLOB_DAT __cxa_finalize -00001820 R_386_GLOB_DAT __gmon_start__ -00001824 R_386_GLOB_DAT _Jv_RegisterClasses -00001828 R_386_GLOB_DAT _ITM_registerTMCloneTable -00001838 R_386_JUMP_SLOT __cxa_finalize -0000183c R_386_JUMP_SLOT __gmon_start__ +00001f18 R_386_RELATIVE *ABS* +00001f1c R_386_RELATIVE *ABS* +0000200c R_386_RELATIVE *ABS* +00001ff0 R_386_GLOB_DAT _ITM_deregisterTMCloneTable +00001ff4 R_386_GLOB_DAT __cxa_finalize@GLIBC_2.1.3 +00001ff8 R_386_GLOB_DAT __gmon_start__ +00001ffc R_386_GLOB_DAT _ITM_registerTMCloneTable diff --git a/scripts/t/Dpkg_Shlibs/objdump.basictags-i386 b/scripts/t/Dpkg_Shlibs/objdump.basictags-i386 index 4138a8945..af0f707d1 100644 --- a/scripts/t/Dpkg_Shlibs/objdump.basictags-i386 +++ b/scripts/t/Dpkg_Shlibs/objdump.basictags-i386 @@ -2,46 +2,45 @@ ./t/Dpkg_Shlibs/libobjdump.basictags-i386.so: file format elf32-i386 architecture: i386, flags 0x00000150: HAS_SYMS, DYNAMIC, D_PAGED -start address 0x000004e0 +start address 0x000004b0 Program Header: LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x000007dc memsz 0x000007dc flags r-x - LOAD off 0x000007dc vaddr 0x000017dc paddr 0x000017dc align 2**12 - filesz 0x00000120 memsz 0x00000124 flags rw- - DYNAMIC off 0x000007e8 vaddr 0x000017e8 paddr 0x000017e8 align 2**2 - filesz 0x000000e8 memsz 0x000000e8 flags rw- - NOTE off 0x000000f4 vaddr 0x000000f4 paddr 0x000000f4 align 2**2 + filesz 0x00000788 memsz 0x00000788 flags r-x + LOAD off 0x00000f18 vaddr 0x00001f18 paddr 0x00001f18 align 2**12 + filesz 0x000000f8 memsz 0x000000fc flags rw- + DYNAMIC off 0x00000f20 vaddr 0x00001f20 paddr 0x00001f20 align 2**2 + filesz 0x000000d0 memsz 0x000000d0 flags rw- + NOTE off 0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**2 filesz 0x00000024 memsz 0x00000024 flags r-- -EH_FRAME off 0x000006a8 vaddr 0x000006a8 paddr 0x000006a8 align 2**2 - filesz 0x00000054 memsz 0x00000054 flags r-- +EH_FRAME off 0x00000638 vaddr 0x00000638 paddr 0x00000638 align 2**2 + filesz 0x0000005c memsz 0x0000005c flags r-- STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4 filesz 0x00000000 memsz 0x00000000 flags rw- + RELRO off 0x00000f18 vaddr 0x00001f18 paddr 0x00001f18 align 2**0 + filesz 0x000000e8 memsz 0x000000e8 flags r-- Dynamic Section: NEEDED libc.so.6 SONAME libbasictags.so.1 - INIT 0x00000484 - FINI 0x00000694 - INIT_ARRAY 0x000017dc + INIT 0x00000464 + FINI 0x00000624 + INIT_ARRAY 0x00001f18 INIT_ARRAYSZ 0x00000004 - FINI_ARRAY 0x000017e0 + FINI_ARRAY 0x00001f1c FINI_ARRAYSZ 0x00000004 - GNU_HASH 0x00000118 - STRTAB 0x000002a8 - SYMTAB 0x00000178 - STRSZ 0x00000144 + GNU_HASH 0x00000138 + STRTAB 0x000002b8 + SYMTAB 0x00000198 + STRSZ 0x00000130 SYMENT 0x00000010 - PLTGOT 0x000018e4 - PLTRELSZ 0x00000010 - PLTREL 0x00000011 - JMPREL 0x00000474 - REL 0x00000434 - RELSZ 0x00000040 + PLTGOT 0x00002000 + REL 0x0000042c + RELSZ 0x00000038 RELENT 0x00000008 - VERNEED 0x00000414 + VERNEED 0x0000040c VERNEEDNUM 0x00000001 - VERSYM 0x000003ec + VERSYM 0x000003e8 RELCOUNT 0x00000003 Version References: @@ -52,34 +51,30 @@ DYNAMIC SYMBOL TABLE: 00000000 w D *UND* 00000000 _ITM_deregisterTMCloneTable 00000000 w DF *UND* 00000000 GLIBC_2.1.3 __cxa_finalize 00000000 w D *UND* 00000000 __gmon_start__ -00000000 w D *UND* 00000000 _Jv_RegisterClasses 00000000 w D *UND* 00000000 _ITM_registerTMCloneTable -000018fc g D .data 00000000 Base _edata -00000650 g DF .text 00000002 Base symbol26_little -00001900 g D .bss 00000000 Base _end -00000680 g DF .text 00000002 Base symbol41_i386_and_optional -00000630 g DF .text 00000002 Base symbol22_i386 -00000660 g DF .text 00000002 Base symbol28_little_32 -000018fc g D .bss 00000000 Base __bss_start -00000484 g DF .init 00000000 Base _init -00000670 g DF .text 00000002 Base symbol31_randomtag -00000640 g DF .text 00000002 Base symbol24_32 -00000694 g DF .fini 00000000 Base _fini -00000690 g DF .text 00000002 Base symbol51_untagged -00000620 g DF .text 00000002 Base symbol11_optional +00002010 g D .data 00000000 Base _edata +000005e0 g DF .text 00000002 Base symbol26_little +00002014 g D .bss 00000000 Base _end +00000610 g DF .text 00000002 Base symbol41_i386_and_optional +000005c0 g DF .text 00000002 Base symbol22_i386 +000005f0 g DF .text 00000002 Base symbol28_little_32 +00002010 g D .bss 00000000 Base __bss_start +00000464 g DF .init 00000000 Base _init +00000600 g DF .text 00000002 Base symbol31_randomtag +000005d0 g DF .text 00000002 Base symbol24_32 +00000624 g DF .fini 00000000 Base _fini +00000620 g DF .text 00000002 Base symbol51_untagged +000005b0 g DF .text 00000002 Base symbol11_optional DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE -000017dc R_386_RELATIVE *ABS* -000017e0 R_386_RELATIVE *ABS* -000018f8 R_386_RELATIVE *ABS* -000018d0 R_386_GLOB_DAT _ITM_deregisterTMCloneTable -000018d4 R_386_GLOB_DAT __cxa_finalize -000018d8 R_386_GLOB_DAT __gmon_start__ -000018dc R_386_GLOB_DAT _Jv_RegisterClasses -000018e0 R_386_GLOB_DAT _ITM_registerTMCloneTable -000018f0 R_386_JUMP_SLOT __cxa_finalize -000018f4 R_386_JUMP_SLOT __gmon_start__ +00001f18 R_386_RELATIVE *ABS* +00001f1c R_386_RELATIVE *ABS* +0000200c R_386_RELATIVE *ABS* +00001ff0 R_386_GLOB_DAT _ITM_deregisterTMCloneTable +00001ff4 R_386_GLOB_DAT __cxa_finalize@GLIBC_2.1.3 +00001ff8 R_386_GLOB_DAT __gmon_start__ +00001ffc R_386_GLOB_DAT _ITM_registerTMCloneTable diff --git a/scripts/t/Dpkg_Shlibs/objdump.basictags-mips b/scripts/t/Dpkg_Shlibs/objdump.basictags-mips index 620b821cc..27795c49b 100644 --- a/scripts/t/Dpkg_Shlibs/objdump.basictags-mips +++ b/scripts/t/Dpkg_Shlibs/objdump.basictags-mips @@ -2,46 +2,45 @@ ./t/Dpkg_Shlibs/libobjdump.basictags-mips.so: file format elf32-i386 architecture: i386, flags 0x00000150: HAS_SYMS, DYNAMIC, D_PAGED -start address 0x000004b0 +start address 0x00000480 Program Header: LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000780 memsz 0x00000780 flags r-x - LOAD off 0x00000780 vaddr 0x00001780 paddr 0x00001780 align 2**12 - filesz 0x00000120 memsz 0x00000124 flags rw- - DYNAMIC off 0x0000078c vaddr 0x0000178c paddr 0x0000178c align 2**2 - filesz 0x000000e8 memsz 0x000000e8 flags rw- - NOTE off 0x000000f4 vaddr 0x000000f4 paddr 0x000000f4 align 2**2 + filesz 0x0000072c memsz 0x0000072c flags r-x + LOAD off 0x00000f18 vaddr 0x00001f18 paddr 0x00001f18 align 2**12 + filesz 0x000000f8 memsz 0x000000fc flags rw- + DYNAMIC off 0x00000f20 vaddr 0x00001f20 paddr 0x00001f20 align 2**2 + filesz 0x000000d0 memsz 0x000000d0 flags rw- + NOTE off 0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**2 filesz 0x00000024 memsz 0x00000024 flags r-- -EH_FRAME off 0x00000668 vaddr 0x00000668 paddr 0x00000668 align 2**2 - filesz 0x0000004c memsz 0x0000004c flags r-- +EH_FRAME off 0x000005f8 vaddr 0x000005f8 paddr 0x000005f8 align 2**2 + filesz 0x00000054 memsz 0x00000054 flags r-- STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4 filesz 0x00000000 memsz 0x00000000 flags rw- + RELRO off 0x00000f18 vaddr 0x00001f18 paddr 0x00001f18 align 2**0 + filesz 0x000000e8 memsz 0x000000e8 flags r-- Dynamic Section: NEEDED libc.so.6 SONAME libbasictags.so.1 - INIT 0x00000458 - FINI 0x00000654 - INIT_ARRAY 0x00001780 + INIT 0x00000438 + FINI 0x000005e4 + INIT_ARRAY 0x00001f18 INIT_ARRAYSZ 0x00000004 - FINI_ARRAY 0x00001784 + FINI_ARRAY 0x00001f1c FINI_ARRAYSZ 0x00000004 - GNU_HASH 0x00000118 - STRTAB 0x00000294 - SYMTAB 0x00000174 - STRSZ 0x0000012e + GNU_HASH 0x00000138 + STRTAB 0x000002a4 + SYMTAB 0x00000194 + STRSZ 0x0000011a SYMENT 0x00000010 - PLTGOT 0x00001888 - PLTRELSZ 0x00000010 - PLTREL 0x00000011 - JMPREL 0x00000448 - REL 0x00000408 - RELSZ 0x00000040 + PLTGOT 0x00002000 + REL 0x00000400 + RELSZ 0x00000038 RELENT 0x00000008 - VERNEED 0x000003e8 + VERNEED 0x000003e0 VERNEEDNUM 0x00000001 - VERSYM 0x000003c2 + VERSYM 0x000003be RELCOUNT 0x00000003 Version References: @@ -52,33 +51,29 @@ DYNAMIC SYMBOL TABLE: 00000000 w D *UND* 00000000 _ITM_deregisterTMCloneTable 00000000 w DF *UND* 00000000 GLIBC_2.1.3 __cxa_finalize 00000000 w D *UND* 00000000 __gmon_start__ -00000000 w D *UND* 00000000 _Jv_RegisterClasses 00000000 w D *UND* 00000000 _ITM_registerTMCloneTable -000018a0 g D .data 00000000 Base _edata -000018a4 g D .bss 00000000 Base _end -00000640 g DF .text 00000002 Base symbol42_mips_and_optional -000018a0 g D .bss 00000000 Base __bss_start -00000458 g DF .init 00000000 Base _init -00000630 g DF .text 00000002 Base symbol31_randomtag -00000610 g DF .text 00000002 Base symbol24_32 -00000654 g DF .fini 00000000 Base _fini -00000650 g DF .text 00000002 Base symbol51_untagged -000005f0 g DF .text 00000002 Base symbol11_optional -00000600 g DF .text 00000002 Base symbol23_mips -00000620 g DF .text 00000002 Base symbol27_big +00002010 g D .data 00000000 Base _edata +00002014 g D .bss 00000000 Base _end +000005d0 g DF .text 00000002 Base symbol42_mips_and_optional +00002010 g D .bss 00000000 Base __bss_start +00000438 g DF .init 00000000 Base _init +000005c0 g DF .text 00000002 Base symbol31_randomtag +000005a0 g DF .text 00000002 Base symbol24_32 +000005e4 g DF .fini 00000000 Base _fini +000005e0 g DF .text 00000002 Base symbol51_untagged +00000580 g DF .text 00000002 Base symbol11_optional +00000590 g DF .text 00000002 Base symbol23_mips +000005b0 g DF .text 00000002 Base symbol27_big DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE -00001780 R_386_RELATIVE *ABS* -00001784 R_386_RELATIVE *ABS* -0000189c R_386_RELATIVE *ABS* -00001874 R_386_GLOB_DAT _ITM_deregisterTMCloneTable -00001878 R_386_GLOB_DAT __cxa_finalize -0000187c R_386_GLOB_DAT __gmon_start__ -00001880 R_386_GLOB_DAT _Jv_RegisterClasses -00001884 R_386_GLOB_DAT _ITM_registerTMCloneTable -00001894 R_386_JUMP_SLOT __cxa_finalize -00001898 R_386_JUMP_SLOT __gmon_start__ +00001f18 R_386_RELATIVE *ABS* +00001f1c R_386_RELATIVE *ABS* +0000200c R_386_RELATIVE *ABS* +00001ff0 R_386_GLOB_DAT _ITM_deregisterTMCloneTable +00001ff4 R_386_GLOB_DAT __cxa_finalize@GLIBC_2.1.3 +00001ff8 R_386_GLOB_DAT __gmon_start__ +00001ffc R_386_GLOB_DAT _ITM_registerTMCloneTable diff --git a/scripts/t/Dpkg_Shlibs/objdump.ls b/scripts/t/Dpkg_Shlibs/objdump.ls index f679242c3..30ae8beb0 100644 --- a/scripts/t/Dpkg_Shlibs/objdump.ls +++ b/scripts/t/Dpkg_Shlibs/objdump.ls @@ -1,277 +1,536 @@ /bin/ls: file format elf32-i386 -architecture: i386, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x08049b50 +architecture: i386, flags 0x00000150: +HAS_SYMS, DYNAMIC, D_PAGED +start address 0x00003e16 Program Header: - PHDR off 0x00000034 vaddr 0x08048034 paddr 0x08048034 align 2**2 - filesz 0x00000100 memsz 0x00000100 flags r-x - INTERP off 0x00000134 vaddr 0x08048134 paddr 0x08048134 align 2**0 + PHDR off 0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2 + filesz 0x00000120 memsz 0x00000120 flags r-x + INTERP off 0x00000154 vaddr 0x00000154 paddr 0x00000154 align 2**0 filesz 0x00000013 memsz 0x00000013 flags r-- - LOAD off 0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12 - filesz 0x00012478 memsz 0x00012478 flags r-x - LOAD off 0x00012478 vaddr 0x0805b478 paddr 0x0805b478 align 2**12 - filesz 0x000003b4 memsz 0x00000818 flags rw- - DYNAMIC off 0x0001248c vaddr 0x0805b48c paddr 0x0805b48c align 2**2 - filesz 0x000000e8 memsz 0x000000e8 flags rw- - NOTE off 0x00000148 vaddr 0x08048148 paddr 0x08048148 align 2**2 - filesz 0x00000020 memsz 0x00000020 flags r-- -EH_FRAME off 0x000123b0 vaddr 0x0805a3b0 paddr 0x0805a3b0 align 2**2 - filesz 0x0000002c memsz 0x0000002c flags r-- - STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2 + LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12 + filesz 0x00021f10 memsz 0x00021f10 flags r-x + LOAD off 0x000229b8 vaddr 0x000239b8 paddr 0x000239b8 align 2**12 + filesz 0x0000098c memsz 0x00001b1c flags rw- + DYNAMIC off 0x00022eac vaddr 0x00023eac paddr 0x00023eac align 2**2 + filesz 0x000000f8 memsz 0x000000f8 flags rw- + NOTE off 0x00000168 vaddr 0x00000168 paddr 0x00000168 align 2**2 + filesz 0x00000044 memsz 0x00000044 flags r-- +EH_FRAME off 0x0001b5b8 vaddr 0x0001b5b8 paddr 0x0001b5b8 align 2**2 + filesz 0x000008cc memsz 0x000008cc flags r-- + STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4 filesz 0x00000000 memsz 0x00000000 flags rw- + RELRO off 0x000229b8 vaddr 0x000239b8 paddr 0x000239b8 align 2**0 + filesz 0x00000648 memsz 0x00000648 flags r-- Dynamic Section: - NEEDED librt.so.1 - NEEDED libacl.so.1 - NEEDED libselinux.so.1 - NEEDED libc.so.6 - INIT 0x8049510 - FINI 0x8056768 - HASH 0x8048168 - GNU_HASH 0x80484a4 - STRTAB 0x8048bc0 - SYMTAB 0x8048500 - STRSZ 0x4a0 - SYMENT 0x10 - DEBUG 0x0 - PLTGOT 0x805b57c - PLTRELSZ 0x300 - PLTREL 0x11 - JMPREL 0x8049210 - REL 0x80491e8 - RELSZ 0x28 - RELENT 0x8 - VERNEED 0x8049138 - VERNEEDNUM 0x3 - VERSYM 0x8049060 + NEEDED libselinux.so.1 + NEEDED libc.so.6 + INIT 0x00001ce8 + FINI 0x00016524 + INIT_ARRAY 0x000239b8 + INIT_ARRAYSZ 0x00000004 + FINI_ARRAY 0x000239bc + FINI_ARRAYSZ 0x00000004 + GNU_HASH 0x000001ac + STRTAB 0x00000adc + SYMTAB 0x0000020c + STRSZ 0x00000638 + SYMENT 0x00000010 + DEBUG 0x00000000 + PLTGOT 0x00024000 + PLTRELSZ 0x00000388 + PLTREL 0x00000011 + JMPREL 0x00001960 + REL 0x000012d0 + RELSZ 0x00000690 + RELENT 0x00000008 + FLAGS_1 0x08000000 + VERNEED 0x00001230 + VERNEEDNUM 0x00000001 + VERSYM 0x00001114 + RELCOUNT 0x000000c6 Version References: - required from librt.so.1: - 0x0d696912 0x00 08 GLIBC_2.2 - required from libacl.so.1: - 0x05822450 0x00 06 ACL_1.0 required from libc.so.6: - 0x09691a73 0x00 09 GLIBC_2.2.3 - 0x0d696913 0x00 07 GLIBC_2.3 + 0x0d696912 0x00 10 GLIBC_2.2 + 0x09691f73 0x00 09 GLIBC_2.1.3 + 0x09691a73 0x00 08 GLIBC_2.2.3 + 0x0d696914 0x00 07 GLIBC_2.4 + 0x06969197 0x00 06 GLIBC_2.17 0x0d696911 0x00 05 GLIBC_2.1 - 0x09691f73 0x00 04 GLIBC_2.1.3 - 0x0d696912 0x00 03 GLIBC_2.2 - 0x0d696910 0x00 02 GLIBC_2.0 + 0x09691974 0x00 04 GLIBC_2.3.4 + 0x0d696910 0x00 03 GLIBC_2.0 + 0x0d696913 0x00 02 GLIBC_2.3 DYNAMIC SYMBOL TABLE: -00000000 DF *UND* 0000026e GLIBC_2.0 abort -00000000 DF *UND* 0000001d GLIBC_2.0 __errno_location -00000000 DF *UND* 0000004d GLIBC_2.0 sigemptyset -00000000 DF *UND* 00000034 GLIBC_2.0 sprintf -00000000 DF *UND* 000001a2 GLIBC_2.2 localeconv -00000000 DF *UND* 0000000a GLIBC_2.0 dirfd -00000000 DF *UND* 00000057 GLIBC_2.1.3 __cxa_atexit -00000000 DF *UND* 00000037 GLIBC_2.0 strcoll -00000000 DF *UND* 00000150 GLIBC_2.0 qsort -00000000 DF *UND* 00000094 GLIBC_2.1 fputs_unlocked -00000000 DF *UND* 0000001e GLIBC_2.0 __ctype_get_mb_cur_max -00000000 DF *UND* 000000d9 GLIBC_2.0 signal -00000000 DF *UND* 0000006e GLIBC_2.0 sigismember +00000000 DF *UND* 00000000 GLIBC_2.3 __ctype_toupper_loc +00000000 DF *UND* 00000000 GLIBC_2.0 unsetenv +00000000 DF *UND* 00000000 GLIBC_2.0 getpwnam +00000000 DF *UND* 00000000 GLIBC_2.0 raise +00000000 DF *UND* 00000000 GLIBC_2.3.4 __snprintf_chk +00000000 DO *UND* 00000000 GLIBC_2.0 __progname +00000000 DF *UND* 00000000 GLIBC_2.0 strcmp +00000000 DF *UND* 00000000 GLIBC_2.1 open64 +00000000 w D *UND* 00000000 _ITM_deregisterTMCloneTable +00000000 DF *UND* 00000000 GLIBC_2.0 getpwuid +00000000 DF *UND* 00000000 GLIBC_2.0 fflush +00000000 DO *UND* 00000000 GLIBC_2.0 stderr +00000000 DF *UND* 00000000 GLIBC_2.0 _exit +00000000 DF *UND* 00000000 GLIBC_2.0 sigprocmask +00000000 DF *UND* 00000000 GLIBC_2.0 dirfd +00000000 DF *UND* 00000000 GLIBC_2.0 wcwidth +00000000 DF *UND* 00000000 GLIBC_2.0 memmove +00000000 DF *UND* 00000000 GLIBC_2.0 _setjmp +00000000 DF *UND* 00000000 GLIBC_2.0 free +00000000 DF *UND* 00000000 GLIBC_2.0 memcpy +00000000 DF *UND* 00000000 GLIBC_2.0 mbsinit +00000000 DF *UND* 00000000 GLIBC_2.17 clock_gettime +00000000 DF *UND* 00000000 GLIBC_2.0 __strtoull_internal +00000000 DF *UND* 00000000 GLIBC_2.1 fclose +00000000 DF *UND* 00000000 GLIBC_2.1 fseeko64 +00000000 DF *UND* 00000000 GLIBC_2.0 signal +00000000 DF *UND* 00000000 GLIBC_2.0 memcmp +00000000 DF *UND* 00000000 GLIBC_2.0 gettimeofday +00000000 DO *UND* 00000000 GLIBC_2.0 __progname_full +00000000 DO *UND* 00000000 GLIBC_2.0 optind +00000000 DF *UND* 00000000 GLIBC_2.0 dcgettext +00000000 DF *UND* 00000000 GLIBC_2.0 mktime +00000000 DF *UND* 00000000 GLIBC_2.4 __stack_chk_fail +00000000 DF *UND* 00000000 GLIBC_2.0 localtime_r +00000000 DF *UND* 00000000 GLIBC_2.0 sigismember +00000000 DF *UND* 00000000 fgetfilecon +00000000 DF *UND* 00000000 GLIBC_2.0 fflush_unlocked +00000000 DF *UND* 00000000 GLIBC_2.0 iswcntrl +00000000 DF *UND* 00000000 GLIBC_2.0 textdomain +00000000 DF *UND* 00000000 GLIBC_2.0 readlink +00000000 DF *UND* 00000000 GLIBC_2.2.3 fnmatch +00000000 DF *UND* 00000000 GLIBC_2.0 iswprint +00000000 DF *UND* 00000000 GLIBC_2.0 ioctl +00000000 w DF *UND* 00000000 GLIBC_2.1.3 __cxa_finalize +00000000 DF *UND* 00000000 GLIBC_2.0 fwrite +00000000 DF *UND* 00000000 GLIBC_2.2 __fxstat64 +00000000 DF *UND* 00000000 GLIBC_2.0 tzset +00000000 DF *UND* 00000000 GLIBC_2.0 __ctype_get_mb_cur_max +00000000 DF *UND* 00000000 GLIBC_2.0 strcpy +00000000 DF *UND* 00000000 GLIBC_2.2 __fpending +00000000 DF *UND* 00000000 GLIBC_2.0 wcstombs +00000000 DF *UND* 00000000 GLIBC_2.0 mbrtowc +00000000 DF *UND* 00000000 GLIBC_2.0 gethostname +00000000 DF *UND* 00000000 GLIBC_2.1.3 __cxa_atexit +00000000 DF *UND* 00000000 GLIBC_2.0 error +00000000 DF *UND* 00000000 GLIBC_2.0 strcoll +00000000 DF *UND* 00000000 GLIBC_2.0 getenv +00000000 DF *UND* 00000000 GLIBC_2.0 realloc +00000000 DF *UND* 00000000 lgetfilecon +00000000 DF *UND* 00000000 GLIBC_2.0 malloc +00000000 DF *UND* 00000000 GLIBC_2.0 timegm +00000000 DF *UND* 00000000 GLIBC_2.2 __freading +00000000 DF *UND* 00000000 GLIBC_2.3.4 __memcpy_chk 00000000 w D *UND* 00000000 __gmon_start__ -00000000 w D *UND* 00000000 _Jv_RegisterClasses -00000000 DF *UND* 00000490 GLIBC_2.0 realloc -00000000 DF *UND* 0000003f GLIBC_2.2 __xstat64 -00000000 DF *UND* 00000035 GLIBC_2.0 localtime -00000000 DF *UND* 00000132 GLIBC_2.0 getgrnam -00000000 DF *UND* 00000167 GLIBC_2.0 strchr -00000000 DF *UND* 000000dc GLIBC_2.0 getenv -00000000 DF *UND* 00000304 GLIBC_2.0 calloc -00000000 DF *UND* 000000c6 GLIBC_2.0 strncpy -00000000 DF *UND* 00000023 freecon -00000000 DF *UND* 00000058 GLIBC_2.0 memset -00000000 DF *UND* 000001b2 GLIBC_2.0 __libc_start_main -00000000 DF *UND* 00000044 GLIBC_2.1 mempcpy -00000000 DF *UND* 000000c9 GLIBC_2.0 _obstack_begin -00000000 DF *UND* 000001b9 GLIBC_2.0 strrchr -00000000 DF *UND* 00000038 GLIBC_2.0 chmod -00000000 DF *UND* 00000150 GLIBC_2.0 __assert_fail -00000000 DF *UND* 00000015 GLIBC_2.0 bindtextdomain -00000000 DF *UND* 00000215 GLIBC_2.0 mbrtowc -00000000 DF *UND* 00000046 ACL_1.0 acl_delete_def_file -00000000 DF *UND* 00000038 GLIBC_2.0 gettimeofday -00000000 DF *UND* 0000003c GLIBC_2.3 __ctype_toupper_loc -00000000 DF *UND* 0000003f GLIBC_2.2 __lxstat64 -00000000 DF *UND* 00000195 GLIBC_2.0 _obstack_newchunk -00000000 DF *UND* 00000066 GLIBC_2.0 __overflow -00000000 DF *UND* 00000049 GLIBC_2.0 dcgettext -00000000 DF *UND* 00000160 GLIBC_2.0 sigaction -00000000 DF *UND* 00000127 GLIBC_2.1 strverscmp -00000000 DF *UND* 00000092 GLIBC_2.0 opendir -00000000 DF *UND* 00000047 GLIBC_2.0 getopt_long -00000000 DF *UND* 0000003a GLIBC_2.0 ioctl -00000000 DF *UND* 0000003c GLIBC_2.3 __ctype_b_loc -00000000 DF *UND* 000000c9 GLIBC_2.0 iswcntrl -00000000 DF *UND* 00000032 GLIBC_2.0 isatty -00000000 DF *UND* 000001e8 GLIBC_2.1 fclose -00000000 DF *UND* 00000019 GLIBC_2.0 mbsinit -00000000 DF *UND* 00000036 GLIBC_2.0 _setjmp -00000000 DF *UND* 00000038 GLIBC_2.0 tcgetpgrp -00000000 DF *UND* 0000003c GLIBC_2.0 mktime -00000000 DF *UND* 000000af GLIBC_2.2 readdir64 -00000000 DF *UND* 00000046 GLIBC_2.0 memcpy -00000000 DF *UND* 000000af GLIBC_2.0 strlen -00000000 DF *UND* 00000132 GLIBC_2.0 getpwuid -00000000 DF *UND* 00000094 ACL_1.0 acl_extended_file -00000000 DF *UND* 00000195 ACL_1.0 acl_get_file -00000000 DF *UND* 000006b5 GLIBC_2.0 setlocale -00000000 DF *UND* 0000002a ACL_1.0 acl_entries -00000000 DF *UND* 00000024 GLIBC_2.0 strcpy -00000000 DF *UND* 00000039 GLIBC_2.0 printf -00000000 DF *UND* 0000008c GLIBC_2.0 raise -00000000 DF *UND* 000000a2 GLIBC_2.1 fwrite_unlocked -00000000 DF *UND* 00000115 GLIBC_2.2 clock_gettime -00000000 DF *UND* 00000075 getfilecon -00000000 DF *UND* 00000055 GLIBC_2.0 closedir -00000000 DF *UND* 00000024 GLIBC_2.0 fprintf -00000000 DF *UND* 00000114 ACL_1.0 acl_set_file -00000000 DF *UND* 0000009e GLIBC_2.0 sigprocmask -00000000 DF *UND* 0000002a GLIBC_2.2 __fpending -00000000 DF *UND* 00000075 lgetfilecon -00000000 DF *UND* 000000d7 GLIBC_2.0 error -00000000 DF *UND* 00000132 GLIBC_2.0 getgrgid -00000000 DF *UND* 00000045 GLIBC_2.0 __strtoull_internal -00000000 DF *UND* 0000006a GLIBC_2.0 sigaddset -00000000 DF *UND* 0000003a GLIBC_2.0 readlink -00000000 DF *UND* 0000008e GLIBC_2.0 memmove -00000000 DF *UND* 0000003c GLIBC_2.3 __ctype_tolower_loc -00000000 DF *UND* 00000045 GLIBC_2.0 __strtoul_internal -00000000 DF *UND* 0000011d GLIBC_2.0 textdomain -00000000 DF *UND* 0000003f GLIBC_2.2 __fxstat64 -00000000 DF *UND* 000002d9 GLIBC_2.2.3 fnmatch -00000000 DF *UND* 000000f3 GLIBC_2.0 strncmp -00000000 DF *UND* 00004373 GLIBC_2.0 vfprintf -00000000 DF *UND* 0000006e ACL_1.0 acl_free -00000000 DF *UND* 00000042 GLIBC_2.0 fflush_unlocked -00000000 DF *UND* 00000045 GLIBC_2.0 strftime -00000000 DF *UND* 00000078 GLIBC_2.0 wcwidth -00000000 DF *UND* 000000cb GLIBC_2.0 iswprint -00000000 DF *UND* 00000132 GLIBC_2.0 getpwnam -00000000 DF *UND* 00000054 GLIBC_2.0 strcmp -00000000 DF *UND* 000000fa GLIBC_2.0 exit -00000000 DF *UND* 000004bc ACL_1.0 acl_from_text -0805bc90 g D *ABS* 00000000 Base _end -0805b860 g DO .bss 00000004 GLIBC_2.0 stdout -0805b82c g D *ABS* 00000000 Base _edata -080567a4 g DO .rodata 00000004 Base _IO_stdin_used -08049780 DF *UND* 000001e5 GLIBC_2.0 free -0805b844 g DO .bss 00000004 GLIBC_2.0 stderr -0805b82c g D *ABS* 00000000 Base __bss_start -080499a0 DF *UND* 00000178 GLIBC_2.0 malloc -08049510 g DF .init 00000000 Base _init -08056768 g DF .fini 00000000 Base _fini -0805b840 g DO .bss 00000004 GLIBC_2.0 optind -0805b864 g DO .bss 00000004 GLIBC_2.0 optarg +00000000 DF *UND* 00000000 GLIBC_2.0 exit +00000000 DF *UND* 00000000 GLIBC_2.1 fdopen +00000000 DF *UND* 00000000 GLIBC_2.1 fputs_unlocked +00000000 DF *UND* 00000000 GLIBC_2.0 strftime +00000000 DF *UND* 00000000 GLIBC_2.0 getopt_long +00000000 DF *UND* 00000000 getfilecon +00000000 DF *UND* 00000000 GLIBC_2.0 strtoul +00000000 DF *UND* 00000000 GLIBC_2.0 strchr +00000000 DF *UND* 00000000 GLIBC_2.0 getcwd +00000000 DF *UND* 00000000 GLIBC_2.0 fscanf +00000000 DF *UND* 00000000 GLIBC_2.0 strlen +00000000 DF *UND* 00000000 GLIBC_2.0 setenv +00000000 DF *UND* 00000000 GLIBC_2.0 __libc_start_main +00000000 DF *UND* 00000000 GLIBC_2.0 sigaddset +00000000 DF *UND* 00000000 GLIBC_2.0 memset +00000000 DF *UND* 00000000 GLIBC_2.0 ungetc +00000000 DF *UND* 00000000 GLIBC_2.0 snprintf +00000000 DF *UND* 00000000 GLIBC_2.0 __errno_location +00000000 DF *UND* 00000000 GLIBC_2.0 tcgetpgrp +00000000 DF *UND* 00000000 GLIBC_2.0 fileno +00000000 DF *UND* 00000000 GLIBC_2.0 stpncpy +00000000 DO *UND* 00000000 GLIBC_2.0 stdout +00000000 DF *UND* 00000000 GLIBC_2.1 fwrite_unlocked +00000000 DF *UND* 00000000 GLIBC_2.3.4 __printf_chk +00000000 DF *UND* 00000000 GLIBC_2.1 mempcpy +00000000 DF *UND* 00000000 GLIBC_2.0 wcswidth +00000000 DF *UND* 00000000 GLIBC_2.0 sigemptyset +00000000 DF *UND* 00000000 GLIBC_2.0 __uflow +00000000 DO *UND* 00000000 GLIBC_2.0 program_invocation_name +00000000 DF *UND* 00000000 GLIBC_2.1 __rawmemchr +00000000 DF *UND* 00000000 GLIBC_2.0 nl_langinfo +00000000 DF *UND* 00000000 GLIBC_2.0 setlocale +00000000 DF *UND* 00000000 GLIBC_2.0 strrchr +00000000 DF *UND* 00000000 GLIBC_2.0 __overflow +00000000 DF *UND* 00000000 GLIBC_2.0 mbstowcs +00000000 DF *UND* 00000000 GLIBC_2.0 gmtime_r +00000000 DF *UND* 00000000 GLIBC_2.2 localeconv +00000000 DF *UND* 00000000 GLIBC_2.3 getxattr +00000000 DF *UND* 00000000 freecon +00000000 DF *UND* 00000000 GLIBC_2.1 lseek64 +00000000 DF *UND* 00000000 GLIBC_2.2 readdir64 +00000000 DO *UND* 00000000 GLIBC_2.0 program_invocation_short_name +00000000 DF *UND* 00000000 GLIBC_2.3.4 __fprintf_chk +00000000 DF *UND* 00000000 GLIBC_2.0 sigaction +00000000 DF *UND* 00000000 GLIBC_2.0 bindtextdomain +00000000 w D *UND* 00000000 _ITM_registerTMCloneTable +00000000 DF *UND* 00000000 GLIBC_2.0 strncmp +00000000 DF *UND* 00000000 GLIBC_2.0 isatty +00000000 DF *UND* 00000000 GLIBC_2.0 abort +00000000 DF *UND* 00000000 GLIBC_2.2 __xstat64 +00000000 DO *UND* 00000000 GLIBC_2.0 optarg +00000000 DF *UND* 00000000 GLIBC_2.2 __lxstat64 +00000000 DF *UND* 00000000 GLIBC_2.0 getgrnam +00000000 DF *UND* 00000000 GLIBC_2.0 close +00000000 DF *UND* 00000000 GLIBC_2.0 closedir +00000000 DF *UND* 00000000 GLIBC_2.0 strspn +00000000 DF *UND* 00000000 GLIBC_2.0 opendir +00000000 DF *UND* 00000000 GLIBC_2.0 getgrgid +00000000 DF *UND* 00000000 GLIBC_2.3 __ctype_tolower_loc +00000000 DF *UND* 00000000 GLIBC_2.0 __assert_fail +00000000 DF *UND* 00000000 GLIBC_2.3 __ctype_b_loc +00000000 DF *UND* 00000000 GLIBC_2.0 calloc +00000000 DF *UND* 00000000 GLIBC_2.3.4 __sprintf_chk +00024340 g DO .data 00000004 Base obstack_alloc_failed_handler +00014ed0 g DF .text 000000fb Base _obstack_newchunk +00024344 g D .data 00000000 Base _edata +00014ea0 g DF .text 0000002a Base _obstack_begin_1 +00014fd0 g DF .text 00000030 Base _obstack_allocated_p +000254d4 g D .bss 00000000 Base _end +00014e70 g DF .text 00000023 Base _obstack_begin +00016544 g DO .rodata 00000004 Base _IO_stdin_used +00015080 g DF .text 00000022 Base _obstack_memory_used +00024344 g D .bss 00000000 Base __bss_start +00001ce8 g DF .init 00000000 Base _init +00016524 g DF .fini 00000000 Base _fini +00015000 g DF .text 00000071 Base _obstack_free DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE -0805b5d4 R_386_GLOB_DAT __gmon_start__ -0805b8a0 R_386_COPY optind -0805b8a4 R_386_COPY stderr -0805b8c0 R_386_COPY stdout -0805b8c4 R_386_COPY optarg -0805b5e8 R_386_JUMP_SLOT abort -0805b5ec R_386_JUMP_SLOT __errno_location -0805b5f0 R_386_JUMP_SLOT sigemptyset -0805b5f4 R_386_JUMP_SLOT sprintf -0805b5f8 R_386_JUMP_SLOT localeconv -0805b5fc R_386_JUMP_SLOT dirfd -0805b600 R_386_JUMP_SLOT __cxa_atexit -0805b604 R_386_JUMP_SLOT strcoll -0805b608 R_386_JUMP_SLOT qsort -0805b60c R_386_JUMP_SLOT fputs_unlocked -0805b610 R_386_JUMP_SLOT __ctype_get_mb_cur_max -0805b614 R_386_JUMP_SLOT signal -0805b618 R_386_JUMP_SLOT sigismember -0805b61c R_386_JUMP_SLOT __gmon_start__ -0805b620 R_386_JUMP_SLOT realloc -0805b624 R_386_JUMP_SLOT __xstat64 -0805b628 R_386_JUMP_SLOT localtime -0805b62c R_386_JUMP_SLOT getgrnam -0805b630 R_386_JUMP_SLOT strchr -0805b634 R_386_JUMP_SLOT getenv -0805b638 R_386_JUMP_SLOT calloc -0805b63c R_386_JUMP_SLOT strncpy -0805b640 R_386_JUMP_SLOT freecon -0805b644 R_386_JUMP_SLOT memset -0805b648 R_386_JUMP_SLOT __libc_start_main -0805b64c R_386_JUMP_SLOT mempcpy -0805b650 R_386_JUMP_SLOT _obstack_begin -0805b654 R_386_JUMP_SLOT strrchr -0805b658 R_386_JUMP_SLOT chmod -0805b65c R_386_JUMP_SLOT __assert_fail -0805b660 R_386_JUMP_SLOT bindtextdomain -0805b664 R_386_JUMP_SLOT mbrtowc -0805b668 R_386_JUMP_SLOT acl_delete_def_file -0805b66c R_386_JUMP_SLOT gettimeofday -0805b670 R_386_JUMP_SLOT __ctype_toupper_loc -0805b674 R_386_JUMP_SLOT free -0805b678 R_386_JUMP_SLOT __lxstat64 -0805b67c R_386_JUMP_SLOT _obstack_newchunk -0805b680 R_386_JUMP_SLOT __overflow -0805b684 R_386_JUMP_SLOT dcgettext -0805b688 R_386_JUMP_SLOT sigaction -0805b68c R_386_JUMP_SLOT strverscmp -0805b690 R_386_JUMP_SLOT opendir -0805b694 R_386_JUMP_SLOT getopt_long -0805b698 R_386_JUMP_SLOT ioctl -0805b69c R_386_JUMP_SLOT __ctype_b_loc -0805b6a0 R_386_JUMP_SLOT iswcntrl -0805b6a4 R_386_JUMP_SLOT isatty -0805b6a8 R_386_JUMP_SLOT fclose -0805b6ac R_386_JUMP_SLOT mbsinit -0805b6b0 R_386_JUMP_SLOT _setjmp -0805b6b4 R_386_JUMP_SLOT tcgetpgrp -0805b6b8 R_386_JUMP_SLOT mktime -0805b6bc R_386_JUMP_SLOT readdir64 -0805b6c0 R_386_JUMP_SLOT memcpy -0805b6c4 R_386_JUMP_SLOT strtoul -0805b6c8 R_386_JUMP_SLOT strlen -0805b6cc R_386_JUMP_SLOT getpwuid -0805b6d0 R_386_JUMP_SLOT acl_extended_file -0805b6d4 R_386_JUMP_SLOT acl_get_file -0805b6d8 R_386_JUMP_SLOT setlocale -0805b6dc R_386_JUMP_SLOT acl_entries -0805b6e0 R_386_JUMP_SLOT strcpy -0805b6e4 R_386_JUMP_SLOT printf -0805b6e8 R_386_JUMP_SLOT raise -0805b6ec R_386_JUMP_SLOT fwrite_unlocked -0805b6f0 R_386_JUMP_SLOT clock_gettime -0805b6f4 R_386_JUMP_SLOT getfilecon -0805b6f8 R_386_JUMP_SLOT closedir -0805b6fc R_386_JUMP_SLOT fprintf -0805b700 R_386_JUMP_SLOT malloc -0805b704 R_386_JUMP_SLOT acl_set_file -0805b708 R_386_JUMP_SLOT sigprocmask -0805b70c R_386_JUMP_SLOT __fpending -0805b710 R_386_JUMP_SLOT lgetfilecon -0805b714 R_386_JUMP_SLOT error -0805b718 R_386_JUMP_SLOT getgrgid -0805b71c R_386_JUMP_SLOT __strtoull_internal -0805b720 R_386_JUMP_SLOT sigaddset -0805b724 R_386_JUMP_SLOT readlink -0805b728 R_386_JUMP_SLOT memmove -0805b72c R_386_JUMP_SLOT __ctype_tolower_loc -0805b730 R_386_JUMP_SLOT textdomain -0805b734 R_386_JUMP_SLOT __fxstat64 -0805b738 R_386_JUMP_SLOT fnmatch -0805b73c R_386_JUMP_SLOT strncmp -0805b740 R_386_JUMP_SLOT vfprintf -0805b744 R_386_JUMP_SLOT acl_free -0805b748 R_386_JUMP_SLOT fflush_unlocked -0805b74c R_386_JUMP_SLOT strftime -0805b750 R_386_JUMP_SLOT wcwidth -0805b754 R_386_JUMP_SLOT iswprint -0805b758 R_386_JUMP_SLOT getpwnam -0805b75c R_386_JUMP_SLOT strcmp -0805b760 R_386_JUMP_SLOT exit -0805b764 R_386_JUMP_SLOT acl_from_text +000239b8 R_386_RELATIVE *ABS* +000239bc R_386_RELATIVE *ABS* +000239c0 R_386_RELATIVE *ABS* +000239c4 R_386_RELATIVE *ABS* +000239c8 R_386_RELATIVE *ABS* +000239cc R_386_RELATIVE *ABS* +000239d0 R_386_RELATIVE *ABS* +000239d4 R_386_RELATIVE *ABS* +000239d8 R_386_RELATIVE *ABS* +000239dc R_386_RELATIVE *ABS* +000239e0 R_386_RELATIVE *ABS* +000239e4 R_386_RELATIVE *ABS* +000239e8 R_386_RELATIVE *ABS* +000239ec R_386_RELATIVE *ABS* +000239f0 R_386_RELATIVE *ABS* +000239f4 R_386_RELATIVE *ABS* +000239f8 R_386_RELATIVE *ABS* +000239fc R_386_RELATIVE *ABS* +00023a00 R_386_RELATIVE *ABS* +00023a04 R_386_RELATIVE *ABS* +00023a08 R_386_RELATIVE *ABS* +00023a0c R_386_RELATIVE *ABS* +00023a10 R_386_RELATIVE *ABS* +00023a14 R_386_RELATIVE *ABS* +00023a18 R_386_RELATIVE *ABS* +00023a1c R_386_RELATIVE *ABS* +00023a20 R_386_RELATIVE *ABS* +00023a24 R_386_RELATIVE *ABS* +00023a28 R_386_RELATIVE *ABS* +00023a2c R_386_RELATIVE *ABS* +00023a40 R_386_RELATIVE *ABS* +00023a44 R_386_RELATIVE *ABS* +00023a48 R_386_RELATIVE *ABS* +00023a4c R_386_RELATIVE *ABS* +00023a50 R_386_RELATIVE *ABS* +00023a54 R_386_RELATIVE *ABS* +00023a58 R_386_RELATIVE *ABS* +00023a5c R_386_RELATIVE *ABS* +00023a60 R_386_RELATIVE *ABS* +00023a64 R_386_RELATIVE *ABS* +00023a68 R_386_RELATIVE *ABS* +00023a6c R_386_RELATIVE *ABS* +00023a70 R_386_RELATIVE *ABS* +00023a74 R_386_RELATIVE *ABS* +00023a78 R_386_RELATIVE *ABS* +00023a7c R_386_RELATIVE *ABS* +00023a80 R_386_RELATIVE *ABS* +00023a84 R_386_RELATIVE *ABS* +00023a88 R_386_RELATIVE *ABS* +00023a8c R_386_RELATIVE *ABS* +00023a90 R_386_RELATIVE *ABS* +00023a94 R_386_RELATIVE *ABS* +00023a98 R_386_RELATIVE *ABS* +00023a9c R_386_RELATIVE *ABS* +00023aa0 R_386_RELATIVE *ABS* +00023aa4 R_386_RELATIVE *ABS* +00023aa8 R_386_RELATIVE *ABS* +00023aac R_386_RELATIVE *ABS* +00023ab0 R_386_RELATIVE *ABS* +00023ab4 R_386_RELATIVE *ABS* +00023ab8 R_386_RELATIVE *ABS* +00023abc R_386_RELATIVE *ABS* +00023ac0 R_386_RELATIVE *ABS* +00023ac8 R_386_RELATIVE *ABS* +00023acc R_386_RELATIVE *ABS* +00023ad0 R_386_RELATIVE *ABS* +00023ad4 R_386_RELATIVE *ABS* +00023ad8 R_386_RELATIVE *ABS* +00023ae0 R_386_RELATIVE *ABS* +00023ae4 R_386_RELATIVE *ABS* +00023ae8 R_386_RELATIVE *ABS* +00023aec R_386_RELATIVE *ABS* +00023af0 R_386_RELATIVE *ABS* +00023b00 R_386_RELATIVE *ABS* +00023b04 R_386_RELATIVE *ABS* +00023b08 R_386_RELATIVE *ABS* +00023b0c R_386_RELATIVE *ABS* +00023b10 R_386_RELATIVE *ABS* +00023b14 R_386_RELATIVE *ABS* +00023b18 R_386_RELATIVE *ABS* +00023b20 R_386_RELATIVE *ABS* +00023b30 R_386_RELATIVE *ABS* +00023b40 R_386_RELATIVE *ABS* +00023b50 R_386_RELATIVE *ABS* +00023b60 R_386_RELATIVE *ABS* +00023b70 R_386_RELATIVE *ABS* +00023b80 R_386_RELATIVE *ABS* +00023b90 R_386_RELATIVE *ABS* +00023ba0 R_386_RELATIVE *ABS* +00023bb0 R_386_RELATIVE *ABS* +00023bc0 R_386_RELATIVE *ABS* +00023bd0 R_386_RELATIVE *ABS* +00023be0 R_386_RELATIVE *ABS* +00023bf0 R_386_RELATIVE *ABS* +00023c00 R_386_RELATIVE *ABS* +00023c10 R_386_RELATIVE *ABS* +00023c20 R_386_RELATIVE *ABS* +00023c30 R_386_RELATIVE *ABS* +00023c40 R_386_RELATIVE *ABS* +00023c50 R_386_RELATIVE *ABS* +00023c60 R_386_RELATIVE *ABS* +00023c70 R_386_RELATIVE *ABS* +00023c80 R_386_RELATIVE *ABS* +00023c90 R_386_RELATIVE *ABS* +00023ca0 R_386_RELATIVE *ABS* +00023cb0 R_386_RELATIVE *ABS* +00023cc0 R_386_RELATIVE *ABS* +00023cd0 R_386_RELATIVE *ABS* +00023ce0 R_386_RELATIVE *ABS* +00023cf0 R_386_RELATIVE *ABS* +00023d00 R_386_RELATIVE *ABS* +00023d10 R_386_RELATIVE *ABS* +00023d20 R_386_RELATIVE *ABS* +00023d30 R_386_RELATIVE *ABS* +00023d40 R_386_RELATIVE *ABS* +00023d50 R_386_RELATIVE *ABS* +00023d60 R_386_RELATIVE *ABS* +00023d70 R_386_RELATIVE *ABS* +00023d80 R_386_RELATIVE *ABS* +00023d90 R_386_RELATIVE *ABS* +00023da0 R_386_RELATIVE *ABS* +00023db0 R_386_RELATIVE *ABS* +00023dc0 R_386_RELATIVE *ABS* +00023de0 R_386_RELATIVE *ABS* +00023de4 R_386_RELATIVE *ABS* +00023de8 R_386_RELATIVE *ABS* +00023dec R_386_RELATIVE *ABS* +00023df0 R_386_RELATIVE *ABS* +00023df4 R_386_RELATIVE *ABS* +00023df8 R_386_RELATIVE *ABS* +00023dfc R_386_RELATIVE *ABS* +00023e00 R_386_RELATIVE *ABS* +00023e04 R_386_RELATIVE *ABS* +00023e08 R_386_RELATIVE *ABS* +00023e0c R_386_RELATIVE *ABS* +00023e10 R_386_RELATIVE *ABS* +00023e14 R_386_RELATIVE *ABS* +00023e18 R_386_RELATIVE *ABS* +00023e1c R_386_RELATIVE *ABS* +00023e20 R_386_RELATIVE *ABS* +00023e24 R_386_RELATIVE *ABS* +00023e28 R_386_RELATIVE *ABS* +00023e2c R_386_RELATIVE *ABS* +00023e30 R_386_RELATIVE *ABS* +00023e34 R_386_RELATIVE *ABS* +00023e38 R_386_RELATIVE *ABS* +00023e3c R_386_RELATIVE *ABS* +00023e44 R_386_RELATIVE *ABS* +00023e48 R_386_RELATIVE *ABS* +00023e4c R_386_RELATIVE *ABS* +00023e50 R_386_RELATIVE *ABS* +00023e58 R_386_RELATIVE *ABS* +00023e5c R_386_RELATIVE *ABS* +00023e60 R_386_RELATIVE *ABS* +00023e64 R_386_RELATIVE *ABS* +00023e6c R_386_RELATIVE *ABS* +00023e70 R_386_RELATIVE *ABS* +00023e80 R_386_RELATIVE *ABS* +00023e84 R_386_RELATIVE *ABS* +00023e88 R_386_RELATIVE *ABS* +00023e8c R_386_RELATIVE *ABS* +00023e90 R_386_RELATIVE *ABS* +00023e94 R_386_RELATIVE *ABS* +00023e98 R_386_RELATIVE *ABS* +00023e9c R_386_RELATIVE *ABS* +00023ea0 R_386_RELATIVE *ABS* +00023ea4 R_386_RELATIVE *ABS* +00023fb8 R_386_RELATIVE *ABS* +00023fc0 R_386_RELATIVE *ABS* +00023fc8 R_386_RELATIVE *ABS* +00023fd0 R_386_RELATIVE *ABS* +00023fd8 R_386_RELATIVE *ABS* +000241e4 R_386_RELATIVE *ABS* +00024200 R_386_RELATIVE *ABS* +00024204 R_386_RELATIVE *ABS* +00024224 R_386_RELATIVE *ABS* +0002422c R_386_RELATIVE *ABS* +0002423c R_386_RELATIVE *ABS* +00024254 R_386_RELATIVE *ABS* +0002425c R_386_RELATIVE *ABS* +00024264 R_386_RELATIVE *ABS* +0002426c R_386_RELATIVE *ABS* +00024274 R_386_RELATIVE *ABS* +0002427c R_386_RELATIVE *ABS* +00024294 R_386_RELATIVE *ABS* +0002429c R_386_RELATIVE *ABS* +000242a4 R_386_RELATIVE *ABS* +000242ac R_386_RELATIVE *ABS* +000242b4 R_386_RELATIVE *ABS* +000242bc R_386_RELATIVE *ABS* +000242c4 R_386_RELATIVE *ABS* +000242cc R_386_RELATIVE *ABS* +000242dc R_386_RELATIVE *ABS* +000242e4 R_386_RELATIVE *ABS* +000242e8 R_386_RELATIVE *ABS* +00024334 R_386_RELATIVE *ABS* +0002433c R_386_RELATIVE *ABS* +00024340 R_386_RELATIVE *ABS* +00023fa4 R_386_GLOB_DAT _ITM_deregisterTMCloneTable +00023fa8 R_386_GLOB_DAT stderr@GLIBC_2.0 +00023fac R_386_GLOB_DAT free@GLIBC_2.0 +00023fb0 R_386_GLOB_DAT optind@GLIBC_2.0 +00023fb4 R_386_GLOB_DAT __cxa_finalize@GLIBC_2.1.3 +00023fbc R_386_GLOB_DAT malloc@GLIBC_2.0 +00023fc4 R_386_GLOB_DAT __gmon_start__ +00023fcc R_386_GLOB_DAT stdout@GLIBC_2.0 +00023fd4 R_386_GLOB_DAT program_invocation_name@GLIBC_2.0 +00023fdc R_386_GLOB_DAT program_invocation_short_name@GLIBC_2.0 +00023fe0 R_386_GLOB_DAT _ITM_registerTMCloneTable +00023fe4 R_386_GLOB_DAT optarg@GLIBC_2.0 +0002400c R_386_JUMP_SLOT __ctype_toupper_loc@GLIBC_2.3 +00024010 R_386_JUMP_SLOT unsetenv@GLIBC_2.0 +00024014 R_386_JUMP_SLOT getpwnam@GLIBC_2.0 +00024018 R_386_JUMP_SLOT raise@GLIBC_2.0 +0002401c R_386_JUMP_SLOT __snprintf_chk@GLIBC_2.3.4 +00024020 R_386_JUMP_SLOT strcmp@GLIBC_2.0 +00024024 R_386_JUMP_SLOT open64@GLIBC_2.1 +00024028 R_386_JUMP_SLOT getpwuid@GLIBC_2.0 +0002402c R_386_JUMP_SLOT fflush@GLIBC_2.0 +00024030 R_386_JUMP_SLOT _exit@GLIBC_2.0 +00024034 R_386_JUMP_SLOT sigprocmask@GLIBC_2.0 +00024038 R_386_JUMP_SLOT dirfd@GLIBC_2.0 +0002403c R_386_JUMP_SLOT wcwidth@GLIBC_2.0 +00024040 R_386_JUMP_SLOT memmove@GLIBC_2.0 +00024044 R_386_JUMP_SLOT _setjmp@GLIBC_2.0 +00024048 R_386_JUMP_SLOT memcpy@GLIBC_2.0 +0002404c R_386_JUMP_SLOT mbsinit@GLIBC_2.0 +00024050 R_386_JUMP_SLOT clock_gettime@GLIBC_2.17 +00024054 R_386_JUMP_SLOT __strtoull_internal@GLIBC_2.0 +00024058 R_386_JUMP_SLOT fclose@GLIBC_2.1 +0002405c R_386_JUMP_SLOT fseeko64@GLIBC_2.1 +00024060 R_386_JUMP_SLOT signal@GLIBC_2.0 +00024064 R_386_JUMP_SLOT memcmp@GLIBC_2.0 +00024068 R_386_JUMP_SLOT gettimeofday@GLIBC_2.0 +0002406c R_386_JUMP_SLOT dcgettext@GLIBC_2.0 +00024070 R_386_JUMP_SLOT mktime@GLIBC_2.0 +00024074 R_386_JUMP_SLOT __stack_chk_fail@GLIBC_2.4 +00024078 R_386_JUMP_SLOT localtime_r@GLIBC_2.0 +0002407c R_386_JUMP_SLOT sigismember@GLIBC_2.0 +00024080 R_386_JUMP_SLOT fgetfilecon +00024084 R_386_JUMP_SLOT fflush_unlocked@GLIBC_2.0 +00024088 R_386_JUMP_SLOT iswcntrl@GLIBC_2.0 +0002408c R_386_JUMP_SLOT textdomain@GLIBC_2.0 +00024090 R_386_JUMP_SLOT readlink@GLIBC_2.0 +00024094 R_386_JUMP_SLOT fnmatch@GLIBC_2.2.3 +00024098 R_386_JUMP_SLOT iswprint@GLIBC_2.0 +0002409c R_386_JUMP_SLOT ioctl@GLIBC_2.0 +000240a0 R_386_JUMP_SLOT fwrite@GLIBC_2.0 +000240a4 R_386_JUMP_SLOT __fxstat64@GLIBC_2.2 +000240a8 R_386_JUMP_SLOT tzset@GLIBC_2.0 +000240ac R_386_JUMP_SLOT __ctype_get_mb_cur_max@GLIBC_2.0 +000240b0 R_386_JUMP_SLOT strcpy@GLIBC_2.0 +000240b4 R_386_JUMP_SLOT __fpending@GLIBC_2.2 +000240b8 R_386_JUMP_SLOT wcstombs@GLIBC_2.0 +000240bc R_386_JUMP_SLOT mbrtowc@GLIBC_2.0 +000240c0 R_386_JUMP_SLOT gethostname@GLIBC_2.0 +000240c4 R_386_JUMP_SLOT __cxa_atexit@GLIBC_2.1.3 +000240c8 R_386_JUMP_SLOT error@GLIBC_2.0 +000240cc R_386_JUMP_SLOT strcoll@GLIBC_2.0 +000240d0 R_386_JUMP_SLOT getenv@GLIBC_2.0 +000240d4 R_386_JUMP_SLOT realloc@GLIBC_2.0 +000240d8 R_386_JUMP_SLOT lgetfilecon +000240dc R_386_JUMP_SLOT timegm@GLIBC_2.0 +000240e0 R_386_JUMP_SLOT __freading@GLIBC_2.2 +000240e4 R_386_JUMP_SLOT __memcpy_chk@GLIBC_2.3.4 +000240e8 R_386_JUMP_SLOT exit@GLIBC_2.0 +000240ec R_386_JUMP_SLOT fdopen@GLIBC_2.1 +000240f0 R_386_JUMP_SLOT fputs_unlocked@GLIBC_2.1 +000240f4 R_386_JUMP_SLOT strftime@GLIBC_2.0 +000240f8 R_386_JUMP_SLOT getopt_long@GLIBC_2.0 +000240fc R_386_JUMP_SLOT getfilecon +00024100 R_386_JUMP_SLOT strtoul@GLIBC_2.0 +00024104 R_386_JUMP_SLOT strchr@GLIBC_2.0 +00024108 R_386_JUMP_SLOT getcwd@GLIBC_2.0 +0002410c R_386_JUMP_SLOT fscanf@GLIBC_2.0 +00024110 R_386_JUMP_SLOT strlen@GLIBC_2.0 +00024114 R_386_JUMP_SLOT setenv@GLIBC_2.0 +00024118 R_386_JUMP_SLOT __libc_start_main@GLIBC_2.0 +0002411c R_386_JUMP_SLOT sigaddset@GLIBC_2.0 +00024120 R_386_JUMP_SLOT memset@GLIBC_2.0 +00024124 R_386_JUMP_SLOT ungetc@GLIBC_2.0 +00024128 R_386_JUMP_SLOT snprintf@GLIBC_2.0 +0002412c R_386_JUMP_SLOT __errno_location@GLIBC_2.0 +00024130 R_386_JUMP_SLOT tcgetpgrp@GLIBC_2.0 +00024134 R_386_JUMP_SLOT fileno@GLIBC_2.0 +00024138 R_386_JUMP_SLOT stpncpy@GLIBC_2.0 +0002413c R_386_JUMP_SLOT fwrite_unlocked@GLIBC_2.1 +00024140 R_386_JUMP_SLOT __printf_chk@GLIBC_2.3.4 +00024144 R_386_JUMP_SLOT mempcpy@GLIBC_2.1 +00024148 R_386_JUMP_SLOT wcswidth@GLIBC_2.0 +0002414c R_386_JUMP_SLOT sigemptyset@GLIBC_2.0 +00024150 R_386_JUMP_SLOT __uflow@GLIBC_2.0 +00024154 R_386_JUMP_SLOT __rawmemchr@GLIBC_2.1 +00024158 R_386_JUMP_SLOT nl_langinfo@GLIBC_2.0 +0002415c R_386_JUMP_SLOT setlocale@GLIBC_2.0 +00024160 R_386_JUMP_SLOT strrchr@GLIBC_2.0 +00024164 R_386_JUMP_SLOT __overflow@GLIBC_2.0 +00024168 R_386_JUMP_SLOT mbstowcs@GLIBC_2.0 +0002416c R_386_JUMP_SLOT gmtime_r@GLIBC_2.0 +00024170 R_386_JUMP_SLOT localeconv@GLIBC_2.2 +00024174 R_386_JUMP_SLOT getxattr@GLIBC_2.3 +00024178 R_386_JUMP_SLOT freecon +0002417c R_386_JUMP_SLOT lseek64@GLIBC_2.1 +00024180 R_386_JUMP_SLOT readdir64@GLIBC_2.2 +00024184 R_386_JUMP_SLOT __fprintf_chk@GLIBC_2.3.4 +00024188 R_386_JUMP_SLOT sigaction@GLIBC_2.0 +0002418c R_386_JUMP_SLOT bindtextdomain@GLIBC_2.0 +00024190 R_386_JUMP_SLOT strncmp@GLIBC_2.0 +00024194 R_386_JUMP_SLOT isatty@GLIBC_2.0 +00024198 R_386_JUMP_SLOT abort@GLIBC_2.0 +0002419c R_386_JUMP_SLOT __xstat64@GLIBC_2.2 +000241a0 R_386_JUMP_SLOT __lxstat64@GLIBC_2.2 +000241a4 R_386_JUMP_SLOT getgrnam@GLIBC_2.0 +000241a8 R_386_JUMP_SLOT close@GLIBC_2.0 +000241ac R_386_JUMP_SLOT closedir@GLIBC_2.0 +000241b0 R_386_JUMP_SLOT strspn@GLIBC_2.0 +000241b4 R_386_JUMP_SLOT opendir@GLIBC_2.0 +000241b8 R_386_JUMP_SLOT getgrgid@GLIBC_2.0 +000241bc R_386_JUMP_SLOT __ctype_tolower_loc@GLIBC_2.3 +000241c0 R_386_JUMP_SLOT __assert_fail@GLIBC_2.0 +000241c4 R_386_JUMP_SLOT __ctype_b_loc@GLIBC_2.3 +000241c8 R_386_JUMP_SLOT calloc@GLIBC_2.0 +000241cc R_386_JUMP_SLOT __sprintf_chk@GLIBC_2.3.4 diff --git a/scripts/t/Dpkg_Shlibs/objdump.patterns b/scripts/t/Dpkg_Shlibs/objdump.patterns index a319cb95f..571ad4726 100644 --- a/scripts/t/Dpkg_Shlibs/objdump.patterns +++ b/scripts/t/Dpkg_Shlibs/objdump.patterns @@ -2,21 +2,23 @@ ./t/Dpkg_Shlibs/libobjdump.patterns.so: file format elf32-i386 architecture: i386, flags 0x00000150: HAS_SYMS, DYNAMIC, D_PAGED -start address 0x00001880 +start address 0x00001650 Program Header: LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00002466 memsz 0x00002466 flags r-x - LOAD off 0x00002468 vaddr 0x00003468 paddr 0x00003468 align 2**12 - filesz 0x000002a4 memsz 0x000002ac flags rw- - DYNAMIC off 0x0000259c vaddr 0x0000359c paddr 0x0000359c align 2**2 - filesz 0x000000f8 memsz 0x000000f8 flags rw- - NOTE off 0x000000f4 vaddr 0x000000f4 paddr 0x000000f4 align 2**2 + filesz 0x0000212c memsz 0x0000212c flags r-x + LOAD off 0x00002dd8 vaddr 0x00003dd8 paddr 0x00003dd8 align 2**12 + filesz 0x00000274 memsz 0x00000278 flags rw- + DYNAMIC off 0x00002ec8 vaddr 0x00003ec8 paddr 0x00003ec8 align 2**2 + filesz 0x00000110 memsz 0x00000110 flags rw- + NOTE off 0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**2 filesz 0x00000024 memsz 0x00000024 flags r-- -EH_FRAME off 0x00001f10 vaddr 0x00001f10 paddr 0x00001f10 align 2**2 - filesz 0x0000014c memsz 0x0000014c flags r-- - STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2 +EH_FRAME off 0x00001ba0 vaddr 0x00001ba0 paddr 0x00001ba0 align 2**2 + filesz 0x00000134 memsz 0x00000134 flags r-- + STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4 filesz 0x00000000 memsz 0x00000000 flags rw- + RELRO off 0x00002dd8 vaddr 0x00003dd8 paddr 0x00003dd8 align 2**0 + filesz 0x00000228 memsz 0x00000228 flags r-- Dynamic Section: NEEDED libstdc++.so.6 @@ -24,27 +26,30 @@ Dynamic Section: NEEDED libgcc_s.so.1 NEEDED libc.so.6 SONAME libpatterns.so.1 - INIT 0x00001738 - FINI 0x00001e98 - HASH 0x00000118 - GNU_HASH 0x0000038c - STRTAB 0x00000ba4 - SYMTAB 0x00000624 - STRSZ 0x000007de + INIT 0x00001520 + FINI 0x00001b2c + INIT_ARRAY 0x00003dd8 + INIT_ARRAYSZ 0x00000004 + FINI_ARRAY 0x00003ddc + FINI_ARRAYSZ 0x00000004 + GNU_HASH 0x00000138 + STRTAB 0x00000960 + SYMTAB 0x000003d0 + STRSZ 0x00000802 SYMENT 0x00000010 - PLTGOT 0x000036b8 - PLTRELSZ 0x00000080 + PLTGOT 0x00004000 + PLTRELSZ 0x00000070 PLTREL 0x00000011 - JMPREL 0x000016b8 - REL 0x000014f8 - RELSZ 0x000001c0 + JMPREL 0x000014b0 + REL 0x000012d8 + RELSZ 0x000001d8 RELENT 0x00000008 - VERDEF 0x00001434 + VERDEF 0x00001214 VERDEFNUM 0x00000003 - VERNEED 0x00001488 + VERNEED 0x00001268 VERNEEDNUM 0x00000003 - VERSYM 0x00001382 - RELCOUNT 0x00000001 + VERSYM 0x00001162 + RELCOUNT 0x00000003 Version definitions: 1 0x01 0x03e92331 libpatterns.so.1 @@ -52,177 +57,179 @@ Version definitions: 3 0x00 0x0a4cbc82 SYMVEROPT_2 Version References: - required from libc.so.6: - 0x09691f73 0x00 07 GLIBC_2.1.3 required from libgcc_s.so.1: - 0x0b792650 0x00 06 GCC_3.0 + 0x0b792650 0x00 07 GCC_3.0 required from libstdc++.so.6: - 0x056bafd3 0x00 05 CXXABI_1.3 - 0x08922974 0x00 04 GLIBCXX_3.4 + 0x056bafd3 0x00 06 CXXABI_1.3 + 0x0bafd179 0x00 05 CXXABI_1.3.9 + required from libc.so.6: + 0x09691f73 0x00 04 GLIBC_2.1.3 DYNAMIC SYMBOL TABLE: -00000000 w D *UND* 00000000 __gmon_start__ -00000000 w D *UND* 00000000 _Jv_RegisterClasses -00000000 DF *UND* 00000000 GLIBCXX_3.4 _ZdlPv +00000000 w DF *UND* 00000000 GLIBC_2.1.3 __cxa_finalize +00000000 DF *UND* 00000000 CXXABI_1.3.9 _ZdlPvj 00000000 DO *UND* 00000000 CXXABI_1.3 _ZTVN10__cxxabiv117__class_type_infoE -00000000 DO *UND* 00000000 CXXABI_1.3 _ZTVN10__cxxabiv121__vmi_class_type_infoE 00000000 DF *UND* 00000000 CXXABI_1.3 __gxx_personality_v0 +00000000 DO *UND* 00000000 CXXABI_1.3 _ZTVN10__cxxabiv121__vmi_class_type_infoE +00000000 w D *UND* 00000000 _ITM_deregisterTMCloneTable 00000000 DF *UND* 00000000 GCC_3.0 _Unwind_Resume -00000000 w DF *UND* 00000000 GLIBC_2.1.3 __cxa_finalize -00001ef7 w DO .rodata 00000008 Base _ZTS6ClassC -000019b0 g DF .text 0000001b Base _ZN6ClassBD1Ev -00001b70 g DF .text 00000007 Base _ZThn16_N3NSB6ClassDD0Ev -00001af0 g DF .text 00000036 Base _ZN6ClassCD0Ev -00001cd0 g DF .text 0000001b Base _ZN3NSA6ClassA8InternalC2Ev -00001e00 g DF .text 00000002 SYMVER_1 _ZN3NSB6SymverC2Ev -00001d10 g DF .text 0000001b Base _ZN3NSA6ClassAC2Ev -00001c50 g DF .text 00000036 Base _ZN3NSA6ClassA7PrivateD0Ev -00001d70 g DF .text 00000089 Base _ZN3NSB6ClassDC2Ev -00001cf0 g DF .text 00000002 Base _ZN3NSA6ClassA8Internal16internal_method1Ec +00000000 w D *UND* 00000000 __gmon_start__ +00000000 w D *UND* 00000000 _ITM_registerTMCloneTable +00001b88 w DO .rodata 00000008 Base _ZTS6ClassC +00001790 g DF .text 00000002 Base _ZN6ClassBD1Ev +00001940 g DF .text 00000007 Base _ZThn16_N3NSB6ClassDD0Ev +000018e0 g DF .text 0000002a Base _ZN6ClassCD0Ev +00001a00 g DF .text 0000001a Base _ZN3NSA6ClassAC2Ev +00001af0 g DF .text 00000002 SYMVER_1 _ZN3NSB6SymverC2Ev +000019c0 g DF .text 0000001a Base _ZN3NSA6ClassA8InternalC2Ev +00001820 g DF .text 0000002a Base _ZN3NSA6ClassA7PrivateD0Ev +00001a60 g DF .text 0000008c Base _ZN3NSB6ClassDC2Ev +000019e0 g DF .text 00000002 Base _ZN3NSA6ClassA8Internal16internal_method1Ec +00001970 g DF .text 00000002 Base _ZThn12_NK3NSB6ClassD11generate_vtEPKc 00000000 g DO *ABS* 00000000 SYMVER_1 SYMVER_1 -00001ad0 g DF .text 00000007 Base _ZThn12_NK3NSB6ClassD11generate_vtEPKc -000034e8 w DO .data.rel.ro 00000010 Base _ZTVN3NSA6ClassA7PrivateE -00001e10 g DF .text 00000002 SYMVER_1 _ZN3NSB6SymverD1Ev -00001e50 g DF .text 00000002 SYMVEROPT_2 _ZN3NSB14SymverOptionalD2Ev -00001d50 g DF .text 0000001b Base _ZN6ClassCC2Ev -00001980 g DF .text 0000001b Base _ZN3NSA6ClassAD1Ev -00001960 g DF .text 0000001b Base _ZN3NSA6ClassA8InternalD1Ev -00001a30 g DF .text 00000088 Base _ZN3NSB6ClassDD1Ev -00001c90 g DF .text 0000001b Base _ZN3NSA6ClassA7PrivateC2Ev -000034f8 w DO .data.rel.ro 00000010 Base _ZTVN3NSA6ClassA8InternalE -00001cb0 g DF .text 00000002 Base _ZN3NSA6ClassA7Private11privmethod1Ei -000019b0 g DF .text 0000001b Base _ZN6ClassBD2Ev -00001a10 g DF .text 00000007 Base _ZThn16_N3NSB6ClassDD1Ev -00001e98 g DF .fini 00000000 Base _fini -00001b80 g DF .text 00000007 Base _ZThn12_N3NSB6ClassDD0Ev -000019e0 g DF .text 0000001b Base _ZN6ClassCD1Ev -00001940 g DF .text 0000001b Base _ZN3NSA6ClassA7PrivateD1Ev -00003498 w DO .data.rel.ro 00000008 Base _ZTI6ClassB -00001738 g DF .init 00000000 Base _init -000034a0 w DO .data.rel.ro 00000008 Base _ZTI6ClassC -00001d00 g DF .text 00000002 Base _ZN3NSA6ClassA8Internal16internal_method2Ec -00001980 g DF .text 0000001b Base _ZN3NSA6ClassAD2Ev -00001960 g DF .text 0000001b Base _ZN3NSA6ClassA8InternalD2Ev -00001e10 g DF .text 00000002 SYMVER_1 _ZN3NSB6SymverD2Ev +00003e30 w DO .data.rel.ro 00000010 Base _ZTVN3NSA6ClassA7PrivateE +00001770 g DF .text 00000002 Base _ZN3NSA6ClassAD1Ev +00001760 g DF .text 00000002 Base _ZN3NSA6ClassA8InternalD1Ev +00001b00 g DF .text 00000002 SYMVER_1 _ZN3NSB6SymverD1Ev +00001a40 g DF .text 0000001a Base _ZN6ClassCC2Ev +00001b00 g DF .text 00000002 SYMVEROPT_2 _ZN3NSB14SymverOptionalD2Ev +00003e40 w DO .data.rel.ro 00000010 Base _ZTVN3NSA6ClassA8InternalE +00001980 g DF .text 0000001a Base _ZN3NSA6ClassA7PrivateC2Ev +000017b0 g DF .text 0000004d Base _ZN3NSB6ClassDD1Ev +000019a0 g DF .text 00000002 Base _ZN3NSA6ClassA7Private11privmethod1Ei +00001790 g DF .text 00000002 Base _ZN6ClassBD2Ev +00001810 g DF .text 00000007 Base _ZThn16_N3NSB6ClassDD1Ev +00001b2c g DF .fini 00000000 Base _fini +00001950 g DF .text 00000007 Base _ZThn12_N3NSB6ClassDD0Ev +000017a0 g DF .text 00000002 Base _ZN6ClassCD1Ev +00001750 g DF .text 00000002 Base _ZN3NSA6ClassA7PrivateD1Ev +00001520 g DF .init 00000000 Base _init +00003df8 w DO .data.rel.ro 00000008 Base _ZTI6ClassB +000019f0 g DF .text 00000002 Base _ZN3NSA6ClassA8Internal16internal_method2Ec +00003e00 w DO .data.rel.ro 00000008 Base _ZTI6ClassC +00001b00 g DF .text 00000002 SYMVER_1 _ZN3NSB6SymverD2Ev +00001760 g DF .text 00000002 Base _ZN3NSA6ClassA8InternalD2Ev 00000000 g DO *ABS* 00000000 SYMVEROPT_2 SYMVEROPT_2 -00003560 w DO .data.rel.ro 0000003c Base _ZTVN3NSB6ClassDE -00003508 w DO .data.rel.ro 00000014 Base _ZTVN3NSA6ClassAE -000019a0 g DF .text 00000002 Base _ZNK3NSA6ClassA11generate_vtEPKc -00001cc0 g DF .text 00000002 Base _ZN3NSA6ClassA7Private11privmethod2Ei -00001a30 g DF .text 00000088 Base _ZN3NSB6ClassDD2Ev -00001ac0 g DF .text 00000007 Base _ZThn16_NK3NSB6ClassD11generate_vtEPKc -00001a00 g DF .text 00000002 Base _ZNK6ClassC11generate_vtEPKc -00001a20 g DF .text 00000007 Base _ZThn12_N3NSB6ClassDD1Ev -000019e0 g DF .text 0000001b Base _ZN6ClassCD2Ev -00001e40 g DF .text 00000002 SYMVEROPT_2 _ZN3NSB14SymverOptionalC1Ev -00001e20 g DF .text 00000002 SYMVER_1 _ZN3NSB6Symver14symver_method1Ev -00001940 g DF .text 0000001b Base _ZN3NSA6ClassA7PrivateD2Ev -000019d0 g DF .text 00000002 Base _ZNK6ClassB11generate_vtEPKc -00001d30 g DF .text 0000001b Base _ZN6ClassBC1Ev -00003520 w DO .data.rel.ro 00000014 Base _ZTV6ClassB -00003538 w DO .data.rel.ro 00000014 Base _ZTV6ClassC -00001eb4 w DO .rodata 00000016 Base _ZTSN3NSA6ClassA7PrivateE -00001eff w DO .rodata 0000000e Base _ZTSN3NSB6ClassDE -0000370c g D *ABS* 00000000 Base _edata -00001ee1 w DO .rodata 0000000e Base _ZTSN3NSA6ClassAE -00001b30 g DF .text 00000036 Base _ZN6ClassBD0Ev -00003480 w DO .data.rel.ro 00000008 Base _ZTIN3NSA6ClassA7PrivateE -00001d10 g DF .text 0000001b Base _ZN3NSA6ClassAC1Ev -00001e40 g DF .text 00000002 SYMVEROPT_2 _ZN3NSB14SymverOptionalC2Ev -00001cd0 g DF .text 0000001b Base _ZN3NSA6ClassA8InternalC1Ev -00003714 g D *ABS* 00000000 Base _end -00001e00 g DF .text 00000002 SYMVER_1 _ZN3NSB6SymverC1Ev -00001eca w DO .rodata 00000017 Base _ZTSN3NSA6ClassA8InternalE -00001e30 g DF .text 00000002 SYMVER_1 _ZN3NSB6Symver14symver_method2Ev -00001d70 g DF .text 00000089 Base _ZN3NSB6ClassDC1Ev -00001d30 g DF .text 0000001b Base _ZN6ClassBC2Ev -00001ae0 g DF .text 00000002 Base _ZNK3NSB6ClassD11generate_vtEPKc -00001bd0 g DF .text 00000036 Base _ZN3NSA6ClassAD0Ev -00001d50 g DF .text 0000001b Base _ZN6ClassCC1Ev -00001c10 g DF .text 00000036 Base _ZN3NSA6ClassA8InternalD0Ev -00001e50 g DF .text 00000002 SYMVEROPT_2 _ZN3NSB14SymverOptionalD1Ev -00003488 w DO .data.rel.ro 00000008 Base _ZTIN3NSA6ClassA8InternalE -0000370c g D *ABS* 00000000 Base __bss_start -00001eef w DO .rodata 00000008 Base _ZTS6ClassB -000034c0 w DO .data.rel.ro 00000028 Base _ZTIN3NSB6ClassDE -00001c90 g DF .text 0000001b Base _ZN3NSA6ClassA7PrivateC1Ev -00003490 w DO .data.rel.ro 00000008 Base _ZTIN3NSA6ClassAE -00001b90 g DF .text 00000036 Base _ZN3NSB6ClassDD0Ev +00001770 g DF .text 00000002 Base _ZN3NSA6ClassAD2Ev +00003e8c w DO .data.rel.ro 0000003c Base _ZTVN3NSB6ClassDE +00003e50 w DO .data.rel.ro 00000014 Base _ZTVN3NSA6ClassAE +000019b0 g DF .text 00000002 Base _ZN3NSA6ClassA7Private11privmethod2Ei +00001780 g DF .text 00000002 Base _ZNK3NSA6ClassA11generate_vtEPKc +000017b0 g DF .text 0000004d Base _ZN3NSB6ClassDD2Ev +00001960 g DF .text 00000002 Base _ZThn16_NK3NSB6ClassD11generate_vtEPKc +00001780 g DF .text 00000002 Base _ZNK6ClassC11generate_vtEPKc +00001800 g DF .text 00000007 Base _ZThn12_N3NSB6ClassDD1Ev +00001af0 g DF .text 00000002 SYMVEROPT_2 _ZN3NSB14SymverOptionalC1Ev +000017a0 g DF .text 00000002 Base _ZN6ClassCD2Ev +00001b10 g DF .text 00000002 SYMVER_1 _ZN3NSB6Symver14symver_method1Ev +00001750 g DF .text 00000002 Base _ZN3NSA6ClassA7PrivateD2Ev +00001780 g DF .text 00000002 Base _ZNK6ClassB11generate_vtEPKc +00001a20 g DF .text 0000001a Base _ZN6ClassBC1Ev +00003e64 w DO .data.rel.ro 00000014 Base _ZTV6ClassB +00003e78 w DO .data.rel.ro 00000014 Base _ZTV6ClassC +00001b70 w DO .rodata 0000000e Base _ZTSN3NSA6ClassAE +0000404c g D .data 00000000 Base _edata +00001b40 w DO .rodata 00000016 Base _ZTSN3NSA6ClassA7PrivateE +00001b90 w DO .rodata 0000000e Base _ZTSN3NSB6ClassDE +000018b0 g DF .text 0000002a Base _ZN6ClassBD0Ev +00003de0 w DO .data.rel.ro 00000008 Base _ZTIN3NSA6ClassA7PrivateE +00001af0 g DF .text 00000002 SYMVEROPT_2 _ZN3NSB14SymverOptionalC2Ev +000019c0 g DF .text 0000001a Base _ZN3NSA6ClassA8InternalC1Ev +00001af0 g DF .text 00000002 SYMVER_1 _ZN3NSB6SymverC1Ev +00004050 g D .bss 00000000 Base _end +00001a00 g DF .text 0000001a Base _ZN3NSA6ClassAC1Ev +00001b20 g DF .text 00000002 SYMVER_1 _ZN3NSB6Symver14symver_method2Ev +00001a60 g DF .text 0000008c Base _ZN3NSB6ClassDC1Ev +00001b58 w DO .rodata 00000017 Base _ZTSN3NSA6ClassA8InternalE +00001a20 g DF .text 0000001a Base _ZN6ClassBC2Ev +00001780 g DF .text 00000002 Base _ZNK3NSB6ClassD11generate_vtEPKc +00001b00 g DF .text 00000002 SYMVEROPT_2 _ZN3NSB14SymverOptionalD1Ev +00001880 g DF .text 0000002a Base _ZN3NSA6ClassAD0Ev +00001a40 g DF .text 0000001a Base _ZN6ClassCC1Ev +00001850 g DF .text 0000002a Base _ZN3NSA6ClassA8InternalD0Ev +00003de8 w DO .data.rel.ro 00000008 Base _ZTIN3NSA6ClassA8InternalE +0000404c g D .bss 00000000 Base __bss_start +00003e08 w DO .data.rel.ro 00000028 Base _ZTIN3NSB6ClassDE +00003df0 w DO .data.rel.ro 00000008 Base _ZTIN3NSA6ClassAE +00001910 g DF .text 0000002a Base _ZN3NSB6ClassDD0Ev +00001980 g DF .text 0000001a Base _ZN3NSA6ClassA7PrivateC1Ev +00001b80 w DO .rodata 00000008 Base _ZTS6ClassB DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE -00003704 R_386_RELATIVE *ABS* -00003480 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE -00003488 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE -00003490 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE -00003498 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE -000034a0 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE -00003484 R_386_32 _ZTSN3NSA6ClassA7PrivateE -0000348c R_386_32 _ZTSN3NSA6ClassA8InternalE -00003494 R_386_32 _ZTSN3NSA6ClassAE -0000349c R_386_32 _ZTS6ClassB -000034a4 R_386_32 _ZTS6ClassC -000034c0 R_386_32 _ZTVN10__cxxabiv121__vmi_class_type_infoE -000034c4 R_386_32 _ZTSN3NSB6ClassDE -000034d0 R_386_32 _ZTIN3NSA6ClassAE -0000350c R_386_32 _ZTIN3NSA6ClassAE -000034d8 R_386_32 _ZTI6ClassB -00003524 R_386_32 _ZTI6ClassB -000034e0 R_386_32 _ZTI6ClassC -0000353c R_386_32 _ZTI6ClassC -000034ec R_386_32 _ZTIN3NSA6ClassA7PrivateE -000034f0 R_386_32 _ZN3NSA6ClassA7PrivateD1Ev -000034f4 R_386_32 _ZN3NSA6ClassA7PrivateD0Ev -000034fc R_386_32 _ZTIN3NSA6ClassA8InternalE -00003500 R_386_32 _ZN3NSA6ClassA8InternalD1Ev -00003504 R_386_32 _ZN3NSA6ClassA8InternalD0Ev -00003510 R_386_32 _ZN3NSA6ClassAD1Ev -00003514 R_386_32 _ZN3NSA6ClassAD0Ev -00003518 R_386_32 _ZNK3NSA6ClassA11generate_vtEPKc -00003528 R_386_32 _ZN6ClassBD1Ev -0000352c R_386_32 _ZN6ClassBD0Ev -00003530 R_386_32 _ZNK6ClassB11generate_vtEPKc -00003540 R_386_32 _ZN6ClassCD1Ev -00003544 R_386_32 _ZN6ClassCD0Ev -00003548 R_386_32 _ZNK6ClassC11generate_vtEPKc -00003564 R_386_32 _ZTIN3NSB6ClassDE -00003578 R_386_32 _ZTIN3NSB6ClassDE -0000358c R_386_32 _ZTIN3NSB6ClassDE -00003568 R_386_32 _ZN3NSB6ClassDD1Ev -0000356c R_386_32 _ZN3NSB6ClassDD0Ev -00003570 R_386_32 _ZNK3NSB6ClassD11generate_vtEPKc -0000357c R_386_32 _ZThn12_N3NSB6ClassDD1Ev -00003580 R_386_32 _ZThn12_N3NSB6ClassDD0Ev -00003584 R_386_32 _ZThn12_NK3NSB6ClassD11generate_vtEPKc -00003590 R_386_32 _ZThn16_N3NSB6ClassDD1Ev -00003594 R_386_32 _ZThn16_N3NSB6ClassDD0Ev -00003598 R_386_32 _ZThn16_NK3NSB6ClassD11generate_vtEPKc -00003694 R_386_GLOB_DAT _ZTVN3NSB6ClassDE -00003698 R_386_GLOB_DAT __gmon_start__ -0000369c R_386_GLOB_DAT _Jv_RegisterClasses -000036a0 R_386_GLOB_DAT _ZTV6ClassB -000036a4 R_386_GLOB_DAT _ZTVN3NSA6ClassA8InternalE -000036a8 R_386_GLOB_DAT _ZTVN3NSA6ClassA7PrivateE -000036ac R_386_GLOB_DAT _ZTVN3NSA6ClassAE -000036b0 R_386_GLOB_DAT __cxa_finalize -000036b4 R_386_GLOB_DAT _ZTV6ClassC -00003708 R_386_32 __gxx_personality_v0 -000036c4 R_386_JUMP_SLOT _ZN3NSA6ClassA7PrivateD1Ev -000036c8 R_386_JUMP_SLOT _ZN3NSB6ClassDD1Ev -000036cc R_386_JUMP_SLOT _ZN3NSA6ClassAD2Ev -000036d0 R_386_JUMP_SLOT __gmon_start__ -000036d4 R_386_JUMP_SLOT _ZdlPv -000036d8 R_386_JUMP_SLOT _ZN6ClassCD2Ev -000036dc R_386_JUMP_SLOT _ZN6ClassBD2Ev -000036e0 R_386_JUMP_SLOT _ZN6ClassBD1Ev -000036e4 R_386_JUMP_SLOT _ZN6ClassCC2Ev -000036e8 R_386_JUMP_SLOT _ZN3NSA6ClassAD1Ev -000036ec R_386_JUMP_SLOT _ZN3NSA6ClassAC2Ev -000036f0 R_386_JUMP_SLOT _ZN6ClassBC2Ev -000036f4 R_386_JUMP_SLOT _ZN6ClassCD1Ev -000036f8 R_386_JUMP_SLOT _ZN3NSA6ClassA8InternalD1Ev -000036fc R_386_JUMP_SLOT _Unwind_Resume -00003700 R_386_JUMP_SLOT __cxa_finalize +00003dd8 R_386_RELATIVE *ABS* +00003ddc R_386_RELATIVE *ABS* +00004044 R_386_RELATIVE *ABS* +00003de0 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE@CXXABI_1.3 +00003de8 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE@CXXABI_1.3 +00003df0 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE@CXXABI_1.3 +00003df8 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE@CXXABI_1.3 +00003e00 R_386_32 _ZTVN10__cxxabiv117__class_type_infoE@CXXABI_1.3 +00003de4 R_386_32 _ZTSN3NSA6ClassA7PrivateE@@Base +00003dec R_386_32 _ZTSN3NSA6ClassA8InternalE@@Base +00003df4 R_386_32 _ZTSN3NSA6ClassAE@@Base +00003dfc R_386_32 _ZTS6ClassB@@Base +00003e04 R_386_32 _ZTS6ClassC@@Base +00003e08 R_386_32 _ZTVN10__cxxabiv121__vmi_class_type_infoE@CXXABI_1.3 +00003e0c R_386_32 _ZTSN3NSB6ClassDE@@Base +00003e18 R_386_32 _ZTIN3NSA6ClassAE@@Base +00003e54 R_386_32 _ZTIN3NSA6ClassAE@@Base +00003e20 R_386_32 _ZTI6ClassB@@Base +00003e68 R_386_32 _ZTI6ClassB@@Base +00003e28 R_386_32 _ZTI6ClassC@@Base +00003e7c R_386_32 _ZTI6ClassC@@Base +00003e34 R_386_32 _ZTIN3NSA6ClassA7PrivateE@@Base +00003e38 R_386_32 _ZN3NSA6ClassA7PrivateD1Ev@@Base +00003e3c R_386_32 _ZN3NSA6ClassA7PrivateD0Ev@@Base +00003e44 R_386_32 _ZTIN3NSA6ClassA8InternalE@@Base +00003e48 R_386_32 _ZN3NSA6ClassA8InternalD1Ev@@Base +00003e4c R_386_32 _ZN3NSA6ClassA8InternalD0Ev@@Base +00003e58 R_386_32 _ZN3NSA6ClassAD1Ev@@Base +00003e5c R_386_32 _ZN3NSA6ClassAD0Ev@@Base +00003e60 R_386_32 _ZNK3NSA6ClassA11generate_vtEPKc@@Base +00003e6c R_386_32 _ZN6ClassBD1Ev@@Base +00003e70 R_386_32 _ZN6ClassBD0Ev@@Base +00003e74 R_386_32 _ZNK6ClassB11generate_vtEPKc@@Base +00003e80 R_386_32 _ZN6ClassCD1Ev@@Base +00003e84 R_386_32 _ZN6ClassCD0Ev@@Base +00003e88 R_386_32 _ZNK6ClassC11generate_vtEPKc@@Base +00003e90 R_386_32 _ZTIN3NSB6ClassDE@@Base +00003ea4 R_386_32 _ZTIN3NSB6ClassDE@@Base +00003eb8 R_386_32 _ZTIN3NSB6ClassDE@@Base +00003e94 R_386_32 _ZN3NSB6ClassDD1Ev@@Base +00003e98 R_386_32 _ZN3NSB6ClassDD0Ev@@Base +00003e9c R_386_32 _ZNK3NSB6ClassD11generate_vtEPKc@@Base +00003ea8 R_386_32 _ZThn12_N3NSB6ClassDD1Ev@@Base +00003eac R_386_32 _ZThn12_N3NSB6ClassDD0Ev@@Base +00003eb0 R_386_32 _ZThn12_NK3NSB6ClassD11generate_vtEPKc@@Base +00003ebc R_386_32 _ZThn16_N3NSB6ClassDD1Ev@@Base +00003ec0 R_386_32 _ZThn16_N3NSB6ClassDD0Ev@@Base +00003ec4 R_386_32 _ZThn16_NK3NSB6ClassD11generate_vtEPKc@@Base +00003fd8 R_386_GLOB_DAT __cxa_finalize@GLIBC_2.1.3 +00003fdc R_386_GLOB_DAT _ZTVN3NSA6ClassA8InternalE@@Base +00003fe0 R_386_GLOB_DAT _ZTVN3NSB6ClassDE@@Base +00003fe4 R_386_GLOB_DAT _ZTVN3NSA6ClassAE@@Base +00003fe8 R_386_GLOB_DAT _ZTV6ClassC@@Base +00003fec R_386_GLOB_DAT _ZTV6ClassB@@Base +00003ff0 R_386_GLOB_DAT _ITM_deregisterTMCloneTable +00003ff4 R_386_GLOB_DAT _ZTVN3NSA6ClassA7PrivateE@@Base +00003ff8 R_386_GLOB_DAT __gmon_start__ +00003ffc R_386_GLOB_DAT _ITM_registerTMCloneTable +00004048 R_386_32 __gxx_personality_v0@CXXABI_1.3 +0000400c R_386_JUMP_SLOT _ZN6ClassBD1Ev@@Base +00004010 R_386_JUMP_SLOT _ZN6ClassBD2Ev@@Base +00004014 R_386_JUMP_SLOT _ZN3NSA6ClassA7PrivateD1Ev@@Base +00004018 R_386_JUMP_SLOT _ZN3NSA6ClassAD1Ev@@Base +0000401c R_386_JUMP_SLOT _ZN3NSA6ClassA8InternalD1Ev@@Base +00004020 R_386_JUMP_SLOT _ZdlPvj@CXXABI_1.3.9 +00004024 R_386_JUMP_SLOT _ZN3NSB6ClassDD1Ev@@Base +00004028 R_386_JUMP_SLOT _ZN6ClassCD2Ev@@Base +0000402c R_386_JUMP_SLOT _ZN3NSA6ClassAC2Ev@@Base +00004030 R_386_JUMP_SLOT _ZN6ClassBC2Ev@@Base +00004034 R_386_JUMP_SLOT _ZN6ClassCC2Ev@@Base +00004038 R_386_JUMP_SLOT _Unwind_Resume@GCC_3.0 +0000403c R_386_JUMP_SLOT _ZN3NSA6ClassAD2Ev@@Base +00004040 R_386_JUMP_SLOT _ZN6ClassCD1Ev@@Base diff --git a/scripts/t/Dpkg_Shlibs/objdump.spacesyms b/scripts/t/Dpkg_Shlibs/objdump.spacesyms index f307ee5a5..1b26af972 100644 --- a/scripts/t/Dpkg_Shlibs/objdump.spacesyms +++ b/scripts/t/Dpkg_Shlibs/objdump.spacesyms @@ -2,48 +2,47 @@ ./t/Dpkg_Shlibs/libobjdump.spacesyms.so: file format elf32-i386 architecture: i386, flags 0x00000150: HAS_SYMS, DYNAMIC, D_PAGED -start address 0x000007a0 +start address 0x00000770 Program Header: LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000d5c memsz 0x00000d5c flags r-x - LOAD off 0x00000d5c vaddr 0x00001d5c paddr 0x00001d5c align 2**12 - filesz 0x00000204 memsz 0x00000208 flags rw- - DYNAMIC off 0x00000d68 vaddr 0x00001d68 paddr 0x00001d68 align 2**2 - filesz 0x000000f8 memsz 0x000000f8 flags rw- - NOTE off 0x000000f4 vaddr 0x000000f4 paddr 0x000000f4 align 2**2 + filesz 0x00000d08 memsz 0x00000d08 flags r-x + LOAD off 0x00000f08 vaddr 0x00001f08 paddr 0x00001f08 align 2**12 + filesz 0x00000198 memsz 0x0000019c flags rw- + DYNAMIC off 0x00000f10 vaddr 0x00001f10 paddr 0x00001f10 align 2**2 + filesz 0x000000e0 memsz 0x000000e0 flags rw- + NOTE off 0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**2 filesz 0x00000024 memsz 0x00000024 flags r-- -EH_FRAME off 0x00000a68 vaddr 0x00000a68 paddr 0x00000a68 align 2**2 - filesz 0x000000d4 memsz 0x000000d4 flags r-- +EH_FRAME off 0x000009f8 vaddr 0x000009f8 paddr 0x000009f8 align 2**2 + filesz 0x000000dc memsz 0x000000dc flags r-- STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4 filesz 0x00000000 memsz 0x00000000 flags rw- + RELRO off 0x00000f08 vaddr 0x00001f08 paddr 0x00001f08 align 2**0 + filesz 0x000000f8 memsz 0x000000f8 flags r-- Dynamic Section: NEEDED libc.so.6 SONAME libspacesyms.so.1 - INIT 0x00000740 - FINI 0x00000a54 - INIT_ARRAY 0x00001d5c + INIT 0x00000724 + FINI 0x000009e4 + INIT_ARRAY 0x00001f08 INIT_ARRAYSZ 0x00000004 - FINI_ARRAY 0x00001d60 + FINI_ARRAY 0x00001f0c FINI_ARRAYSZ 0x00000004 - GNU_HASH 0x00000118 - STRTAB 0x0000036c - SYMTAB 0x000001cc - STRSZ 0x00000214 + GNU_HASH 0x00000138 + STRTAB 0x0000037c + SYMTAB 0x000001ec + STRSZ 0x00000200 SYMENT 0x00000010 - PLTGOT 0x00001e74 - PLTRELSZ 0x00000010 - PLTREL 0x00000011 - JMPREL 0x00000730 - REL 0x00000630 - RELSZ 0x00000100 + PLTGOT 0x00002000 + REL 0x0000062c + RELSZ 0x000000f8 RELENT 0x00000008 - VERDEF 0x000005b4 + VERDEF 0x000005b0 VERDEFNUM 0x00000003 - VERNEED 0x00000610 + VERNEED 0x0000060c VERNEEDNUM 0x00000001 - VERSYM 0x00000580 + VERSYM 0x0000057c RELCOUNT 0x0000000f Version definitions: @@ -60,65 +59,61 @@ DYNAMIC SYMBOL TABLE: 00000000 w D *UND* 00000000 _ITM_deregisterTMCloneTable 00000000 w DF *UND* 00000000 GLIBC_2.1.3 __cxa_finalize 00000000 w D *UND* 00000000 __gmon_start__ -00000000 w D *UND* 00000000 _Jv_RegisterClasses 00000000 w D *UND* 00000000 _ITM_registerTMCloneTable -00000920 g DF .text 00000002 Base symdefaultverSPA CEdefault -00000a54 g DF .fini 00000000 Base _fini -00001f00 g DO .data 00000060 Base funcs -00000740 g DF .init 00000000 Base _init -000009e0 g DF .text 00000002 V1 symshortvernospacedefault -00001f60 g D .bss 00000000 Base __bss_start -00000900 g DF .text 00000002 Base .protected symdefaultvernospaceprotected -00001f64 g D .bss 00000000 Base _end -00000a20 g DF .text 00000002 V1 symshortverSPA CEdefault +000008c0 g DF .text 00000002 Base symdefaultverSPA CEdefault +000009e4 g DF .fini 00000000 Base _fini +00002040 g DO .data 00000060 Base funcs +00000724 g DF .init 00000000 Base _init +00000980 g DF .text 00000002 V1 symshortvernospacedefault +000020a0 g D .bss 00000000 Base __bss_start +00000890 g DF .text 00000002 Base .protected symdefaultvernospaceprotected +000020a4 g D .bss 00000000 Base _end +000009c0 g DF .text 00000002 V1 symshortverSPA CEdefault 00000000 g DO *ABS* 00000000 V1 V1 -00000a00 g DF .text 00000002 V1 .protected symshortvernospaceprotected -00000960 g DF .text 00000002 VERY_LONG_VERSION_1 symlongvernospacedefault +000009a0 g DF .text 00000002 V1 .protected symshortvernospaceprotected +00000900 g DF .text 00000002 VERY_LONG_VERSION_1 symlongvernospacedefault 00000000 g DO *ABS* 00000000 VERY_LONG_VERSION_1 VERY_LONG_VERSION_1 -00001f60 g D .data 00000000 Base _edata -000008e0 g DF .text 00000002 Base symdefaultvernospacedefault -000009c0 g DF .text 00000002 VERY_LONG_VERSION_1 .protected symlongverSPA CEprotected -00000940 g DF .text 00000002 Base .protected symdefaultverSPA CEprotected -000009a0 g DF .text 00000002 VERY_LONG_VERSION_1 symlongverSPA CEdefault -00000a40 g DF .text 00000002 V1 .protected symshortverSPA CEprotected -00000980 g DF .text 00000002 VERY_LONG_VERSION_1 .protected symlongvernospaceprotected +000020a0 g D .data 00000000 Base _edata +00000870 g DF .text 00000002 Base symdefaultvernospacedefault +00000960 g DF .text 00000002 VERY_LONG_VERSION_1 .protected symlongverSPA CEprotected +000008e0 g DF .text 00000002 Base .protected symdefaultverSPA CEprotected +00000940 g DF .text 00000002 VERY_LONG_VERSION_1 symlongverSPA CEdefault +000009e0 g DF .text 00000002 V1 .protected symshortverSPA CEprotected +00000920 g DF .text 00000002 VERY_LONG_VERSION_1 .protected symlongvernospaceprotected DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE -00001d5c R_386_RELATIVE *ABS* -00001d60 R_386_RELATIVE *ABS* -00001ec0 R_386_RELATIVE *ABS* -00001f04 R_386_RELATIVE *ABS* +00001f08 R_386_RELATIVE *ABS* 00001f0c R_386_RELATIVE *ABS* -00001f14 R_386_RELATIVE *ABS* -00001f1c R_386_RELATIVE *ABS* -00001f24 R_386_RELATIVE *ABS* -00001f2c R_386_RELATIVE *ABS* -00001f34 R_386_RELATIVE *ABS* -00001f3c R_386_RELATIVE *ABS* -00001f44 R_386_RELATIVE *ABS* -00001f4c R_386_RELATIVE *ABS* -00001f54 R_386_RELATIVE *ABS* -00001f5c R_386_RELATIVE *ABS* -00001e60 R_386_GLOB_DAT _ITM_deregisterTMCloneTable -00001e64 R_386_GLOB_DAT __cxa_finalize -00001e68 R_386_GLOB_DAT __gmon_start__ -00001e6c R_386_GLOB_DAT _Jv_RegisterClasses -00001e70 R_386_GLOB_DAT _ITM_registerTMCloneTable -00001f00 R_386_32 symdefaultvernospacedefault -00001f08 R_386_32 symdefaultvernospaceprotected -00001f10 R_386_32 symdefaultverSPA CEdefault -00001f18 R_386_32 symdefaultverSPA CEprotected -00001f20 R_386_32 symlongvernospacedefault -00001f28 R_386_32 symlongvernospaceprotected -00001f30 R_386_32 symlongverSPA CEdefault -00001f38 R_386_32 symlongverSPA CEprotected -00001f40 R_386_32 symshortvernospacedefault -00001f48 R_386_32 symshortvernospaceprotected -00001f50 R_386_32 symshortverSPA CEdefault -00001f58 R_386_32 symshortverSPA CEprotected -00001e80 R_386_JUMP_SLOT __cxa_finalize -00001e84 R_386_JUMP_SLOT __gmon_start__ +00002020 R_386_RELATIVE *ABS* +00002044 R_386_RELATIVE *ABS* +0000204c R_386_RELATIVE *ABS* +00002054 R_386_RELATIVE *ABS* +0000205c R_386_RELATIVE *ABS* +00002064 R_386_RELATIVE *ABS* +0000206c R_386_RELATIVE *ABS* +00002074 R_386_RELATIVE *ABS* +0000207c R_386_RELATIVE *ABS* +00002084 R_386_RELATIVE *ABS* +0000208c R_386_RELATIVE *ABS* +00002094 R_386_RELATIVE *ABS* +0000209c R_386_RELATIVE *ABS* +00001ff0 R_386_GLOB_DAT _ITM_deregisterTMCloneTable +00001ff4 R_386_GLOB_DAT __cxa_finalize@GLIBC_2.1.3 +00001ff8 R_386_GLOB_DAT __gmon_start__ +00001ffc R_386_GLOB_DAT _ITM_registerTMCloneTable +00002040 R_386_32 symdefaultvernospacedefault@@Base +00002048 R_386_32 symdefaultvernospaceprotected@@Base +00002050 R_386_32 symdefaultverSPA CEdefault@@Base +00002058 R_386_32 symdefaultverSPA CEprotected@@Base +00002060 R_386_32 symlongvernospacedefault@@VERY_LONG_VERSION_1 +00002068 R_386_32 symlongvernospaceprotected@@VERY_LONG_VERSION_1 +00002070 R_386_32 symlongverSPA CEdefault@@VERY_LONG_VERSION_1 +00002078 R_386_32 symlongverSPA CEprotected@@VERY_LONG_VERSION_1 +00002080 R_386_32 symshortvernospacedefault@@V1 +00002088 R_386_32 symshortvernospaceprotected@@V1 +00002090 R_386_32 symshortverSPA CEdefault@@V1 +00002098 R_386_32 symshortverSPA CEprotected@@V1 -- cgit v1.2.3 From 981a18c37036b68f368b0bfab71d2a984abba9e6 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 8 Apr 2018 22:43:09 +0200 Subject: Dpkg::Version: Fix bool overload behavior The current bool overload has broken semantics, because it considers the version "0" to be false. The bool overload used to have sane semantics (equivalent to is_valid()) before commit 5b9f353b2940de751df47036608afbe71992d622, but there it got changed to return the stringified version if it was valid, or undef otherwise, to fix a problem within dpkg-shlibdeps, instead of properly fixing the local-only problem in the tool. This makes the overload hard to use, and broke existing callers from external projects. We will emit a warning until dpkg 1.20.x to notify of the semantic change in case there is code relying on the broken semantics. For fixed code the warning can then be quiesced with: no warnings qw(Dpkg::Version::semantic_change::overload::bool); Closes: #895004 --- debian/changelog | 4 ++++ scripts/Dpkg/Version.pm | 20 +++++++++++++++++--- scripts/dpkg-shlibdeps.pl | 3 ++- scripts/t/Dpkg_Version.t | 17 ++++++++--------- t/pod-spell.t | 1 + 5 files changed, 32 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 5098e7f2d..56b4c9e12 100644 --- a/debian/changelog +++ b/debian/changelog @@ -89,6 +89,10 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::Vendor::Debian: Mark riscv64 as having gcc builtin PIE. - Dpkg::Shlibs::Objdump: Fix ELF program detection, for PIE binaries and executable libraries. + - Dpkg::Version: Fix bool overload behavior back to be an is_valid() + alias. Emit a specific perl warning until 1.20.x so that users can check + whether the semantic change has any impact on the code, which can then + be quiesced. Closes: #895004 * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Version.pm b/scripts/Dpkg/Version.pm index 477082b67..a06ba268d 100644 --- a/scripts/Dpkg/Version.pm +++ b/scripts/Dpkg/Version.pm @@ -20,6 +20,7 @@ package Dpkg::Version; use strict; use warnings; +use warnings::register qw(semantic_change::overload::bool); our $VERSION = '1.01'; our @EXPORT = qw( @@ -55,7 +56,12 @@ use overload '<=>' => \&_comparison, 'cmp' => \&_comparison, '""' => sub { return $_[0]->as_string(); }, - 'bool' => sub { return $_[0]->as_string() if $_[0]->is_valid(); }, + 'bool' => sub { + warnings::warnif('Dpkg::Version::semantic_change::overload::bool', + 'bool overload behavior has changed back to be ' . + 'an is_valid() alias'); + return $_[0]->is_valid(); + }, 'fallback' => 1; =encoding utf8 @@ -121,8 +127,16 @@ sub new { =item boolean evaluation When the Dpkg::Version object is used in a boolean evaluation (for example -in "if ($v)" or "$v || 'default'") it returns its string representation -if the version stored is valid ($v->is_valid()) and undef otherwise. +in "if ($v)" or "$v ? \"$v\" : 'default'") it returns true if the version +stored is valid ($v->is_valid()) and false otherwise. + +B: Between dpkg 1.15.7.2 and 1.19.1 this overload used to return +$v->as_string() if $v->is_valid(), a breaking change in behavior that caused +"0" versions to be evaluated as false. To catch any possibly intended code +that relied on those semantics, this overload will emit a warning with +category "Dpkg::Version::semantic_change::overload::bool" until dpkg 1.20.x. +Once fixed, or for already valid code the warning can be quiesced with +C. =item $v->is_valid() diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 323fba9e1..4b18545e9 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -546,7 +546,8 @@ foreach my $field (reverse @depfields) { map { # Translate dependency templates into real dependencies my $templ = $_; - if ($dependencies{$field}{$templ}) { + if ($dependencies{$field}{$templ}->is_valid() and + $dependencies{$field}{$templ}->as_string()) { $templ =~ s/#MINVER#/(>= $dependencies{$field}{$templ})/g; } else { $templ =~ s/#MINVER#//g; diff --git a/scripts/t/Dpkg_Version.t b/scripts/t/Dpkg_Version.t index 78db7aead..17e9b4b9e 100644 --- a/scripts/t/Dpkg_Version.t +++ b/scripts/t/Dpkg_Version.t @@ -20,6 +20,7 @@ use Test::More; use Dpkg::ErrorHandling; use Dpkg::IPC; +use Dpkg::Version; report_options(quiet_warnings => 1); @@ -30,7 +31,7 @@ my @ops = ('<', '<<', 'lt', '>=', 'ge', '>', '>>', 'gt'); -plan tests => scalar(@tests) * (3 * scalar(@ops) + 4) + 30; +plan tests => scalar(@tests) * (3 * scalar(@ops) + 4) + 27; sub dpkg_vercmp { my ($a, $cmp, $b) = @_; @@ -57,8 +58,6 @@ sub obj_vercmp { return $a gt $b if $cmp eq 'gt'; } -use_ok('Dpkg::Version'); - my $truth = { '-1' => { '<<' => 1, 'lt' => 1, @@ -83,6 +82,12 @@ my $truth = { }, }; +# XXX: Some of the tests check the bool overload, which currently emits +# the semantic_change warning. Disable it until we stop emitting the +# warning in dpkg 1.20.x. +## no critic (TestingAndDebugging::ProhibitNoWarnings) +no warnings(qw(Dpkg::Version::semantic_change::overload::bool)); + # Handling of empty/invalid versions my $empty = Dpkg::Version->new(''); ok($empty eq '', "Dpkg::Version->new('') eq ''"); @@ -128,12 +133,6 @@ ok(!$ver->is_native(), 'upstream version w/ revision is not native'); $ver = Dpkg::Version->new('1.0-1.0-1'); ok(!$ver->is_native(), 'upstream version w/ dash and revision is not native'); -# Other tests -$ver = Dpkg::Version->new('1.2.3-4'); -is($ver || 'default', '1.2.3-4', 'bool eval returns string representation'); -$ver = Dpkg::Version->new('0'); -is($ver || 'default', 'default', 'bool eval of version 0 is still false...'); - # Comparisons foreach my $case (@tests) { my ($a, $b, $res) = split ' ', $case; diff --git a/t/pod-spell.t b/t/pod-spell.t index 6d3f7ffc9..111d592ca 100644 --- a/t/pod-spell.t +++ b/t/pod-spell.t @@ -83,6 +83,7 @@ modelines multiarch nocheck qa +quiesced reportfile rfc822 sig -- cgit v1.2.3 From 6f903af181057a046a1344aadca552b113a2c2ee Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 17 Aug 2016 00:55:56 +0200 Subject: dpkg-buildpackage: Validate OpenPGP signing key IDs We should not accept short key IDs, and warn about long key IDs. Recommend to use fingerprints. --- debian/changelog | 2 ++ scripts/dpkg-buildpackage.pl | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 56b4c9e12..f2a2ee0e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -59,6 +59,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium same protocol. Thanks to Julian Andres Klode . * Do not emit perl warnings in dpkg-source --help on source formats w/o options. + * Make dpkg-buildpackage validate OpenPGP signing key IDs length. Error out + for short key IDs and warn for long key IDs. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 49c7173a4..dccb8f87e 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -477,6 +477,8 @@ if (build_has_any(BUILD_ARCH_DEP)) { my $pv = "${pkg}_$sversion"; my $pva = "${pkg}_${sversion}_$arch"; +signkey_validate(); + if (not $signcommand) { $signsource = 0; $signbuildinfo = 0; @@ -810,6 +812,21 @@ sub update_files_field { $ctrl->{'Files'} =~ s/^$file_regex$/$md5sum $size $1/m; } +sub signkey_validate { + # Make sure this is an hex keyid. + return unless $signkey =~ m/^(?:0x)?([[:xdigit:]]+)$/; + + my $keyid = $1; + + if (length $keyid <= 8) { + error(g_('short OpenPGP key IDs are broken; ' . + 'please use key fingerprints instead')); + } elsif (length $keyid <= 16) { + warning(g_('long OpenPGP key IDs are strongly discouraged; ' . + 'please use key fingerprints instead')); + } +} + sub signfile { my $file = shift; -- cgit v1.2.3 From ff99aabc8c3d966911137aa05bef4b4cd80671ec Mon Sep 17 00:00:00 2001 From: Helge Kreutzmann Date: Fri, 4 May 2018 19:58:06 +0200 Subject: Update German scripts translation Update to 601t. --- scripts/po/de.po | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/po/de.po b/scripts/po/de.po index 0922cf0e3..9ac65ad1f 100644 --- a/scripts/po/de.po +++ b/scripts/po/de.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: dpkg-dev 1.18.8\n" "Report-Msgid-Bugs-To: debian-dpkg@lists.debian.org\n" -"POT-Creation-Date: 2018-02-22 18:08+0100\n" -"PO-Revision-Date: 2018-02-22 18:21+0100\n" +"POT-Creation-Date: 2018-05-04 19:12+0200\n" +"PO-Revision-Date: 2018-05-04 19:57+0200\n" "Last-Translator: Helge Kreutzmann \n" "Language-Team: German \n" "Language: de\n" @@ -590,6 +590,20 @@ msgstr "" msgid "unknown %% substitution in hook: %%%s" msgstr "unbekannte %% Substitution in Hook: %%%s" +#: scripts/dpkg-buildpackage.pl +msgid "short OpenPGP key IDs are broken; please use key fingerprints instead" +msgstr "" +"kurze OpenGPG-Schlüsselkennungen sind defekt; bitte verwenden Sie " +"stattdessen Fingerabdrücke" + +#: scripts/dpkg-buildpackage.pl +msgid "" +"long OpenPGP key IDs are strongly discouraged; please use key fingerprints " +"instead" +msgstr "" +"von langen OpenPGP-Schlüsselkennungen wird klar abgeraten; bitte verwenden " +"Sie stattdessen Fingerabdrücke" + #: scripts/dpkg-buildpackage.pl scripts/dpkg-checkbuilddeps.pl #: scripts/dpkg-genbuildinfo.pl scripts/dpkg-name.pl scripts/Dpkg/Arch.pm #: scripts/Dpkg/IPC.pm scripts/Dpkg/OpenPGP.pm scripts/Dpkg/Shlibs.pm -- cgit v1.2.3 From 43dc5fa95f5241ce790b727c405f96caaad12c19 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 5 May 2018 02:50:03 +0200 Subject: Dpkg::Changelog::Parse: Stop using tail(1) to read the end of the file Instead of relying on the tail command, simply read the end of the file ourselves, assuming a packed set of 80 character lines, reading 4096 bytes before the end, implies around 51 lines, which is close to the 40 lines currently used. This should be both faster and should improve portability, because even if we are using the POSIX -n option, some systems do not have a POSIX compliant tail(1) on the default path, such as Solaris. Analysis-by: James Clarke --- debian/changelog | 4 ++++ scripts/Dpkg/Changelog/Parse.pm | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 8eb639c44..36b5594d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -99,6 +99,10 @@ dpkg (1.19.1) UNRELEASED; urgency=medium alias. Emit a specific perl warning until 1.20.x so that users can check whether the semantic change has any impact on the code, which can then be quiesced. Closes: #895004 + - Dpkg::Changelog::Parse: When detecting the changelog format, read the + last 4KiB of the file instead of using «tail -n40», which should be + both faster and more portable, as the default tail(1) is not POSIX + compliant on all systems (c.f. Solaris). * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Changelog/Parse.pm b/scripts/Dpkg/Changelog/Parse.pm index e107dcf6d..28bb6892a 100644 --- a/scripts/Dpkg/Changelog/Parse.pm +++ b/scripts/Dpkg/Changelog/Parse.pm @@ -56,12 +56,16 @@ sub _changelog_detect_format { if ($file ne '-') { local $_; - open my $format_fh, '-|', 'tail', '-n', '40', $file - or syserr(g_('cannot create pipe for %s'), 'tail'); + open my $format_fh, '<', $file + or syserr(g_('cannot open file %s'), $file); + if (-s $format_fh > 4096) { + seek $format_fh, -4096, 2 + or syserr(g_('cannot seek into file %s'), $file); + } while (<$format_fh>) { $format = $1 if m/\schangelog-format:\s+([0-9a-z]+)\W/; } - close $format_fh or subprocerr(g_('tail of %s'), $file); + close $format_fh; } return $format; -- cgit v1.2.3 From f75c579ac18d0a9956cd1fd5275fe797e8cb89f8 Mon Sep 17 00:00:00 2001 From: Helge Kreutzmann Date: Sat, 5 May 2018 05:03:04 +0200 Subject: Update German scripts translation Update to 600t. --- scripts/po/de.po | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/po/de.po b/scripts/po/de.po index 9ac65ad1f..5b1ee4113 100644 --- a/scripts/po/de.po +++ b/scripts/po/de.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: dpkg-dev 1.18.8\n" "Report-Msgid-Bugs-To: debian-dpkg@lists.debian.org\n" -"POT-Creation-Date: 2018-05-04 19:12+0200\n" -"PO-Revision-Date: 2018-05-04 19:57+0200\n" +"POT-Creation-Date: 2018-05-05 04:58+0200\n" +"PO-Revision-Date: 2018-05-05 05:01+0200\n" "Last-Translator: Helge Kreutzmann \n" "Language-Team: German \n" "Language: de\n" @@ -1842,7 +1842,8 @@ msgid "shared libs info file '%s' line %d: bad line '%s'" msgstr "" "Informationsdatei »%s« der Laufzeitbibliothek, Zeile %d: ungültige Zeile »%s«" -#: scripts/dpkg-shlibdeps.pl scripts/Dpkg/Checksums.pm +#: scripts/dpkg-shlibdeps.pl scripts/Dpkg/Changelog/Parse.pm +#: scripts/Dpkg/Checksums.pm #, perl-format msgid "cannot open file %s" msgstr "Datei %s kann nicht geöffnet werden" @@ -2430,13 +2431,8 @@ msgstr "der Abspann passte nicht auf den erwarteten regulären Ausdruck" #: scripts/Dpkg/Changelog/Parse.pm #, perl-format -msgid "cannot create pipe for %s" -msgstr "Pipe für %s kann nicht angelegt werden" - -#: scripts/Dpkg/Changelog/Parse.pm -#, perl-format -msgid "tail of %s" -msgstr "Ende von %s" +msgid "cannot seek into file %s" +msgstr "auf die Datei %s kann nicht mit seek zugegriffen werden" #: scripts/Dpkg/Changelog/Parse.pm #, perl-format @@ -3958,6 +3954,12 @@ msgstr "Versionsnummer enthält ungültiges Zeichen »%s«" msgid "epoch part of the version number is not a number: '%s'" msgstr "Epoch-Teil der Versionsnummer ist keine Zahl: »%s«" +#~ msgid "cannot create pipe for %s" +#~ msgstr "Pipe für %s kann nicht angelegt werden" + +#~ msgid "tail of %s" +#~ msgstr "Ende von %s" + #~ msgid "%s died from signal %s" #~ msgstr "%s wurde durch Signal %s getötet" -- cgit v1.2.3 From df0a86de45006f9f2b2980a0ad2e81640271a685 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 8 May 2018 14:16:38 +0200 Subject: dpkg-buildpackage: Avoid using an uninitialized variable If DEB_SIGN_KEYID is not set in the environment or the signing key is not passed via --sign-key, dpkg-buildpackage emits a perl warning. Warned-by: perl Fixes: commit 6f903af181057a046a1344aadca552b113a2c2ee Based-on-patch-by: Sven Joachim --- scripts/dpkg-buildpackage.pl | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index dccb8f87e..ee41555d7 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -813,6 +813,7 @@ sub update_files_field { } sub signkey_validate { + return unless defined $signkey; # Make sure this is an hex keyid. return unless $signkey =~ m/^(?:0x)?([[:xdigit:]]+)$/; -- cgit v1.2.3 From 40eccd5c044c874cf7fa5f8dc8e2c75379395d8a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 14 May 2018 23:26:07 +0200 Subject: scripts: Do not use stringy eval to define different sub implementations We can just assign an anonymous sub to the typeglob. --- debian/changelog | 3 +++ scripts/Dpkg/Gettext.pm | 58 +++++++++++++++++++---------------------- scripts/dpkg-mergechangelogs.pl | 10 +++---- 3 files changed, 34 insertions(+), 37 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 01585aef7..14a311e31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -114,6 +114,9 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Document the Testsuite and Testsuite-Triggers fields in deb-src-control(5). Prompted by Mattia Rizzolo . - Update git URLs for move away from alioth.debian.org. + * Code internals: + - Do not use stringy eval to define different sub implementations, + just assign an anonymous sub to the typeglob. * Build system: - Set distribution tarball format to ustar, instead of default v7 format. - Mark PO4A and POD2MAN as precious variables. diff --git a/scripts/Dpkg/Gettext.pm b/scripts/Dpkg/Gettext.pm index 2e3e5042e..33ef1c48d 100644 --- a/scripts/Dpkg/Gettext.pm +++ b/scripts/Dpkg/Gettext.pm @@ -118,41 +118,37 @@ BEGIN { $use_gettext = not $@; } if (not $use_gettext) { - eval q{ - sub g_ { - return shift; - } - sub textdomain { - } - sub ngettext { - my ($msgid, $msgid_plural, $n) = @_; - if ($n == 1) { - return $msgid; - } else { - return $msgid_plural; - } - } - sub C_ { - my ($msgctxt, $msgid) = @_; + *g_ = sub { + return shift; + }; + *textdomain = sub { + }; + *ngettext = sub { + my ($msgid, $msgid_plural, $n) = @_; + if ($n == 1) { return $msgid; + } else { + return $msgid_plural; } - sub P_ { - return ngettext(@_); - } + }; + *C_ = sub { + my ($msgctxt, $msgid) = @_; + return $msgid; + }; + *P_ = sub { + return ngettext(@_); }; } else { - eval q{ - sub g_ { - return dgettext($DEFAULT_TEXT_DOMAIN, shift); - } - sub C_ { - my ($msgctxt, $msgid) = @_; - return dgettext($DEFAULT_TEXT_DOMAIN, - $msgctxt . GETTEXT_CONTEXT_GLUE . $msgid); - } - sub P_ { - return dngettext($DEFAULT_TEXT_DOMAIN, @_); - } + *g_ = sub { + return dgettext($DEFAULT_TEXT_DOMAIN, shift); + }; + *C_ = sub { + my ($msgctxt, $msgid) = @_; + return dgettext($DEFAULT_TEXT_DOMAIN, + $msgctxt . GETTEXT_CONTEXT_GLUE . $msgid); + }; + *P_ = sub { + return dngettext($DEFAULT_TEXT_DOMAIN, @_); }; } } diff --git a/scripts/dpkg-mergechangelogs.pl b/scripts/dpkg-mergechangelogs.pl index 7fd11fc96..20b33dc75 100755 --- a/scripts/dpkg-mergechangelogs.pl +++ b/scripts/dpkg-mergechangelogs.pl @@ -43,12 +43,10 @@ BEGIN { use Algorithm::Merge qw(merge); }; if ($@) { - eval q{ - sub merge { - my ($o, $a, $b) = @_; - return @$a if join("\n", @$a) eq join("\n", @$b); - return get_conflict_block($a, $b); - } + *merge = sub { + my ($o, $a, $b) = @_; + return @$a if join("\n", @$a) eq join("\n", @$b); + return get_conflict_block($a, $b); }; } } -- cgit v1.2.3 From 5cd52673aabdf5eaa58181972119a41041fc85f2 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 23 Jul 2018 13:13:19 +0200 Subject: dpkg-buildpackage: Fix --rules-file option parsing Parse --rules-file instead of --rules-target, which made it a no-op. Fixes: commit 293bd243a19149165fc4fd8830b16a51d471a5e9 Stable-Candidate: 1.18.x --- debian/changelog | 2 ++ scripts/dpkg-buildpackage.pl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 14a311e31..1cee622ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -64,6 +64,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium for short key IDs and warn for long key IDs. * On the dpkg conffile prompt, print the set of environment variables setup for the conffile shell, for easier discoverability. + * Fix dpkg-buildpackage option --rules-file parsing. It was trying to parse + it as --rules-target, which due to the ordering was a no-op. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index ee41555d7..ea2c61a47 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -346,7 +346,7 @@ while (@ARGV) { } elsif (m/^-[EW]$/) { # Deprecated option warning(g_('-E and -W are deprecated, they are without effect')); - } elsif (/^-R(.*)$/ or /^--rules-target=(.*)$/) { + } elsif (/^-R(.*)$/ or /^--rules-file=(.*)$/) { my $arg = $1; @debian_rules = split ' ', $arg; } else { -- cgit v1.2.3 From 503ab33b937ced36c154952c026c0f608ae1180e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 5 Jul 2018 05:19:09 +0200 Subject: dpkg-buildpackage: Only check for fallback build targets on binary builds If we are not going to build any binary package, there is no point in checking whether we need to run any of the build targets. --- debian/changelog | 2 ++ scripts/dpkg-buildpackage.pl | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 1cee622ad..de40e2e23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -66,6 +66,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium for the conffile shell, for easier discoverability. * Fix dpkg-buildpackage option --rules-file parsing. It was trying to parse it as --rules-target, which due to the ordering was a no-op. + * Only check for fallback build targets presence on binary builds in + dpkg-buildpackage. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index ea2c61a47..64c80635c 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -553,13 +553,14 @@ if (build_has_any(BUILD_SOURCE)) { run_hook('build', build_has_any(BUILD_BINARY)); -# XXX Use some heuristics to decide whether to use build-{arch,indep} targets. -# This is a temporary measure to not break too many packages on a flag day. -build_target_fallback($ctrl); - my $build_types = get_build_options_from_type(); if (build_has_any(BUILD_BINARY)) { + # XXX Use some heuristics to decide whether to use build-{arch,indep} + # targets. This is a temporary measure to not break too many packages + # on a flag day. + build_target_fallback($ctrl); + # If we are building rootless, there is no need to call the build target # independently as non-root. run_cmd(@debian_rules, $buildtarget) if rules_requires_root($binarytarget); -- cgit v1.2.3 From ca394f0f03e9ab025a09e4c99ad4ccfc73550f46 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 23 Jul 2018 11:58:23 +0200 Subject: Dpkg::Build::Types: Fix set_build_type_from_options() description --- debian/changelog | 1 + scripts/Dpkg/Build/Types.pm | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index de40e2e23..700f69715 100644 --- a/debian/changelog +++ b/debian/changelog @@ -118,6 +118,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Document the Testsuite and Testsuite-Triggers fields in deb-src-control(5). Prompted by Mattia Rizzolo . - Update git URLs for move away from alioth.debian.org. + - Fix set_build_type_from_options() description in Dpkg::Build::Types. * Code internals: - Do not use stringy eval to define different sub implementations, just assign an anonymous sub to the typeglob. diff --git a/scripts/Dpkg/Build/Types.pm b/scripts/Dpkg/Build/Types.pm index 45a81d3ba..b6c2366f3 100644 --- a/scripts/Dpkg/Build/Types.pm +++ b/scripts/Dpkg/Build/Types.pm @@ -193,9 +193,10 @@ sub set_build_type $current_option = $build_option; } -=item set_build_type_from_options($build_type, $build_option, %opts) +=item set_build_type_from_options($build_types, $build_option, %opts) -Set the current build type from a list of build type components. +Set the current build type from a list of comma-separated build type +components. The function will check and abort on incompatible build type assignments, this behavior can be disabled by using the boolean option "nocheck". -- cgit v1.2.3 From 23322f43e80ce0c67a361b3b00c680e170fee58f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 23 Jul 2018 12:02:38 +0200 Subject: Dpkg::Build::Types: Add new set_build_type_from_targets() function --- debian/changelog | 1 + scripts/Dpkg/Build/Types.pm | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 700f69715..059de6ed5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -109,6 +109,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium last 4KiB of the file instead of using «tail -n40», which should be both faster and more portable, as the default tail(1) is not POSIX compliant on all systems (c.f. Solaris). + - Dpkg::Build::Types: Add new set_build_type_from_targets() function. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Build/Types.pm b/scripts/Dpkg/Build/Types.pm index b6c2366f3..9fd0344df 100644 --- a/scripts/Dpkg/Build/Types.pm +++ b/scripts/Dpkg/Build/Types.pm @@ -33,6 +33,7 @@ our @EXPORT = qw( build_is set_build_type set_build_type_from_options + set_build_type_from_targets get_build_options_from_type ); @@ -108,6 +109,15 @@ my %build_types = ( any => BUILD_ARCH_DEP, all => BUILD_ARCH_INDEP, ); +my %build_targets = ( + 'clean' => BUILD_SOURCE, + 'build' => BUILD_BINARY, + 'build-arch' => BUILD_ARCH_DEP, + 'build-indep' => BUILD_ARCH_INDEP, + 'binary' => BUILD_BINARY, + 'binary-arch' => BUILD_ARCH_DEP, + 'binary-indep' => BUILD_ARCH_INDEP, +); =back @@ -217,6 +227,28 @@ sub set_build_type_from_options set_build_type($build_type, $build_option, %opts); } +=item set_build_type_from_targets($build_targets, $build_option, %opts) + +Set the current build type from a list of comma-separated build target +components. + +The function will check and abort on incompatible build type assignments, +this behavior can be disabled by using the boolean option "nocheck". + +=cut + +sub set_build_type_from_targets +{ + my ($build_targets, $build_option, %opts) = @_; + + my $build_type = 0; + foreach my $target (split /,/, $build_targets) { + $build_type |= $build_targets{$target} // BUILD_BINARY; + } + + set_build_type($build_type, $build_option, %opts); +} + =item get_build_options_from_type() Get the current build type as a set of comma-separated string options. -- cgit v1.2.3 From 2dadfc74f74f66ee7685ad402ad99dc9ea1476c0 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 23 Jul 2018 12:08:58 +0200 Subject: dpkg-buildpackage: Only check required build dependencies for known targets When we specify the debian/rules targets to call with --rules-target, we should check only the build dependencies required bu those targets, and nothing more. Reported-by: Johannes Schauer --- debian/changelog | 3 +++ scripts/dpkg-buildpackage.pl | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 059de6ed5..58308cfdb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -68,6 +68,9 @@ dpkg (1.19.1) UNRELEASED; urgency=medium it as --rules-target, which due to the ordering was a no-op. * Only check for fallback build targets presence on binary builds in dpkg-buildpackage. + * Only check required build dependencies for known targets specified with + dpkg-buildpackage --rules-target option. + Reported by Johannes Schauer . * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 64c80635c..5b9fd441f 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -354,6 +354,11 @@ while (@ARGV) { } } +if (@call_target) { + my $targets = join ',', @call_target; + set_build_type_from_targets($targets, '--rules-target', nocheck => 1); +} + if (build_has_all(BUILD_BINARY)) { $buildtarget = 'build'; $binarytarget = 'binary'; -- cgit v1.2.3 From d9bc580a419232420abb9620638cfbfe74943ff2 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 23 May 2018 03:58:27 +0200 Subject: test: Add new po author test Use i18nspector (if available) to check the .po and .pot files. --- Makefile.am | 1 + debian/changelog | 1 + scripts/Test/Dpkg.pm | 26 ++++++++++++++++++++++++++ t/po.t | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 t/po.t (limited to 'scripts') diff --git a/Makefile.am b/Makefile.am index 05bf93835..972889a89 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,6 +149,7 @@ coverage-clean: endif test_scripts = \ + t/po.t \ t/pod.t \ t/pod-spell.t \ t/pod-coverage.t \ diff --git a/debian/changelog b/debian/changelog index 81490983b..2ceefc850 100644 --- a/debian/changelog +++ b/debian/changelog @@ -159,6 +159,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Consider *.PL also to be perl files. - Infer automatically the unit test data directory. - Infer automatically the unit test temp directory. + - Add new po author test case (use i18nspector if available). [ Updated programs translations ] * Dutch (Frans Spiesschaert). Closes: #881401 diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm index 4900e1f91..c59296858 100644 --- a/scripts/Test/Dpkg.pm +++ b/scripts/Test/Dpkg.pm @@ -20,8 +20,10 @@ use warnings; our $VERSION = '0.00'; our @EXPORT_OK = qw( + all_po_files all_perl_files all_perl_modules + test_get_po_dirs test_get_perl_dirs test_get_data_path test_get_temp_path @@ -39,8 +41,10 @@ our %EXPORT_TAGS = ( test_needs_srcdir_switch ) ], paths => [ qw( + all_po_files all_perl_files all_perl_modules + test_get_po_dirs test_get_perl_dirs test_get_data_path test_get_temp_path @@ -95,6 +99,15 @@ sub test_get_temp_path return $path; } +sub test_get_po_dirs +{ + if ($test_mode eq 'cpan') { + return qw(po); + } else { + return qw(po scripts/po dselect/po man/po); + } +} + sub test_get_perl_dirs { if ($test_mode eq 'cpan') { @@ -104,6 +117,19 @@ sub test_get_perl_dirs } } +sub all_po_files +{ + my $filter = shift // qr/\.(?:po|pot)$/; + my @files; + my $scan_po_files = sub { + push @files, $File::Find::name if m/$filter/; + }; + + find($scan_po_files, test_get_po_dirs()); + + return @files; +} + sub all_perl_files { my $filter = shift // qr/\.(?:PL|pl|pm|t)$/; diff --git a/t/po.t b/t/po.t new file mode 100644 index 000000000..d2c01bd3f --- /dev/null +++ b/t/po.t @@ -0,0 +1,50 @@ +#!/usr/bin/perl +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +use strict; +use warnings; + +use Test::More; +use Test::Dpkg qw(:needs); + +test_needs_author(); +test_needs_command('i18nspector'); +test_needs_srcdir_switch(); + +my @files = Test::Dpkg::all_po_files(); + +plan tests => scalar @files; + +sub po_ok { + my $file = shift; + + my $tags = qx(i18nspector \"$file\" 2>&1); + + # Fixup the output: + $tags =~ s/^.*\.pot: boilerplate-in-initial-comments .*$//mg; + $tags =~ s/^.*\.po: duplicate-header-field X-POFile-SpellExtra$//mg; + chomp $tags; + + my $ok = length $tags == 0; + + ok($ok, "PO check $file"); + if (not $ok) { + diag($tags); + } +} + +for my $file (@files) { + po_ok($file); +} -- cgit v1.2.3 From 76daf7b7dd594d720f81fa32fbf3e19c1fb9e5ff Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 5 Jun 2018 05:25:58 +0200 Subject: Dpkg::Version: Bump VERSION and improve semantic change description Give context to the warning message, otherwise it's not clear what is going on. If the users to not conditionalize the warning usage they will get a perl warning about the unknown warning category itself, bump the module version to be able to discern this change, and update documentation to reflect this. --- scripts/Dpkg/Version.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/Dpkg/Version.pm b/scripts/Dpkg/Version.pm index a06ba268d..2900e5790 100644 --- a/scripts/Dpkg/Version.pm +++ b/scripts/Dpkg/Version.pm @@ -22,7 +22,7 @@ use strict; use warnings; use warnings::register qw(semantic_change::overload::bool); -our $VERSION = '1.01'; +our $VERSION = '1.02'; our @EXPORT = qw( version_compare version_compare_relation @@ -58,8 +58,8 @@ use overload '""' => sub { return $_[0]->as_string(); }, 'bool' => sub { warnings::warnif('Dpkg::Version::semantic_change::overload::bool', - 'bool overload behavior has changed back to be ' . - 'an is_valid() alias'); + 'Dpkg::Version bool overload behavior has changed ' . + 'back to be an is_valid() alias'); return $_[0]->is_valid(); }, 'fallback' => 1; @@ -136,7 +136,11 @@ $v->as_string() if $v->is_valid(), a breaking change in behavior that caused that relied on those semantics, this overload will emit a warning with category "Dpkg::Version::semantic_change::overload::bool" until dpkg 1.20.x. Once fixed, or for already valid code the warning can be quiesced with -C. + + no if $Dpkg::Version::VERSION ge '1.02', + warnings => qw(Dpkg::Version::semantic_change::overload::bool); + +added after the C. =item $v->is_valid() @@ -469,6 +473,10 @@ sub version_check($) { =head1 CHANGES +=head2 Version 1.02 (dpkg 1.19.1) + +Semantic change: bool evaluation semantics restored to their original behavior. + =head2 Version 1.01 (dpkg 1.17.0) New argument: Accept an options argument in $v->as_string(). -- cgit v1.2.3 From 563fd74ef926b23207d58108071d91b7c8ba2507 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 14 Jun 2018 02:51:24 +0200 Subject: Dpkg::Shlibs::SymbolFile: Always assign proper Dpkg::Version to deprecated We should always assign a proper Dpkg::Version object to the deprecated variable. Otherwise it can get confused with the scalar value 0 used on boolean context to denote it is *not* deprecated, instead of it being a version number 0. --- debian/changelog | 4 ++++ scripts/Dpkg/Shlibs/SymbolFile.pm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index a5920996b..ab1757193 100644 --- a/debian/changelog +++ b/debian/changelog @@ -118,6 +118,10 @@ dpkg (1.19.1) UNRELEASED; urgency=medium both faster and more portable, as the default tail(1) is not POSIX compliant on all systems (c.f. Solaris). - Dpkg::Build::Types: Add new set_build_type_from_targets() function. + - Dpkg::Shlibs::SymbolFile: Always assign a proper Dpkg::Version to the + deprecated variable, otherwise the scalar value 0 can get confused + on scalar context to denote it is *not* deprecated instead of being + version 0. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm index b36d542ce..1a165c9d0 100644 --- a/scripts/Dpkg/Shlibs/SymbolFile.pm +++ b/scripts/Dpkg/Shlibs/SymbolFile.pm @@ -224,7 +224,7 @@ sub parse { error(g_('symbol information must be preceded by a header (file %s, line %s)'), $file, $.); } # Symbol specification - my $deprecated = ($1) ? $1 : 0; + my $deprecated = ($1) ? Dpkg::Version->new($1) : 0; my $sym = _new_symbol($state->{base_symbol}, deprecated => $deprecated); if ($self->create_symbol($2, base => $sym)) { $self->add_symbol($sym, ${$state->{obj_ref}}); -- cgit v1.2.3 From 63e02e0aabe17cb87929037db3939b3e575e97f6 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 14 Jun 2018 02:53:23 +0200 Subject: Dpkg::Shlibs: Disable bool overload Dpkg::Version warnings The usage in this file is correct, but we are still doing boolean evaluation. --- debian/changelog | 1 + scripts/Dpkg/Shlibs/Symbol.pm | 4 ++++ scripts/Dpkg/Shlibs/SymbolFile.pm | 4 ++++ 3 files changed, 9 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index ab1757193..2bd44d571 100644 --- a/debian/changelog +++ b/debian/changelog @@ -122,6 +122,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium deprecated variable, otherwise the scalar value 0 can get confused on scalar context to denote it is *not* deprecated instead of being version 0. + - Dpkg::Shlibs: Disable bool overload Dpkg::Version warnings. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Shlibs/Symbol.pm b/scripts/Dpkg/Shlibs/Symbol.pm index 802681bf1..142992b89 100644 --- a/scripts/Dpkg/Shlibs/Symbol.pm +++ b/scripts/Dpkg/Shlibs/Symbol.pm @@ -33,6 +33,10 @@ use Dpkg::Shlibs::Cppfilt; # Supported alias types in the order of matching preference use constant ALIAS_TYPES => qw(c++ symver); +# Needed by the deprecated key, which is a correct use. +no if $Dpkg::Version::VERSION ge '1.02', + warnings => qw(Dpkg::Version::semantic_change::overload::bool); + sub new { my ($this, %args) = @_; my $class = ref($this) || $this; diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm index 1a165c9d0..4b1c7ef50 100644 --- a/scripts/Dpkg/Shlibs/SymbolFile.pm +++ b/scripts/Dpkg/Shlibs/SymbolFile.pm @@ -30,6 +30,10 @@ use Dpkg::Arch qw(get_host_arch); use parent qw(Dpkg::Interface::Storable); +# Needed by the deprecated key, which is a correct use. +no if $Dpkg::Version::VERSION ge '1.02', + warnings => qw(Dpkg::Version::semantic_change::overload::bool); + my %blacklist = ( __bss_end__ => 1, # arm __bss_end => 1, # arm -- cgit v1.2.3 From 2d02a12697808b01b360e7ceb52864c0873f7eac Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 16 Jun 2018 18:33:15 +0200 Subject: Dpkg::Vendor::Debian: Inline _parse_feature_area() into _add_build_flags() This function was being called on each foreach iteration to parse the options within the DEB_BUILD_MAINT_OPTIONS and DEB_BUILD_OPTIONS environment variables, and needed to parse these at construction time every time. Inlining it should make it more performant and in addition reduce line count. --- debian/changelog | 2 ++ scripts/Dpkg/Vendor/Debian.pm | 20 +++++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 2bd44d571..98146943d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -123,6 +123,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium on scalar context to denote it is *not* deprecated instead of being version 0. - Dpkg::Shlibs: Disable bool overload Dpkg::Version warnings. + - Dpkg::Vendor::Debian: Inline _parse_feature_area() into + _add_build_flags(), for a small speed up and line count reduction. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm index 814948e83..2e42a8b86 100644 --- a/scripts/Dpkg/Vendor/Debian.pm +++ b/scripts/Dpkg/Vendor/Debian.pm @@ -86,18 +86,6 @@ sub run_hook { } } -sub _parse_feature_area { - my ($self, $area, $use_feature) = @_; - - require Dpkg::BuildOptions; - - # Adjust features based on user or maintainer's desires. - my $opts = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS'); - $opts->parse_features($area, $use_feature); - $opts = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_MAINT_OPTIONS'); - $opts->parse_features($area, $use_feature); -} - sub _add_build_flags { my ($self, $flags) = @_; @@ -141,9 +129,15 @@ sub _add_build_flags { ## Setup + require Dpkg::BuildOptions; + # Adjust features based on user or maintainer's desires. + my $opts_build = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS'); + my $opts_maint = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_MAINT_OPTIONS'); + foreach my $area (sort keys %use_feature) { - $self->_parse_feature_area($area, $use_feature{$area}); + $opts_build->parse_features($area, $use_feature{$area}); + $opts_maint->parse_features($area, $use_feature{$area}); } require Dpkg::Arch; -- cgit v1.2.3 From d5374bc618310917557daa9c9ac2f4930515a0b2 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 16 Jun 2018 18:33:15 +0200 Subject: Dpkg::BuildFlags: Move default flags setting into the Dpkg::Vendor modules This should really be a vendor specific default. It's also documented that way in the man page. --- debian/changelog | 2 ++ scripts/Dpkg/BuildFlags.pm | 18 +++++++----------- scripts/Dpkg/Vendor/Debian.pm | 18 +++++++++++++++++- 3 files changed, 26 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 98146943d..1a1dbe0c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -125,6 +125,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::Shlibs: Disable bool overload Dpkg::Version warnings. - Dpkg::Vendor::Debian: Inline _parse_feature_area() into _add_build_flags(), for a small speed up and line count reduction. + - Dpkg::BuildFlags: Move default flags setting into the Dpkg::Vendor + modules. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm index 0533b12b5..a8fd4584a 100644 --- a/scripts/Dpkg/BuildFlags.pm +++ b/scripts/Dpkg/BuildFlags.pm @@ -23,7 +23,6 @@ our $VERSION = '1.03'; use Dpkg (); use Dpkg::Gettext; use Dpkg::Build::Env; -use Dpkg::BuildOptions; use Dpkg::ErrorHandling; use Dpkg::Vendor qw(run_vendor_hook); @@ -72,18 +71,15 @@ sub load_vendor_defaults { $self->{options} = {}; $self->{source} = {}; $self->{features} = {}; - my $build_opts = Dpkg::BuildOptions->new(); - $self->{build_options} = $build_opts; - my $default_flags = $build_opts->has('noopt') ? '-g -O0' : '-g -O2'; $self->{flags} = { CPPFLAGS => '', - CFLAGS => $default_flags, - CXXFLAGS => $default_flags, - OBJCFLAGS => $default_flags, - OBJCXXFLAGS => $default_flags, - GCJFLAGS => $default_flags, - FFLAGS => $default_flags, - FCFLAGS => $default_flags, + CFLAGS => '', + CXXFLAGS => '', + OBJCFLAGS => '', + OBJCXXFLAGS => '', + GCJFLAGS => '', + FFLAGS => '', + FCFLAGS => '', LDFLAGS => '', }; $self->{origin} = { diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm index 2e42a8b86..1e8f24397 100644 --- a/scripts/Dpkg/Vendor/Debian.pm +++ b/scripts/Dpkg/Vendor/Debian.pm @@ -150,6 +150,22 @@ sub _add_build_flags { ($abi, $os, $cpu) = ('', '', ''); } + ## Global defaults + + my $default_flags; + if ($opts_build->has('noopt')) { + $default_flags = '-g -O0'; + } else { + $default_flags = '-g -O2'; + } + $flags->append('CFLAGS', $default_flags); + $flags->append('CXXFLAGS', $default_flags); + $flags->append('OBJCFLAGS', $default_flags); + $flags->append('OBJCXXFLAGS', $default_flags); + $flags->append('FFLAGS', $default_flags); + $flags->append('FCFLAGS', $default_flags); + $flags->append('GCJFLAGS', $default_flags); + ## Area: future if ($use_feature{future}{lfs}) { @@ -305,7 +321,7 @@ sub _add_build_flags { } # Mask features that might be influenced by other flags. - if ($flags->{build_options}->has('noopt')) { + if ($opts_build->has('noopt')) { # glibc 2.16 and later warn when using -O0 and _FORTIFY_SOURCE. $use_feature{hardening}{fortify} = 0; } -- cgit v1.2.3 From 48c809f7c8e1949519c209c6ec74a6e2db4fd164 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 24 Jul 2018 00:33:01 +0200 Subject: dpkg-buildpackage: Rename $cleansource to $postclean Makes the purpose of the variable clear. --- scripts/dpkg-buildpackage.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 5b9fd441f..e8892269f 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -148,7 +148,7 @@ my @debian_rules = ('debian/rules'); my @rootcommand = (); my $signcommand; my $noclean; -my $cleansource; +my $postclean = 0; my $parallel; my $parallel_force = 0; my $checkbuilddep = 1; @@ -293,7 +293,7 @@ while (@ARGV) { } elsif (/^-(?:s[nsAkurKUR]|[zZ].*|i.*|I.*)$/) { push @source_opts, $_; # passed to dpkg-source } elsif (/^-tc$/ or /^--post-clean$/) { - $cleansource = 1; + $postclean = 1; } elsif (/^-t$/ or /^--host-type$/) { $host_type = shift; # Order DOES matter! } elsif (/^-t(.*)$/ or /^--host-type=(.*)$/) { @@ -599,9 +599,9 @@ $changes->parse($changes_fh, g_('parse changes file')); $changes->save($chg); close $changes_fh or subprocerr(g_('dpkg-genchanges')); -run_hook('postclean', $cleansource); +run_hook('postclean', $postclean); -if ($cleansource) { +if ($postclean) { run_rules_cond_root('clean'); } -- cgit v1.2.3 From 4014981b968a8e3c734d5113ce7a323d3ace13ad Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 24 Jul 2018 00:37:33 +0200 Subject: dpkg-buildpackage: Rename and logic invert $noclean to $postclean Makes the purpose of the variable clear. --- scripts/dpkg-buildpackage.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index e8892269f..460153c9d 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -147,7 +147,7 @@ my $admindir; my @debian_rules = ('debian/rules'); my @rootcommand = (); my $signcommand; -my $noclean; +my $preclean = 1; my $postclean = 0; my $parallel; my $parallel_force = 0; @@ -316,9 +316,9 @@ while (@ARGV) { } elsif (/^--as-root$/) { $call_target_as_root = 1; } elsif (/^--pre-clean$/) { - $noclean = 0; + $preclean = 1; } elsif (/^-nc$/ or /^--no-pre-clean$/) { - $noclean = 1; + $preclean = 0; } elsif (/^--build=(.*)$/) { set_build_type_from_options($1, $_); } elsif (/^-b$/) { @@ -370,7 +370,7 @@ if (build_has_all(BUILD_BINARY)) { $binarytarget = 'binary-indep'; } -if ($noclean) { +if (not $preclean) { # -nc without -b/-B/-A/-S/-F implies -b set_build_type(BUILD_BINARY) if build_has_any(BUILD_DEFAULT); # -nc with -S implies no dependency checks @@ -542,9 +542,9 @@ foreach my $call_target (@call_target) { } exit 0 if scalar @call_target; -run_hook('preclean', ! $noclean); +run_hook('preclean', $preclean); -unless ($noclean) { +if ($preclean) { run_rules_cond_root('clean'); } @@ -552,7 +552,7 @@ run_hook('source', build_has_any(BUILD_SOURCE)); if (build_has_any(BUILD_SOURCE)) { warning(g_('building a source package without cleaning up as you asked; ' . - 'it might contain undesired files')) if $noclean; + 'it might contain undesired files')) if not $preclean; run_cmd('dpkg-source', @source_opts, '-b', '.'); } -- cgit v1.2.3 From 8a45c914095bcb19a873b20099e161efe3237bfc Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 24 Jul 2018 00:47:01 +0200 Subject: dpkg-buildpackage: Add new --no-post-clean option This makes it possible to select the current default behavior. --- debian/changelog | 2 ++ man/dpkg-buildpackage.man | 5 +++++ scripts/dpkg-buildpackage.pl | 3 +++ 3 files changed, 10 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 1a1dbe0c8..8d449738a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -76,6 +76,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium * Use Synopsis instead of Summary for the short Description, to unify the nomenclature and to make it more descriptive. Add a new binary:Synopsis virtual field to dpkg-query show format. + * Add new dpkg-buildpackage --no-post-clean option, to be able to explicitly + select the current default behavior. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man index 906351100..4b3256e4b 100644 --- a/man/dpkg-buildpackage.man +++ b/man/dpkg-buildpackage.man @@ -295,6 +295,11 @@ Clean the source tree (using .BR "debian/rules clean" ) after the package has been built (long option since dpkg 1.18.8). .TP +.BR \-\-no\-post\-clean +Do not clean the source tree after the package has been built +(since dpkg 1.19.1). +This is the default behavior. +.TP .BR \-r ", " \-\-root\-command= \fIgain-root-command\fP When .B dpkg\-buildpackage diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 460153c9d..1eabd13d2 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -72,6 +72,7 @@ sub usage { -S source-only, no binary files. -nc, --no-pre-clean do not pre clean source tree (implies -b). --pre-clean pre clean source tree (default). + --no-post-clean do not post clean source tree (default). -tc, --post-clean clean source tree when finished. -D check build dependencies and conflicts (default). -d do not check build dependencies and conflicts. @@ -294,6 +295,8 @@ while (@ARGV) { push @source_opts, $_; # passed to dpkg-source } elsif (/^-tc$/ or /^--post-clean$/) { $postclean = 1; + } elsif (/^--no-post-clean$/) { + $postclean = 0; } elsif (/^-t$/ or /^--host-type$/) { $host_type = shift; # Order DOES matter! } elsif (/^-t(.*)$/ or /^--host-type=(.*)$/) { -- cgit v1.2.3 From 0a1573e5df2f38eb0d2c2c29654cb8c352474c1e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 24 Jul 2018 00:47:01 +0200 Subject: dpkg-buildpackage: Clarify pre and post-clean options and their default state --- debian/changelog | 2 ++ man/dpkg-buildpackage.man | 3 ++- scripts/dpkg-buildpackage.pl | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 8d449738a..71ccbbc37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -140,6 +140,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Update git URLs for move away from alioth.debian.org. - Fix set_build_type_from_options() description in Dpkg::Build::Types. - Clarify PIE build flag feature semantics. Closes: #900088 + - Clarify dpkg-buildpackage pre and post-clean options and their default + state. * Code internals: - Do not use stringy eval to define different sub implementations, just assign an anonymous sub to the typeglob. diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man index 4b3256e4b..10c853ba2 100644 --- a/man/dpkg-buildpackage.man +++ b/man/dpkg-buildpackage.man @@ -281,13 +281,14 @@ Do not honor the \fBRules\-Requires\-Root\fP field, falling back to its legacy default value (since dpkg 1.19.1). .TP .BR \-nc ", " \-\-no\-pre\-clean -Do not clean the source tree (long option since dpkg 1.18.8). +Do not clean the source tree before building (long option since dpkg 1.18.8). Implies \fB\-b\fP if nothing else has been selected among \fB\-F\fP, \fB\-g\fP, \fB\-G\fP, \fB\-B\fP, \fB\-A\fP or \fB\-S\fP. Implies \fB\-d\fP with \fB\-S\fP (since dpkg 1.18.0). .TP .BR \-\-pre\-clean Clean the source tree before building (since dpkg 1.18.8). +This is the default behavior. .TP .BR \-tc ", " \-\-post\-clean Clean the source tree (using diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 1eabd13d2..9bc8c9d28 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -71,9 +71,9 @@ sub usage { -A binary-only, only arch-indep files. -S source-only, no binary files. -nc, --no-pre-clean do not pre clean source tree (implies -b). - --pre-clean pre clean source tree (default). + --pre-clean pre clean source tree (default). --no-post-clean do not post clean source tree (default). - -tc, --post-clean clean source tree when finished. + -tc, --post-clean post clean source tree. -D check build dependencies and conflicts (default). -d do not check build dependencies and conflicts. --[no-]check-builddeps ditto. -- cgit v1.2.3 From 1c741c507eadcdfc6dbb43610d3aab1387a3122e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 24 Jul 2018 00:47:01 +0200 Subject: dpkg-buildpackage: Add --build equivalents for short build type options This makes the --help output clearer, and matches the man page. --- debian/changelog | 2 ++ scripts/dpkg-buildpackage.pl | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 71ccbbc37..23d0c626b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -142,6 +142,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Clarify PIE build flag feature semantics. Closes: #900088 - Clarify dpkg-buildpackage pre and post-clean options and their default state. + - Add --build option equivalents for dpkg-buildpackage short build type + options in --help output. * Code internals: - Do not use stringy eval to define different sub implementations, just assign an anonymous sub to the typeglob. diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 9bc8c9d28..1df9da44e 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -63,13 +63,13 @@ sub usage { 'Options: --build=[,...] specify the build : full, source, binary, any, all (default is \'full\'). - -F normal full build (source and binary; default). - -g source and arch-indep build. - -G source and arch-specific build. - -b binary-only, no source files. - -B binary-only, only arch-specific files. - -A binary-only, only arch-indep files. - -S source-only, no binary files. + -F, --build=full normal full build (source and binary; default). + -g, --build=source,all source and arch-indep build. + -G, --build=source,any source and arch-specific build. + -b, --build=binary binary-only, no source files. + -B, --build=any binary-only, only arch-specific files. + -A, --build=all binary-only, only arch-indep files. + -S, --build=source source-only, no binary files. -nc, --no-pre-clean do not pre clean source tree (implies -b). --pre-clean pre clean source tree (default). --no-post-clean do not post clean source tree (default). -- cgit v1.2.3 From 869d40414e691ad2e7a6b42b48040a2bcd5e0e94 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 24 Jul 2018 00:47:01 +0200 Subject: dpkg-buildpackage: Fold --[no-]check-builddeps into short option descriptions This makes it easier to read which long option matches the short option. --- debian/changelog | 2 ++ scripts/dpkg-buildpackage.pl | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 23d0c626b..2ef3fc3f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -144,6 +144,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium state. - Add --build option equivalents for dpkg-buildpackage short build type options in --help output. + - Fold dpkg-buildpackage --[no-]check-builddeps in --help into both -D + and -d option descriptions. * Code internals: - Do not use stringy eval to define different sub implementations, just assign an anonymous sub to the typeglob. diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 1df9da44e..fec4bd281 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -74,9 +74,8 @@ sub usage { --pre-clean pre clean source tree (default). --no-post-clean do not post clean source tree (default). -tc, --post-clean post clean source tree. - -D check build dependencies and conflicts (default). - -d do not check build dependencies and conflicts. - --[no-]check-builddeps ditto. + -D, --check-builddeps check build dependencies and conflicts (default). + -d, --no-check-builddeps do not check build dependencies and conflicts. --ignore-builtin-builddeps do not check builtin build dependencies. -P, --build-profiles= -- cgit v1.2.3 From c353a449b26b85bf512d92976fe5c1af23deeb06 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 24 Jul 2018 00:47:01 +0200 Subject: dpkg-buildpackage: Mark profiles as a replaceable item in --help output --- debian/changelog | 1 + scripts/dpkg-buildpackage.pl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 2ef3fc3f2..4b34c8eca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -146,6 +146,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium options in --help output. - Fold dpkg-buildpackage --[no-]check-builddeps in --help into both -D and -d option descriptions. + - Mark profiles as a replaceable item in dpkg-buildpackage --help output. * Code internals: - Do not use stringy eval to define different sub implementations, just assign an anonymous sub to the typeglob. diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index fec4bd281..9cc6969d3 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -79,7 +79,7 @@ sub usage { --ignore-builtin-builddeps do not check builtin build dependencies. -P, --build-profiles= - assume comma-separated build profiles as active. + assume comma-separated build as active. --rules-requires-root assume legacy Rules-Requires-Root field value. -R, --rules-file= rules file to execute (default is debian/rules). -T, --rules-target= call debian/rules . -- cgit v1.2.3 From cf35077be42ef79da5d83ce26f4a27a22591f246 Mon Sep 17 00:00:00 2001 From: Helge Kreutzmann Date: Wed, 25 Jul 2018 09:47:13 +0200 Subject: Update German scripts translation Update to 600t. --- scripts/po/de.po | 62 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'scripts') diff --git a/scripts/po/de.po b/scripts/po/de.po index 5b1ee4113..ae49d766f 100644 --- a/scripts/po/de.po +++ b/scripts/po/de.po @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: dpkg-dev 1.18.8\n" +"Project-Id-Version: dpkg-dev 1.19.1\n" "Report-Msgid-Bugs-To: debian-dpkg@lists.debian.org\n" -"POT-Creation-Date: 2018-05-05 04:58+0200\n" -"PO-Revision-Date: 2018-05-05 05:01+0200\n" +"POT-Creation-Date: 2018-07-25 09:27+0200\n" +"PO-Revision-Date: 2018-07-25 09:46+0200\n" "Last-Translator: Helge Kreutzmann \n" "Language-Team: German \n" "Language: de\n" @@ -238,26 +238,26 @@ msgid "" " --build=[,...] specify the build : full, source, " "binary,\n" " any, all (default is 'full').\n" -" -F normal full build (source and binary; " +" -F, --build=full normal full build (source and binary; " "default).\n" -" -g source and arch-indep build.\n" -" -G source and arch-specific build.\n" -" -b binary-only, no source files.\n" -" -B binary-only, only arch-specific files.\n" -" -A binary-only, only arch-indep files.\n" -" -S source-only, no binary files.\n" +" -g, --build=source,all source and arch-indep build.\n" +" -G, --build=source,any source and arch-specific build.\n" +" -b, --build=binary binary-only, no source files.\n" +" -B, --build=any binary-only, only arch-specific files.\n" +" -A, --build=all binary-only, only arch-indep files.\n" +" -S, --build=source source-only, no binary files.\n" " -nc, --no-pre-clean do not pre clean source tree (implies -b).\n" -" --pre-clean pre clean source tree (default).\n" -" -tc, --post-clean clean source tree when finished.\n" -" -D check build dependencies and conflicts " +" --pre-clean pre clean source tree (default).\n" +" --no-post-clean do not post clean source tree (default).\n" +" -tc, --post-clean post clean source tree.\n" +" -D, --check-builddeps check build dependencies and conflicts " "(default).\n" -" -d do not check build dependencies and " +" -d, --no-check-builddeps do not check build dependencies and " "conflicts.\n" -" --[no-]check-builddeps ditto.\n" " --ignore-builtin-builddeps\n" " do not check builtin build dependencies.\n" " -P, --build-profiles=\n" -" assume comma-separated build profiles as " +" assume comma-separated build as " "active.\n" " --rules-requires-root assume legacy Rules-Requires-Root field " "value.\n" @@ -301,26 +301,26 @@ msgid "" msgstr "" "Optionen:\n" " --build=[,…] legt den Bau- fest: full, source, binary, any,\n" -" all (Vorgabe ist »full«)\n" -" -F normaler kompletter Bau (Quellen und Binärdateien,\n" -" Standard)\n" -" -g Quell- und Architektur-unabhängiger Bau\n" -" -G Quell- und Architektur-abhängiger Bau\n" -" -b nur binär, keine Quelldateien\n" -" -B nur binär, nur Architektur-spezifische-Dateien\n" -" -A nur binär, nur Architektur-indep-Dateien\n" -" -S nur Quelle, keine Binärdateien\n" +" all (Vorgabe ist »full«)\n" +" -F, --build=full normaler kompletter Bau (Quellen und Binärdateien,\n" +" Standard)\n" +" -g, --build=source,all Quell- und Architektur-unabhängiger Bau\n" +" -G, --build=source,any Quell- und Architektur-abhängiger Bau\n" +" -b, --build=binary nur binär, keine Quelldateien\n" +" -B, --build=any nur binär, nur Architektur-spezifische-Dateien\n" +" -A, --build=all nur binär, nur Architektur-indep-Dateien\n" +" -S, --build=source nur Quelle, keine Binärdateien\n" " -nc, --no-pre-clean Quellbaum vorab nicht säubern (impliziert -b)\n" " --pre-clean Quellbaum vorab säubern (Standard)\n" -" -tc, --post-clean nach Abschluss Quellbaum säubern\n" -" -D Bauabhängigkeiten und -konflikte prüfen, Standard\n" -" -d Bauabhängigkeiten und -konflikte nicht prüfen\n" -" --[no-]check-builddeps\n" -" dito.\n" +" --no-post-clean Quellbaum nicht abschließend säubern (Standard).\n" +" -tc, --post-clean Quellbaum abschließend säubern.\n" +" -D, --check-builddeps\n" +" Bauabhängigkeiten und -konflikte prüfen (Standard)\n" +" -d, --no-check-builddeps Bauabhängigkeiten und -konflikte nicht prüfen\n" " --ignore-builtin-builddeps\n" " eingebaute Bauabhängigkeiten nicht prüfen\n" " -P, --build-profiles=\n" -" Kommata-getrennte übergebene Bauprofile als aktiv\n" +" Kommata-getrennte übergebene Bau- als aktiv\n" " annehmen\n" " --rules-requires-root\n" " alten Feldwert »Rules-Requires-Root« annehmen\n" -- cgit v1.2.3 From e3c32720167a6c23fc19471d3e3273965c3dc9e5 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 28 Jul 2018 04:08:58 +0200 Subject: Dpkg::Gettext: Fix fallback textdomain() to honor its expected interface Even though we will not use the domain value set by this function, we should honor its original interface and return a domain string, and update it when requested. --- debian/changelog | 1 + scripts/Dpkg/Gettext.pm | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 5a7b8630f..d818667d2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -129,6 +129,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium _add_build_flags(), for a small speed up and line count reduction. - Dpkg::BuildFlags: Move default flags setting into the Dpkg::Vendor modules. + - Dpkg::Gettext: Fix fallback textdomain() to honor its expected interface. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Gettext.pm b/scripts/Dpkg/Gettext.pm index 33ef1c48d..89a4d154f 100644 --- a/scripts/Dpkg/Gettext.pm +++ b/scripts/Dpkg/Gettext.pm @@ -28,6 +28,7 @@ package Dpkg::Gettext; use strict; use warnings; +use feature qw(state); our $VERSION = '1.03'; our @EXPORT = qw( @@ -122,6 +123,12 @@ BEGIN { return shift; }; *textdomain = sub { + my $new_domain = shift; + state $domain = $DEFAULT_TEXT_DOMAIN; + + $domain = $new_domain if defined $new_domain; + + return $domain; }; *ngettext = sub { my ($msgid, $msgid_plural, $n) = @_; -- cgit v1.2.3 From 1d0be95366c19fbc88c891dbedf7613aedbbdea5 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 28 Jul 2018 04:11:17 +0200 Subject: Dpkg::Gettext: Document textdomain() and ngettext() replacement functions We should mention when these functions are present and what they do, so that users know when they can rely on these. Warned-by: Test::Pod::Coverage --- debian/changelog | 2 ++ scripts/Dpkg/Gettext.pm | 13 +++++++++++++ 2 files changed, 15 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index d818667d2..37e11b1ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -149,6 +149,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium and -d option descriptions. - Mark profiles as a replaceable item in dpkg-buildpackage --help output. - Update test suite requirements in README. + - Document textdomain() and ngettext() replacement functions in + Dpkg::Gettext POD. * Code internals: - Do not use stringy eval to define different sub implementations, just assign an anonymous sub to the typeglob. diff --git a/scripts/Dpkg/Gettext.pm b/scripts/Dpkg/Gettext.pm index 89a4d154f..03b723c9d 100644 --- a/scripts/Dpkg/Gettext.pm +++ b/scripts/Dpkg/Gettext.pm @@ -89,6 +89,19 @@ our $DEFAULT_TEXT_DOMAIN = 'dpkg-dev'; =over 4 +=item $domain = textdomain($new_domain) + +Compatibility textdomain() fallback when Locale::gettext is not available. + +If $new_domain is not undef, it will set the current domain to $new_domain. +Returns the current domain, after possibly changing it. + +=item $trans = ngettext($msgid, $msgid_plural, $n) + +Compatibility ngettext() fallback when Locale::gettext is not available. + +Returns $msgid if $n is 1 or $msgid_plural otherwise. + =item $trans = g_($msgid) Calls dgettext() on the $msgid and returns its translation for the current -- cgit v1.2.3 From ee2e18800f5fe0c63df39202586f38e28c00e860 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 28 Jul 2018 03:13:05 +0200 Subject: perl: Make Build.PL check Module::Build availability at run-time Doing a normal import via use, means that we need the module to be present for the unit tests, when we only need it as part of the distribution process. --- scripts/Build.PL.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Build.PL.in b/scripts/Build.PL.in index 40de90e41..2f81260bd 100644 --- a/scripts/Build.PL.in +++ b/scripts/Build.PL.in @@ -3,7 +3,11 @@ use strict; use warnings; -use Module::Build (); +eval { + require Module::Build; +} or do { + die "error: Missing Module::Build module, cannot proceed.\n"; +}; if (-e 'Build.PL.in') { die "error: This is an in-tree build, not a proper perl distribution.\n" . -- cgit v1.2.3 From 46ed057b6d95545f3ea55b72de29f52e9d8ba885 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 29 Jul 2018 19:56:17 +0200 Subject: Dpkg::Deps: Merge all Copyright notices into the same block There should be no difference between Copyright and Portions Copyright, remove the distinction, and merge all these notices. --- scripts/Dpkg/Deps.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index df8d9f4ec..c7565b73d 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -1,3 +1,8 @@ +# Copyright © 1998 Richard Braakman +# Copyright © 1999 Darren Benham +# Copyright © 2000 Sean 'Shaleh' Perry +# Copyright © 2004 Frank Lichtenheld +# Copyright © 2006 Russ Allbery # Copyright © 2007-2009 Raphaël Hertzog # Copyright © 2008-2009,2012-2014 Guillem Jover # @@ -13,14 +18,6 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -######################################################################### -# Several parts are inspired by lib/Dep.pm from lintian (same license) -# -# Copyright © 1998 Richard Braakman -# Portions Copyright © 1999 Darren Benham -# Portions Copyright © 2000 Sean 'Shaleh' Perry -# Portions Copyright © 2004 Frank Lichtenheld -# Portions Copyright © 2006 Russ Allbery package Dpkg::Deps; -- cgit v1.2.3 From 72742b569f2cf908bc05fa96c5419120e42a10c6 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 29 Jul 2018 20:01:03 +0200 Subject: Dpkg::Deps: Fix typo in POD --- scripts/Dpkg/Deps.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index c7565b73d..885a6c2e1 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -419,7 +419,7 @@ package Dpkg::Deps::Simple; There are several kind of dependencies. A Dpkg::Deps::Simple dependency represents a single dependency statement (it relates to one package only). Dpkg::Deps::Multiple dependencies are built on top of this object -and combine several dependencies in a different manners. Dpkg::Deps::AND +and combine several dependencies in different manners. Dpkg::Deps::AND represents the logical "AND" between dependencies while Dpkg::Deps::OR represents the logical "OR". Dpkg::Deps::Multiple objects can contain Dpkg::Deps::Simple object as well as other Dpkg::Deps::Multiple objects. -- cgit v1.2.3 From 8fd30b60465acd90ffea6aab19ce15eea94a122a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 28 Jul 2018 22:10:55 +0200 Subject: Dpkg::Deps: Clarify arch-qualified dependency simplification Dependency simplification can only really be done for metadata for which we have all its context and information during the simplification process. Anything that relies on the state of the dependencies cannot be simplified. This means that any dependency that might change the satisfiability due to the value of Multi-Arch field of the depended on package cannot be simplified. Clarify this in the function commends, and add new test cases to cover this. Prompted-by: Stuart Prescott --- debian/changelog | 2 ++ scripts/Dpkg/Deps.pm | 3 +++ scripts/t/Dpkg_Deps.t | 22 +++++++++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 688c70b53..b76062154 100644 --- a/debian/changelog +++ b/debian/changelog @@ -151,6 +151,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Update test suite requirements in README. - Document textdomain() and ngettext() replacement functions in Dpkg::Gettext POD. + - Clarify arch-qualified dependency simplification in Dpkg::Deps POD. * Code internals: - Do not use stringy eval to define different sub implementations, just assign an anonymous sub to the typeglob. @@ -189,6 +190,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Infer automatically the unit test data directory. - Infer automatically the unit test temp directory. - Add new po author test case (use i18nspector if available). + - Add new test cases to clarify arch-qualified dependency simplification. [ Updated programs translations ] * Dutch (Frans Spiesschaert). Closes: #881401 diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index 885a6c2e1..88cb98eca 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -758,6 +758,9 @@ sub _arch_is_superset { # Because we are handling dependencies in isolation, and the full context # of the implications are only known when doing dependency resolution at # run-time, we can only assert that they are implied if they are equal. +# +# For example dependencies with different arch-qualifiers cannot be simplified +# as these depend on the state of Multi-Arch field in the package depended on. sub _arch_qualifier_implies { my ($p, $q) = @_; diff --git a/scripts/t/Dpkg_Deps.t b/scripts/t/Dpkg_Deps.t index 71a3cf16a..a519f8166 100644 --- a/scripts/t/Dpkg_Deps.t +++ b/scripts/t/Dpkg_Deps.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 70; +use Test::More tests => 74; use Dpkg::Arch qw(get_host_arch); use Dpkg::Version; @@ -233,6 +233,26 @@ is($dep_profiles->output(), 'libfoo-dev:native , libfoo-dev ', 'Simplification respects archqualifiers and profiles'); +my $dep_archqual = deps_parse('pkg, pkg:any'); +$dep_archqual->simplify_deps($facts); +is($dep_archqual->output(), 'pkg, pkg:any', + 'Simplify respect arch-qualified ANDed dependencies 1/2'); + +$dep_archqual = deps_parse('pkg:amd64, pkg:any, pkg:i386'); +$dep_archqual->simplify_deps($facts); +is($dep_archqual->output(), 'pkg:amd64, pkg:any, pkg:i386', + 'Simplify respects arch-qualified ANDed dependencies 2/2'); + +$dep_archqual = deps_parse('pkg | pkg:any'); +$dep_archqual->simplify_deps($facts); +is($dep_archqual->output(), 'pkg | pkg:any', + 'Simplify respect arch-qualified ORed dependencies 1/2'); + +$dep_archqual = deps_parse('pkg:amd64 | pkg:i386 | pkg:any'); +$dep_archqual->simplify_deps($facts); +is($dep_archqual->output(), 'pkg:amd64 | pkg:i386 | pkg:any', + 'Simplify respect arch-qualified ORed dependencies 2/2'); + my $dep_version = deps_parse('pkg, pkg (= 1.0)'); $dep_version->simplify_deps($facts); is($dep_version->output(), 'pkg (= 1.0)', 'Simplification merges versions'); -- cgit v1.2.3 From 7c98f09aecc4c3a3b5809f57a0a6dc8ad8a1f16f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 29 Jul 2018 19:49:30 +0200 Subject: scripts/t: Improve Dpkg::Deps test cases Add new TODO tests for behavior that is not yet implemented, but should. --- debian/changelog | 1 + scripts/t/Dpkg_Deps.t | 42 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index b76062154..b129604d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -191,6 +191,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Infer automatically the unit test temp directory. - Add new po author test case (use i18nspector if available). - Add new test cases to clarify arch-qualified dependency simplification. + - Add several TODO tests cases for dependency simplification. [ Updated programs translations ] * Dutch (Frans Spiesschaert). Closes: #881401 diff --git a/scripts/t/Dpkg_Deps.t b/scripts/t/Dpkg_Deps.t index a519f8166..27fb12a15 100644 --- a/scripts/t/Dpkg_Deps.t +++ b/scripts/t/Dpkg_Deps.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 74; +use Test::More tests => 78; use Dpkg::Arch qw(get_host_arch); use Dpkg::Version; @@ -169,7 +169,34 @@ my $field_duplicate = 'libc6 (>= 2.3), libc6 (>= 2.6-1), mypackage (>= pkg-ma-foreign2, pkg-ma-allowed:any, pkg-ma-allowed2, pkg-ma-allowed3'; my $dep_dup = deps_parse($field_duplicate); $dep_dup->simplify_deps($facts, $dep_opposite); -is($dep_dup->output(), 'libc6 (>= 2.6-1), mypackage2, pkg-ma-allowed2', 'Simplify deps'); +is($dep_dup->output(), 'libc6 (>= 2.6-1), mypackage2, pkg-ma-allowed2', + 'Simplify deps'); + +TODO: { + +local $TODO = 'not yet implemented'; + +my $dep_or_eq = deps_parse('pkg-a | pkg-b | pkg-a'); +$dep_or_eq->simplify_deps($facts); +is($dep_or_eq->output(), 'pkg-a | pkg-b', + 'Simplify duped ORed, equal names'); + +$dep_or_eq = deps_parse('pkg-a (= 10) | pkg-b | pkg-a (= 10)'); +$dep_or_eq->simplify_deps($facts); +is($dep_or_eq->output(), 'pkg-a (= 10) | pkg-b', + 'Simplify duped ORed, matching version'); + +my $dep_or_subset = deps_parse('pkg-a (>= 10) | pkg-b | pkg-a (= 10)'); +$dep_or_eq->simplify_deps($facts); +is($dep_or_eq->output(), 'pkg-a (= 10) | pkg-b', + 'Simplify duped ORed, subset version'); + +$dep_or_subset = deps_parse('pkg-a (>= 10) | pkg-b | pkg-a (= 10) '); +$dep_or_eq->simplify_deps($facts); +is($dep_or_eq->output(), 'pkg-a (= 10) | pkg-b', + 'Simplify duped ORed, subset version'); + +} # TODO my $field_virtual = 'myvirtual | other'; my $dep_virtual = deps_parse($field_virtual); @@ -221,11 +248,16 @@ $dep_profiles->simplify_deps($facts); is($dep_profiles->output(), 'dupe ', 'Simplification respects duplicated profiles'); +TODO: { + +local $TODO = 'not yet implemented'; + $dep_profiles = deps_parse('tool , tool '); $dep_profiles->simplify_deps($facts); -# XXX: Ideally this would get simplified to "tool ". -is($dep_profiles->output(), 'tool , tool ', - 'Simplification respects profiles'); +is($dep_profiles->output(), 'tool ', + 'Simplify restriction formulas'); + +} # TODO $dep_profiles = deps_parse('libfoo-dev:native , libfoo-dev ', build_dep => 1); $dep_profiles->simplify_deps($facts); -- cgit v1.2.3 From 8940f102eb5eecfb8ff55cde52d4866ab50dfd1f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 30 Jul 2018 00:37:13 +0200 Subject: Dpkg::Deps: Improve modules and method documentation Document each implemented method. This will make it easier to split the modules into their own files. --- debian/changelog | 1 + scripts/Dpkg/Deps.pm | 528 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 378 insertions(+), 151 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index b129604d9..374c09cf8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -152,6 +152,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Document textdomain() and ngettext() replacement functions in Dpkg::Gettext POD. - Clarify arch-qualified dependency simplification in Dpkg::Deps POD. + - Improve Dpkg::Deps modules and methods documentation. * Code internals: - Do not use stringy eval to define different sub implementations, just assign an anonymous sub to the typeglob. diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index 88cb98eca..d6c90cf77 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -433,87 +433,9 @@ dependencies and while trying to simplify them. It represents a set of installed packages along with the virtual packages that they might provide. -=head2 COMMON METHODS +=head2 OBJECT - Dpkg::Deps::Simple -=over 4 - -=item $dep->is_empty() - -Returns true if the dependency is empty and doesn't contain any useful -information. This is true when a Dpkg::Deps::Simple object has not yet -been initialized or when a (descendant of) Dpkg::Deps::Multiple contains -an empty list of dependencies. - -=item $dep->get_deps() - -Returns a list of sub-dependencies. For Dpkg::Deps::Simple it returns -itself. - -=item $dep->output([$fh]) - -=item "$dep" - -Returns a string representing the dependency. If $fh is set, it prints -the string to the filehandle. - -=item $dep->implies($other_dep) - -Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies -NOT($other_dep). Returns undef when there's no implication. $dep and -$other_dep do not need to be of the same type. - -=item $dep->sort() - -Sorts alphabetically the internal list of dependencies. It's a no-op for -Dpkg::Deps::Simple objects. - -=item $dep->arch_is_concerned($arch) - -Returns true if the dependency applies to the indicated architecture. For -multiple dependencies, it returns true if at least one of the -sub-dependencies apply to this architecture. - -=item $dep->reduce_arch($arch) - -Simplifies the dependency to contain only information relevant to the given -architecture. A Dpkg::Deps::Simple object can be left empty after this -operation. For Dpkg::Deps::Multiple objects, the non-relevant -sub-dependencies are simply removed. - -This trims off the architecture restriction list of Dpkg::Deps::Simple -objects. - -=item $dep->get_evaluation($facts) - -Evaluates the dependency given a list of installed packages and a list of -virtual packages provided. Those lists are part of the -Dpkg::Deps::KnownFacts object given as parameters. - -Returns 1 when it's true, 0 when it's false, undef when some information -is lacking to conclude. - -=item $dep->simplify_deps($facts, @assumed_deps) - -Simplifies the dependency as much as possible given the list of facts (see -object Dpkg::Deps::KnownFacts) and a list of other dependencies that are -known to be true. - -=item $dep->has_arch_restriction() - -For a simple dependency, returns the package name if the dependency -applies only to a subset of architectures. For multiple dependencies, it -returns the list of package names that have such a restriction. - -=item $dep->reset() - -Clears any dependency information stored in $dep so that $dep->is_empty() -returns true. - -=back - -=head2 Dpkg::Deps::Simple - -Such an object has four interesting properties: +This object has several interesting properties: =over 4 @@ -534,33 +456,26 @@ The version. =item arches -The list of architectures where this dependency is applicable. It's -undefined when there's no restriction, otherwise it's an +The list of architectures where this dependency is applicable. It is +undefined when there's no restriction, otherwise it is an array ref. It can contain an exclusion list, in that case each architecture is prefixed with an exclamation mark. =item archqual -The arch qualifier of the dependency (can be undef if there's none). +The arch qualifier of the dependency (can be undef if there is none). In the dependency "python:any (>= 2.6)", the arch qualifier is "any". -=back - -=head3 METHODS - -=over 4 - -=item $simple_dep->parse_string('dpkg-dev (>= 1.14.8) [!hurd-i386]') +=item restrictions -Parses the dependency and modifies internal properties to match the parsed -dependency. +The restrictions formula for this dependency. It is undefined when there +is no restriction formula. Otherwise it is an array ref. -=item $simple_dep->merge_union($other_dep) +=back -Returns true if $simple_dep could be modified to represent the union of -both dependencies. Otherwise returns false. +=head2 METHODS - Dpkg::Deps::Simple -=back +=over 4 =cut @@ -577,6 +492,34 @@ use Dpkg::Gettext; use parent qw(Dpkg::Interface::Storable); +=item $dep = Dpkg::Deps::Simple->new(%opts); + +Creates a new object. Some options can be set through %opts: + +=over + +=item host_arch + +Sets the host architecture. + +=item build_arch + +Sets the build architecture. + +=item build_dep + +Specifies whether the parser should consider it a build dependency. +Defaults to 0. + +=item tests_dep + +Specifies whether the parser should consider it a tests dependency. +Defaults to 0. + +=back + +=cut + sub new { my ($this, $arg, %opts) = @_; my $class = ref($this) || $this; @@ -591,6 +534,13 @@ sub new { return $self; } +=item $dep->reset() + +Clears any dependency information stored in $dep so that $dep->is_empty() +returns true. + +=cut + sub reset { my $self = shift; $self->{package} = undef; @@ -601,6 +551,12 @@ sub reset { $self->{restrictions} = undef; } +=item $dep->parse($fh, $desc) + +Parses a line from a filehandle. + +=cut + sub parse { my ($self, $fh, $desc) = @_; my $line = <$fh>; @@ -608,6 +564,13 @@ sub parse { return $self->parse_string($line); } +=item $dep->parse_string($dep_string) + +Parses the dependency string and modifies internal properties to match the +parsed dependency. + +=cut + sub parse_string { my ($self, $dep) = @_; @@ -662,6 +625,15 @@ sub parse_string { } } +=item $dep->output([$fh]) + +=item "$dep" + +Returns a string representing the dependency. If $fh is set, it prints +the string to the filehandle. + +=cut + sub output { my ($self, $fh) = @_; my $res = $self->{package}; @@ -799,9 +771,14 @@ sub _restrictions_imply { } } -# Returns true if the dependency in parameter can deduced from the current -# dependency. Returns false if it can be negated. Returns undef if nothing -# can be concluded. +=item $dep->implies($other_dep) + +Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies +NOT($other_dep). Returns undef when there is no implication. $dep and +$other_dep do not need to be of the same type. + +=cut + sub implies { my ($self, $o) = @_; if ($o->isa('Dpkg::Deps::Simple')) { @@ -868,15 +845,34 @@ sub implies { } } +=item $dep->get_deps() + +Returns a list of sub-dependencies, which for this object it means it +returns itself. + +=cut + sub get_deps { my $self = shift; return $self; } +=item $dep->sort() + +This method is a no-op for this object. + +=cut + sub sort { # Nothing to sort } +=item $dep->arch_is_concerned($arch) + +Returns true if the dependency applies to the indicated architecture. + +=cut + sub arch_is_concerned { my ($self, $host_arch) = @_; @@ -886,6 +882,14 @@ sub arch_is_concerned { return debarch_is_concerned($host_arch, @{$self->{arches}}); } +=item $dep->reduce_arch($arch) + +Simplifies the dependency to contain only information relevant to the given +architecture. This object can be left empty after this operation. This trims +off the architecture restriction list of these objects. + +=cut + sub reduce_arch { my ($self, $host_arch) = @_; if (not $self->arch_is_concerned($host_arch)) { @@ -895,6 +899,13 @@ sub reduce_arch { } } +=item $dep->has_arch_restriction() + +Returns the package name if the dependency applies only to a subset of +architectures. + +=cut + sub has_arch_restriction { my $self = shift; if (defined $self->{arches}) { @@ -904,6 +915,12 @@ sub has_arch_restriction { } } +=item $dep->profile_is_concerned() + +Returns true if the dependency applies to the indicated profile. + +=cut + sub profile_is_concerned { my ($self, $build_profiles) = @_; @@ -912,6 +929,14 @@ sub profile_is_concerned { return evaluate_restriction_formula($self->{restrictions}, $build_profiles); } +=item $dep->reduce_profiles() + +Simplifies the dependency to contain only information relevant to the given +profile. This object can be left empty after this operation. This trims off +the profile restriction list of this object. + +=cut + sub reduce_profiles { my ($self, $build_profiles) = @_; @@ -922,23 +947,56 @@ sub reduce_profiles { } } +=item $dep->get_evaluation($facts) + +Evaluates the dependency given a list of installed packages and a list of +virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts +object given as parameters. + +Returns 1 when it's true, 0 when it's false, undef when some information +is lacking to conclude. + +=cut + sub get_evaluation { my ($self, $facts) = @_; return if not defined $self->{package}; return $facts->_evaluate_simple_dep($self); } +=item $dep->simplify_deps($facts, @assumed_deps) + +Simplifies the dependency as much as possible given the list of facts (see +object Dpkg::Deps::KnownFacts) and a list of other dependencies that are +known to be true. + +=cut + sub simplify_deps { my ($self, $facts) = @_; my $eval = $self->get_evaluation($facts); $self->reset() if defined $eval and $eval == 1; } +=item $dep->is_empty() + +Returns true if the dependency is empty and doesn't contain any useful +information. This is true when the object has not yet been initialized. + +=cut + sub is_empty { my $self = shift; return not defined $self->{package}; } +=item $dep->merge_union($other_dep) + +Returns true if $dep could be modified to represent the union of both +dependencies. Otherwise returns false. + +=cut + sub merge_union { my ($self, $o) = @_; return 0 if not $o->isa('Dpkg::Deps::Simple'); @@ -975,20 +1033,19 @@ sub merge_union { return 0; } -package Dpkg::Deps::Multiple; +=back -=head2 Dpkg::Deps::Multiple +=cut -This is the base class for Dpkg::Deps::{AND,OR,Union}. It implements -the following methods: +package Dpkg::Deps::Multiple; -=over 4 +=head2 OBJECT - Dpkg::Deps::Multiple -=item $mul->add($dep) +This is the base class for Dpkg::Deps::{AND,OR,Union}. -Adds a new dependency object at the end of the list. +=head2 METHODS - Dpkg::Deps::Multiple -=back +=over 4 =cut @@ -1001,6 +1058,12 @@ use Dpkg::ErrorHandling; use parent qw(Dpkg::Interface::Storable); +=item $dep = Dpkg::Deps::Multiple->new(%opts); + +Creates a new object. + +=cut + sub new { my $this = shift; my $class = ref($this) || $this; @@ -1009,21 +1072,46 @@ sub new { return $self; } +=item $dep->reset() + +Clears any dependency information stored in $dep so that $dep->is_empty() +returns true. + +=cut + sub reset { my $self = shift; $self->{list} = []; } +=item $dep->add(@deps) + +Adds new dependency objects at the end of the list. + +=cut + sub add { my $self = shift; push @{$self->{list}}, @_; } +=item $dep->get_deps() + +Returns a list of sub-dependencies. + +=cut + sub get_deps { my $self = shift; return grep { not $_->is_empty() } @{$self->{list}}; } +=item $dep->sort() + +Sorts alphabetically the internal list of dependencies. + +=cut + sub sort { my $self = shift; my @res = (); @@ -1031,6 +1119,13 @@ sub sort { $self->{list} = [ @res ]; } +=item $dep->arch_is_concerned($arch) + +Returns true if at least one of the sub-dependencies apply to this +architecture. + +=cut + sub arch_is_concerned { my ($self, $host_arch) = @_; my $res = 0; @@ -1040,6 +1135,16 @@ sub arch_is_concerned { return $res; } +=item $dep->reduce_arch($arch) + +Simplifies the dependencies to contain only information relevant to the +given architecture. The non-relevant sub-dependencies are simply removed. + +This trims off the architecture restriction list of Dpkg::Deps::Simple +objects. + +=cut + sub reduce_arch { my ($self, $host_arch) = @_; my @new; @@ -1050,6 +1155,12 @@ sub reduce_arch { $self->{list} = [ @new ]; } +=item $dep->has_arch_restriction() + +Returns the list of package names that have such a restriction. + +=cut + sub has_arch_restriction { my $self = shift; my @res; @@ -1059,6 +1170,12 @@ sub has_arch_restriction { return @res; } +=item $dep->profile_is_concerned() + +Returns true if at least one of the sub-dependencies apply to this profile. + +=cut + sub profile_is_concerned { my ($self, $build_profiles) = @_; my $res = 0; @@ -1069,6 +1186,15 @@ sub profile_is_concerned { return $res; } +=item $dep->reduce_profiles() + +Simplifies the dependencies to contain only information relevant to the +given profile. The non-relevant sub-dependencies are simply removed. + +This trims off the profile restriction list of Dpkg::Deps::Simple objects. + +=cut + sub reduce_profiles { my ($self, $build_profiles) = @_; my @new; @@ -1080,29 +1206,43 @@ sub reduce_profiles { $self->{list} = [ @new ]; } +=item $dep->is_empty() + +Returns true if the dependency is empty and doesn't contain any useful +information. This is true when a (descendant of) Dpkg::Deps::Multiple +contains an empty list of dependencies. + +=cut + sub is_empty { my $self = shift; return scalar @{$self->{list}} == 0; } +=item $dep->merge_union($other_dep) + +This method is not meaningful for this object, and will always croak. + +=cut + sub merge_union { croak 'method merge_union() is only valid for Dpkg::Deps::Simple'; } -package Dpkg::Deps::AND; +=back -=head2 Dpkg::Deps::AND +=cut -This object represents a list of dependencies who must be met at the same -time. +package Dpkg::Deps::AND; -=over 4 +=head2 OBJECT - Dpkg::Deps::AND -=item $and->output([$fh]) +This object represents a list of dependencies that must be met at the same +time. It inherits from Dpkg::Deps::Multiple. -The output method uses ", " to join the list of sub-dependencies. +=head2 METHODS - Dpkg::Deps::AND -=back +=over 4 =cut @@ -1111,6 +1251,12 @@ use warnings; use parent -norequire, qw(Dpkg::Deps::Multiple); +=item $dep->output([$fh]) + +The output method uses ", " to join the list of sub-dependencies. + +=cut + sub output { my ($self, $fh) = @_; my $res = join(', ', map { $_->output() } grep { not $_->is_empty() } $self->get_deps()); @@ -1120,6 +1266,14 @@ sub output { return $res; } +=item $dep->implies($other_dep) + +Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies +NOT($other_dep). Returns undef when there's no implication. $dep and +$other_dep do not need to be of the same type. + +=cut + sub implies { my ($self, $o) = @_; # If any individual member can imply $o or NOT $o, we're fine @@ -1144,6 +1298,17 @@ sub implies { return; } +=item $dep->get_evaluation($facts) + +Evaluates the dependency given a list of installed packages and a list of +virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts +object given as parameters. + +Returns 1 when it's true, 0 when it's false, undef when some information +is lacking to conclude. + +=cut + sub get_evaluation { my ($self, $facts) = @_; # Return 1 only if all members evaluates to true @@ -1164,6 +1329,14 @@ sub get_evaluation { return $result; } +=item $dep->simplify_deps($facts, @assumed_deps) + +Simplifies the dependency as much as possible given the list of facts (see +object Dpkg::Deps::KnownFacts) and a list of other dependencies that are +known to be true. + +=cut + sub simplify_deps { my ($self, $facts, @knowndeps) = @_; my @new; @@ -1193,21 +1366,20 @@ WHILELOOP: $self->{list} = [ @new ]; } +=back + +=cut package Dpkg::Deps::OR; -=head2 Dpkg::Deps::OR +=head2 OBJECT - Dpkg::Deps::OR This object represents a list of dependencies of which only one must be met -for the dependency to be true. - -=over 4 - -=item $or->output([$fh]) +for the dependency to be true. It inherits from Dpkg::Deps::Multiple. -The output method uses " | " to join the list of sub-dependencies. +=head2 METHODS - Dpkg::Deps::OR -=back +=over 4 =cut @@ -1216,6 +1388,12 @@ use warnings; use parent -norequire, qw(Dpkg::Deps::Multiple); +=item $dep->output([$fh]) + +The output method uses " | " to join the list of sub-dependencies. + +=cut + sub output { my ($self, $fh) = @_; my $res = join(' | ', map { $_->output() } grep { not $_->is_empty() } $self->get_deps()); @@ -1225,6 +1403,14 @@ sub output { return $res; } +=item $dep->implies($other_dep) + +Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies +NOT($other_dep). Returns undef when there's no implication. $dep and +$other_dep do not need to be of the same type. + +=cut + sub implies { my ($self, $o) = @_; @@ -1252,6 +1438,17 @@ sub implies { return; } +=item $dep->get_evaluation($facts) + +Evaluates the dependency given a list of installed packages and a list of +virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts +object given as parameters. + +Returns 1 when it's true, 0 when it's false, undef when some information +is lacking to conclude. + +=cut + sub get_evaluation { my ($self, $facts) = @_; # Returns false if all members evaluates to 0 @@ -1272,6 +1469,14 @@ sub get_evaluation { return $result; } +=item $dep->simplify_deps($facts, @assumed_deps) + +Simplifies the dependency as much as possible given the list of facts (see +object Dpkg::Deps::KnownFacts) and a list of other dependencies that are +known to be true. + +=cut + sub simplify_deps { my ($self, $facts) = @_; my @new; @@ -1292,30 +1497,20 @@ WHILELOOP: $self->{list} = [ @new ]; } -package Dpkg::Deps::Union; - -=head2 Dpkg::Deps::Union - -This object represents a list of relationships. - -=over 4 - -=item $union->output([$fh]) - -The output method uses ", " to join the list of relationships. +=back -=item $union->implies($other_dep) +=cut -=item $union->get_evaluation($other_dep) +package Dpkg::Deps::Union; -Those methods are not meaningful for this object and always return undef. +=head2 OBJECT - Dpkg::Deps::Union -=item $union->simplify_deps($facts) +This object represents a list of relationships. It inherits from +Dpkg::Deps::Multiple. -The simplification is done to generate an union of all the relationships. -It uses $simple_dep->merge_union($other_dep) to get its job done. +=head2 METHODS - Dpkg::Deps::Union -=back +=over 4 =cut @@ -1324,6 +1519,12 @@ use warnings; use parent -norequire, qw(Dpkg::Deps::Multiple); +=item $dep->output([$fh]) + +The output method uses ", " to join the list of relationships. + +=cut + sub output { my ($self, $fh) = @_; my $res = join(', ', map { $_->output() } grep { not $_->is_empty() } $self->get_deps()); @@ -1333,16 +1534,31 @@ sub output { return $res; } +=item $dep->implies($other_dep) + +=item $dep->get_evaluation($other_dep) + +These methods are not meaningful for this object and always return undef. + +=cut + sub implies { - # Implication test are not useful on Union + # Implication test is not useful on Union. return; } sub get_evaluation { - # Evaluation are not useful on Union + # Evaluation is not useful on Union. return; } +=item $dep->simplify_deps($facts) + +The simplification is done to generate an union of all the relationships. +It uses $simple_dep->merge_union($other_dep) to get its job done. + +=cut + sub simplify_deps { my ($self, $facts) = @_; my @new; @@ -1358,18 +1574,20 @@ WHILELOOP: $self->{list} = [ @new ]; } +=back + +=cut + package Dpkg::Deps::KnownFacts; -=head2 Dpkg::Deps::KnownFacts +=head2 OBJECT - Dpkg::Deps::KnownFacts This object represents a list of installed packages and a list of virtual packages provided (by the set of installed packages). -=over 4 - -=item $facts = Dpkg::Deps::KnownFacts->new(); +=head2 METHODS - Dpkg::Deps::KnownFacts -Creates a new object. +=over 4 =cut @@ -1378,6 +1596,12 @@ use warnings; use Dpkg::Version; +=item $facts = Dpkg::Deps::KnownFacts->new(); + +Creates a new object. + +=cut + sub new { my $this = shift; my $class = ref($this) || $this; @@ -1445,8 +1669,6 @@ This function is obsolete and should not be used. Dpkg::Deps::KnownFacts is only meant to be filled with data and then passed to Dpkg::Deps methods where appropriate, but it should not be directly queried. -=back - =cut sub check_package { @@ -1467,7 +1689,9 @@ sub check_package { return (0, undef); } -## The functions below are private to Dpkg::Deps +## +## The functions below are private to Dpkg::Deps::KnownFacts. +## sub _find_package { my ($self, $dep, $lackinfos) = @_; @@ -1534,6 +1758,8 @@ sub _evaluate_simple_dep { return 0; } +=back + =head1 CHANGES =head2 Version 1.06 (dpkg 1.18.7; module version bumped on dpkg 1.18.24) -- cgit v1.2.3 From 3d4afe2967eccd7805d067a3eab6938f7f099a63 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 30 Jul 2018 04:31:32 +0200 Subject: Dpkg::Deps::KnownFacts: Rename _evaluate_simple_dep to evaluate_simple_dep This method is currently used by Dpkg::Deps::Simple, and is marked as private by way of its underscore prefix. This will be a problem once we split the modules into different files, as then we are not supposed to be using private methods from external modules. Rename the method, and document it explicitly as being private, while only giving a partial prototype to deter its use. --- scripts/Dpkg/Deps.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index d6c90cf77..613ca2d7a 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -961,7 +961,7 @@ is lacking to conclude. sub get_evaluation { my ($self, $facts) = @_; return if not defined $self->{package}; - return $facts->_evaluate_simple_dep($self); + return $facts->evaluate_simple_dep($self); } =item $dep->simplify_deps($facts, @assumed_deps) @@ -1726,7 +1726,13 @@ sub _find_virtual_packages { return @{$self->{virtualpkg}{$pkg}}; } -sub _evaluate_simple_dep { +=item $facts->evaluate_simple_dep() + +This method is private and should not be used except from within Dpkg::Deps. + +=cut + +sub evaluate_simple_dep { my ($self, $dep) = @_; my ($lackinfos, $pkg) = (0, $dep->{package}); my $p = $self->_find_package($dep, \$lackinfos); -- cgit v1.2.3 From 738c8d5d545e164c3e7450751960618443bf7431 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 30 Jul 2018 01:26:08 +0200 Subject: Dpkg::Deps: Split subpackages This makes the structure easier to comprehend, and easier to read, otherwise it's difficutl to search for specific methods or functions and know immediately to what module they belong. It also makes for more structured POD. --- debian/changelog | 1 + scripts/Dpkg/Deps.pm | 1379 +-------------------------------------- scripts/Dpkg/Deps/AND.pm | 182 ++++++ scripts/Dpkg/Deps/KnownFacts.pm | 244 +++++++ scripts/Dpkg/Deps/Multiple.pm | 250 +++++++ scripts/Dpkg/Deps/OR.pm | 174 +++++ scripts/Dpkg/Deps/Simple.pm | 659 +++++++++++++++++++ scripts/Dpkg/Deps/Union.pm | 119 ++++ scripts/Makefile.am | 6 + scripts/po/POTFILES.in | 6 + 10 files changed, 1659 insertions(+), 1361 deletions(-) create mode 100644 scripts/Dpkg/Deps/AND.pm create mode 100644 scripts/Dpkg/Deps/KnownFacts.pm create mode 100644 scripts/Dpkg/Deps/Multiple.pm create mode 100644 scripts/Dpkg/Deps/OR.pm create mode 100644 scripts/Dpkg/Deps/Simple.pm create mode 100644 scripts/Dpkg/Deps/Union.pm (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 374c09cf8..d0c53872d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -130,6 +130,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::BuildFlags: Move default flags setting into the Dpkg::Vendor modules. - Dpkg::Gettext: Fix fallback textdomain() to honor its expected interface. + - Dpkg::Deps: Split subpackages into their own separate modules. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index 613ca2d7a..f3a19e78e 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -63,6 +63,11 @@ use Dpkg::Arch qw(get_host_arch get_build_arch debarch_to_debtuple); use Dpkg::BuildProfiles qw(get_build_profiles); use Dpkg::ErrorHandling; use Dpkg::Gettext; +use Dpkg::Deps::Simple; +use Dpkg::Deps::Union; +use Dpkg::Deps::AND; +use Dpkg::Deps::OR; +use Dpkg::Deps::KnownFacts; =item deps_eval_implication($rel_p, $v_p, $rel_q, $v_q) @@ -411,9 +416,6 @@ sub deps_compare { } } - -package Dpkg::Deps::Simple; - =head1 OBJECTS - Dpkg::Deps::* There are several kind of dependencies. A Dpkg::Deps::Simple dependency @@ -433,1377 +435,32 @@ dependencies and while trying to simplify them. It represents a set of installed packages along with the virtual packages that they might provide. -=head2 OBJECT - Dpkg::Deps::Simple - -This object has several interesting properties: - -=over 4 - -=item package - -The package name (can be undef if the dependency has not been initialized -or if the simplification of the dependency lead to its removal). - -=item relation - -The relational operator: "=", "<<", "<=", ">=" or ">>". It can be -undefined if the dependency had no version restriction. In that case the -following field is also undefined. - -=item version - -The version. - -=item arches - -The list of architectures where this dependency is applicable. It is -undefined when there's no restriction, otherwise it is an -array ref. It can contain an exclusion list, in that case each -architecture is prefixed with an exclamation mark. - -=item archqual - -The arch qualifier of the dependency (can be undef if there is none). -In the dependency "python:any (>= 2.6)", the arch qualifier is "any". - -=item restrictions - -The restrictions formula for this dependency. It is undefined when there -is no restriction formula. Otherwise it is an array ref. - -=back - -=head2 METHODS - Dpkg::Deps::Simple - -=over 4 - -=cut - -use strict; -use warnings; - -use Carp; - -use Dpkg::Arch qw(debarch_is_concerned debarch_list_parse); -use Dpkg::BuildProfiles qw(parse_build_profiles evaluate_restriction_formula); -use Dpkg::Version; -use Dpkg::ErrorHandling; -use Dpkg::Gettext; - -use parent qw(Dpkg::Interface::Storable); - -=item $dep = Dpkg::Deps::Simple->new(%opts); - -Creates a new object. Some options can be set through %opts: - -=over - -=item host_arch - -Sets the host architecture. - -=item build_arch - -Sets the build architecture. - -=item build_dep - -Specifies whether the parser should consider it a build dependency. -Defaults to 0. - -=item tests_dep - -Specifies whether the parser should consider it a tests dependency. -Defaults to 0. - -=back - -=cut - -sub new { - my ($this, $arg, %opts) = @_; - my $class = ref($this) || $this; - my $self = {}; - bless $self, $class; - $self->reset(); - $self->{host_arch} = $opts{host_arch}; - $self->{build_arch} = $opts{build_arch}; - $self->{build_dep} = $opts{build_dep} // 0; - $self->{tests_dep} = $opts{tests_dep} // 0; - $self->parse_string($arg) if defined($arg); - return $self; -} - -=item $dep->reset() - -Clears any dependency information stored in $dep so that $dep->is_empty() -returns true. - -=cut - -sub reset { - my $self = shift; - $self->{package} = undef; - $self->{relation} = undef; - $self->{version} = undef; - $self->{arches} = undef; - $self->{archqual} = undef; - $self->{restrictions} = undef; -} - -=item $dep->parse($fh, $desc) - -Parses a line from a filehandle. - -=cut - -sub parse { - my ($self, $fh, $desc) = @_; - my $line = <$fh>; - chomp($line); - return $self->parse_string($line); -} - -=item $dep->parse_string($dep_string) - -Parses the dependency string and modifies internal properties to match the -parsed dependency. - -=cut - -sub parse_string { - my ($self, $dep) = @_; - - my $pkgname_re; - if ($self->{tests_dep}) { - $pkgname_re = qr/[\@a-zA-Z0-9][\@a-zA-Z0-9+.-]*/; - } else { - $pkgname_re = qr/[a-zA-Z0-9][a-zA-Z0-9+.-]*/; - } - - return if not $dep =~ - m{^\s* # skip leading whitespace - ($pkgname_re) # package name - (?: # start of optional part - : # colon for architecture - ([a-zA-Z0-9][a-zA-Z0-9-]*) # architecture name - )? # end of optional part - (?: # start of optional part - \s* \( # open parenthesis for version part - \s* (<<|<=|=|>=|>>|[<>]) # relation part - \s* ([^\)\s]+) # do not attempt to parse version - \s* \) # closing parenthesis - )? # end of optional part - (?: # start of optional architecture - \s* \[ # open bracket for architecture - \s* ([^\]]+) # don't parse architectures now - \s* \] # closing bracket - )? # end of optional architecture - ( - (?: # start of optional restriction - \s* < # open bracket for restriction - \s* [^>]+ # do not parse restrictions now - \s* > # closing bracket - )+ - )? # end of optional restriction - \s*$ # trailing spaces at end - }x; - if (defined($2)) { - return if $2 eq 'native' and not $self->{build_dep}; - $self->{archqual} = $2; - } - $self->{package} = $1; - $self->{relation} = version_normalize_relation($3) if defined($3); - if (defined($4)) { - $self->{version} = Dpkg::Version->new($4); - } - if (defined($5)) { - $self->{arches} = [ debarch_list_parse($5) ]; - } - if (defined($6)) { - $self->{restrictions} = [ parse_build_profiles($6) ]; - } -} - -=item $dep->output([$fh]) - -=item "$dep" - -Returns a string representing the dependency. If $fh is set, it prints -the string to the filehandle. - -=cut - -sub output { - my ($self, $fh) = @_; - my $res = $self->{package}; - if (defined($self->{archqual})) { - $res .= ':' . $self->{archqual}; - } - if (defined($self->{relation})) { - $res .= ' (' . $self->{relation} . ' ' . $self->{version} . ')'; - } - if (defined($self->{arches})) { - $res .= ' [' . join(' ', @{$self->{arches}}) . ']'; - } - if (defined($self->{restrictions})) { - for my $restrlist (@{$self->{restrictions}}) { - $res .= ' <' . join(' ', @{$restrlist}) . '>'; - } - } - if (defined($fh)) { - print { $fh } $res; - } - return $res; -} - -# _arch_is_superset(\@p, \@q) -# -# Returns true if the arch list @p is a superset of arch list @q. -# The arguments can also be undef in case there's no explicit architecture -# restriction. -sub _arch_is_superset { - my ($p, $q) = @_; - my $p_arch_neg = defined($p) && $p->[0] =~ /^!/; - my $q_arch_neg = defined($q) && $q->[0] =~ /^!/; - - # If "p" has no arches, it is a superset of q and we should fall through - # to the version check. - if (not defined $p) { - return 1; - } - - # If q has no arches, it is a superset of p and there are no useful - # implications. - elsif (not defined $q) { - return 0; - } - - # Both have arches. If neither are negated, we know nothing useful - # unless q is a subset of p. - elsif (not $p_arch_neg and not $q_arch_neg) { - my %p_arches = map { $_ => 1 } @{$p}; - my $subset = 1; - for my $arch (@{$q}) { - $subset = 0 unless $p_arches{$arch}; - } - return 0 unless $subset; - } - - # If both are negated, we know nothing useful unless p is a subset of - # q (and therefore has fewer things excluded, and therefore is more - # general). - elsif ($p_arch_neg and $q_arch_neg) { - my %q_arches = map { $_ => 1 } @{$q}; - my $subset = 1; - for my $arch (@{$p}) { - $subset = 0 unless $q_arches{$arch}; - } - return 0 unless $subset; - } - - # If q is negated and p isn't, we'd need to know the full list of - # arches to know if there's any relationship, so bail. - elsif (not $p_arch_neg and $q_arch_neg) { - return 0; - } - - # If p is negated and q isn't, q is a subset of p if none of the - # negated arches in p are present in q. - elsif ($p_arch_neg and not $q_arch_neg) { - my %q_arches = map { $_ => 1 } @{$q}; - my $subset = 1; - for my $arch (@{$p}) { - $subset = 0 if $q_arches{substr($arch, 1)}; - } - return 0 unless $subset; - } - return 1; -} - -# _arch_qualifier_implies($p, $q) -# -# Returns true if the arch qualifier $p and $q are compatible with the -# implication $p -> $q, false otherwise. $p/$q can be undef/"any"/"native" -# or an architecture string. -# -# Because we are handling dependencies in isolation, and the full context -# of the implications are only known when doing dependency resolution at -# run-time, we can only assert that they are implied if they are equal. -# -# For example dependencies with different arch-qualifiers cannot be simplified -# as these depend on the state of Multi-Arch field in the package depended on. -sub _arch_qualifier_implies { - my ($p, $q) = @_; - - return $p eq $q if defined $p and defined $q; - return 1 if not defined $p and not defined $q; - return 0; -} - -# _restrictions_imply($p, $q) -# -# Returns true if the restrictions $p and $q are compatible with the -# implication $p -> $q, false otherwise. -# NOTE: We don't try to be very clever here, so we may conservatively -# return false when there is an implication. -sub _restrictions_imply { - my ($p, $q) = @_; - - if (not defined $p) { - return 1; - } elsif (not defined $q) { - return 0; - } else { - # Check whether set difference is empty. - my %restr; - - for my $restrlist (@{$q}) { - my $reststr = join ' ', sort @{$restrlist}; - $restr{$reststr} = 1; - } - for my $restrlist (@{$p}) { - my $reststr = join ' ', sort @{$restrlist}; - delete $restr{$reststr}; - } - - return keys %restr == 0; - } -} - -=item $dep->implies($other_dep) - -Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies -NOT($other_dep). Returns undef when there is no implication. $dep and -$other_dep do not need to be of the same type. - -=cut - -sub implies { - my ($self, $o) = @_; - if ($o->isa('Dpkg::Deps::Simple')) { - # An implication is only possible on the same package - return if $self->{package} ne $o->{package}; - - # Our architecture set must be a superset of the architectures for - # o, otherwise we can't conclude anything. - return unless _arch_is_superset($self->{arches}, $o->{arches}); - - # The arch qualifier must not forbid an implication - return unless _arch_qualifier_implies($self->{archqual}, - $o->{archqual}); - - # Our restrictions must imply the restrictions for o - return unless _restrictions_imply($self->{restrictions}, - $o->{restrictions}); - - # If o has no version clause, then our dependency is stronger - return 1 if not defined $o->{relation}; - # If o has a version clause, we must also have one, otherwise there - # can't be an implication - return if not defined $self->{relation}; - - return Dpkg::Deps::deps_eval_implication($self->{relation}, - $self->{version}, $o->{relation}, $o->{version}); - - } elsif ($o->isa('Dpkg::Deps::AND')) { - # TRUE: Need to imply all individual elements - # FALSE: Need to NOT imply at least one individual element - my $res = 1; - foreach my $dep ($o->get_deps()) { - my $implication = $self->implies($dep); - unless (defined($implication) && $implication == 1) { - $res = $implication; - last if defined $res; - } - } - return $res; - } elsif ($o->isa('Dpkg::Deps::OR')) { - # TRUE: Need to imply at least one individual element - # FALSE: Need to not apply all individual elements - # UNDEF: The rest - my $res = undef; - foreach my $dep ($o->get_deps()) { - my $implication = $self->implies($dep); - if (defined($implication)) { - if (not defined $res) { - $res = $implication; - } else { - if ($implication) { - $res = 1; - } else { - $res = 0; - } - } - last if defined($res) && $res == 1; - } - } - return $res; - } else { - croak 'Dpkg::Deps::Simple cannot evaluate implication with a ' . - ref($o); - } -} - -=item $dep->get_deps() - -Returns a list of sub-dependencies, which for this object it means it -returns itself. - -=cut - -sub get_deps { - my $self = shift; - return $self; -} - -=item $dep->sort() - -This method is a no-op for this object. - -=cut - -sub sort { - # Nothing to sort -} - -=item $dep->arch_is_concerned($arch) - -Returns true if the dependency applies to the indicated architecture. - -=cut - -sub arch_is_concerned { - my ($self, $host_arch) = @_; - - return 0 if not defined $self->{package}; # Empty dep - return 1 if not defined $self->{arches}; # Dep without arch spec - - return debarch_is_concerned($host_arch, @{$self->{arches}}); -} - -=item $dep->reduce_arch($arch) - -Simplifies the dependency to contain only information relevant to the given -architecture. This object can be left empty after this operation. This trims -off the architecture restriction list of these objects. - -=cut - -sub reduce_arch { - my ($self, $host_arch) = @_; - if (not $self->arch_is_concerned($host_arch)) { - $self->reset(); - } else { - $self->{arches} = undef; - } -} - -=item $dep->has_arch_restriction() - -Returns the package name if the dependency applies only to a subset of -architectures. - -=cut - -sub has_arch_restriction { - my $self = shift; - if (defined $self->{arches}) { - return $self->{package}; - } else { - return (); - } -} - -=item $dep->profile_is_concerned() - -Returns true if the dependency applies to the indicated profile. - -=cut - -sub profile_is_concerned { - my ($self, $build_profiles) = @_; - - return 0 if not defined $self->{package}; # Empty dep - return 1 if not defined $self->{restrictions}; # Dep without restrictions - return evaluate_restriction_formula($self->{restrictions}, $build_profiles); -} - -=item $dep->reduce_profiles() - -Simplifies the dependency to contain only information relevant to the given -profile. This object can be left empty after this operation. This trims off -the profile restriction list of this object. - -=cut - -sub reduce_profiles { - my ($self, $build_profiles) = @_; - - if (not $self->profile_is_concerned($build_profiles)) { - $self->reset(); - } else { - $self->{restrictions} = undef; - } -} - -=item $dep->get_evaluation($facts) - -Evaluates the dependency given a list of installed packages and a list of -virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts -object given as parameters. - -Returns 1 when it's true, 0 when it's false, undef when some information -is lacking to conclude. - -=cut - -sub get_evaluation { - my ($self, $facts) = @_; - return if not defined $self->{package}; - return $facts->evaluate_simple_dep($self); -} - -=item $dep->simplify_deps($facts, @assumed_deps) - -Simplifies the dependency as much as possible given the list of facts (see -object Dpkg::Deps::KnownFacts) and a list of other dependencies that are -known to be true. - -=cut - -sub simplify_deps { - my ($self, $facts) = @_; - my $eval = $self->get_evaluation($facts); - $self->reset() if defined $eval and $eval == 1; -} - -=item $dep->is_empty() - -Returns true if the dependency is empty and doesn't contain any useful -information. This is true when the object has not yet been initialized. - -=cut - -sub is_empty { - my $self = shift; - return not defined $self->{package}; -} - -=item $dep->merge_union($other_dep) - -Returns true if $dep could be modified to represent the union of both -dependencies. Otherwise returns false. - -=cut - -sub merge_union { - my ($self, $o) = @_; - return 0 if not $o->isa('Dpkg::Deps::Simple'); - return 0 if $self->is_empty() or $o->is_empty(); - return 0 if $self->{package} ne $o->{package}; - return 0 if defined $self->{arches} or defined $o->{arches}; - - if (not defined $o->{relation} and defined $self->{relation}) { - # Union is the non-versioned dependency - $self->{relation} = undef; - $self->{version} = undef; - return 1; - } - - my $implication = $self->implies($o); - my $rev_implication = $o->implies($self); - if (defined($implication)) { - if ($implication) { - $self->{relation} = $o->{relation}; - $self->{version} = $o->{version}; - return 1; - } else { - return 0; - } - } - if (defined($rev_implication)) { - if ($rev_implication) { - # Already merged... - return 1; - } else { - return 0; - } - } - return 0; -} - -=back - -=cut - -package Dpkg::Deps::Multiple; - -=head2 OBJECT - Dpkg::Deps::Multiple - -This is the base class for Dpkg::Deps::{AND,OR,Union}. - -=head2 METHODS - Dpkg::Deps::Multiple - -=over 4 - -=cut - -use strict; -use warnings; - -use Carp; - -use Dpkg::ErrorHandling; - -use parent qw(Dpkg::Interface::Storable); - -=item $dep = Dpkg::Deps::Multiple->new(%opts); - -Creates a new object. - -=cut - -sub new { - my $this = shift; - my $class = ref($this) || $this; - my $self = { list => [ @_ ] }; - bless $self, $class; - return $self; -} +=head1 CHANGES -=item $dep->reset() +=head2 Version 1.06 (dpkg 1.18.7; module version bumped on dpkg 1.18.24) -Clears any dependency information stored in $dep so that $dep->is_empty() -returns true. +New option: Add tests_dep option to Dpkg::Deps::deps_parse(). -=cut +=head2 Version 1.05 (dpkg 1.17.14) -sub reset { - my $self = shift; - $self->{list} = []; -} +New function: Dpkg::Deps::deps_iterate(). -=item $dep->add(@deps) +=head2 Version 1.04 (dpkg 1.17.10) -Adds new dependency objects at the end of the list. +New options: Add use_profiles, build_profiles, reduce_profiles and +reduce_restrictions to Dpkg::Deps::deps_parse(). -=cut +=head2 Version 1.03 (dpkg 1.17.0) -sub add { - my $self = shift; - push @{$self->{list}}, @_; -} +New option: Add build_arch option to Dpkg::Deps::deps_parse(). -=item $dep->get_deps() +=head2 Version 1.02 (dpkg 1.17.0) -Returns a list of sub-dependencies. - -=cut - -sub get_deps { - my $self = shift; - return grep { not $_->is_empty() } @{$self->{list}}; -} - -=item $dep->sort() - -Sorts alphabetically the internal list of dependencies. - -=cut - -sub sort { - my $self = shift; - my @res = (); - @res = sort { Dpkg::Deps::deps_compare($a, $b) } @{$self->{list}}; - $self->{list} = [ @res ]; -} - -=item $dep->arch_is_concerned($arch) - -Returns true if at least one of the sub-dependencies apply to this -architecture. - -=cut - -sub arch_is_concerned { - my ($self, $host_arch) = @_; - my $res = 0; - foreach my $dep (@{$self->{list}}) { - $res = 1 if $dep->arch_is_concerned($host_arch); - } - return $res; -} - -=item $dep->reduce_arch($arch) - -Simplifies the dependencies to contain only information relevant to the -given architecture. The non-relevant sub-dependencies are simply removed. - -This trims off the architecture restriction list of Dpkg::Deps::Simple -objects. - -=cut - -sub reduce_arch { - my ($self, $host_arch) = @_; - my @new; - foreach my $dep (@{$self->{list}}) { - $dep->reduce_arch($host_arch); - push @new, $dep if $dep->arch_is_concerned($host_arch); - } - $self->{list} = [ @new ]; -} - -=item $dep->has_arch_restriction() - -Returns the list of package names that have such a restriction. - -=cut - -sub has_arch_restriction { - my $self = shift; - my @res; - foreach my $dep (@{$self->{list}}) { - push @res, $dep->has_arch_restriction(); - } - return @res; -} - -=item $dep->profile_is_concerned() - -Returns true if at least one of the sub-dependencies apply to this profile. - -=cut - -sub profile_is_concerned { - my ($self, $build_profiles) = @_; - my $res = 0; - - foreach my $dep (@{$self->{list}}) { - $res = 1 if $dep->profile_is_concerned($build_profiles); - } - return $res; -} - -=item $dep->reduce_profiles() - -Simplifies the dependencies to contain only information relevant to the -given profile. The non-relevant sub-dependencies are simply removed. - -This trims off the profile restriction list of Dpkg::Deps::Simple objects. - -=cut - -sub reduce_profiles { - my ($self, $build_profiles) = @_; - my @new; - - foreach my $dep (@{$self->{list}}) { - $dep->reduce_profiles($build_profiles); - push @new, $dep if $dep->profile_is_concerned($build_profiles); - } - $self->{list} = [ @new ]; -} - -=item $dep->is_empty() - -Returns true if the dependency is empty and doesn't contain any useful -information. This is true when a (descendant of) Dpkg::Deps::Multiple -contains an empty list of dependencies. - -=cut - -sub is_empty { - my $self = shift; - return scalar @{$self->{list}} == 0; -} - -=item $dep->merge_union($other_dep) - -This method is not meaningful for this object, and will always croak. - -=cut - -sub merge_union { - croak 'method merge_union() is only valid for Dpkg::Deps::Simple'; -} - -=back - -=cut - -package Dpkg::Deps::AND; - -=head2 OBJECT - Dpkg::Deps::AND - -This object represents a list of dependencies that must be met at the same -time. It inherits from Dpkg::Deps::Multiple. - -=head2 METHODS - Dpkg::Deps::AND - -=over 4 - -=cut - -use strict; -use warnings; - -use parent -norequire, qw(Dpkg::Deps::Multiple); - -=item $dep->output([$fh]) - -The output method uses ", " to join the list of sub-dependencies. - -=cut - -sub output { - my ($self, $fh) = @_; - my $res = join(', ', map { $_->output() } grep { not $_->is_empty() } $self->get_deps()); - if (defined($fh)) { - print { $fh } $res; - } - return $res; -} - -=item $dep->implies($other_dep) - -Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies -NOT($other_dep). Returns undef when there's no implication. $dep and -$other_dep do not need to be of the same type. - -=cut - -sub implies { - my ($self, $o) = @_; - # If any individual member can imply $o or NOT $o, we're fine - foreach my $dep ($self->get_deps()) { - my $implication = $dep->implies($o); - return 1 if defined($implication) && $implication == 1; - return 0 if defined($implication) && $implication == 0; - } - # If o is an AND, we might have an implication, if we find an - # implication within us for each predicate in o - if ($o->isa('Dpkg::Deps::AND')) { - my $subset = 1; - foreach my $odep ($o->get_deps()) { - my $found = 0; - foreach my $dep ($self->get_deps()) { - $found = 1 if $dep->implies($odep); - } - $subset = 0 if not $found; - } - return 1 if $subset; - } - return; -} - -=item $dep->get_evaluation($facts) - -Evaluates the dependency given a list of installed packages and a list of -virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts -object given as parameters. - -Returns 1 when it's true, 0 when it's false, undef when some information -is lacking to conclude. - -=cut - -sub get_evaluation { - my ($self, $facts) = @_; - # Return 1 only if all members evaluates to true - # Return 0 if at least one member evaluates to false - # Return undef otherwise - my $result = 1; - foreach my $dep ($self->get_deps()) { - my $eval = $dep->get_evaluation($facts); - if (not defined $eval) { - $result = undef; - } elsif ($eval == 0) { - $result = 0; - last; - } elsif ($eval == 1) { - # Still possible - } - } - return $result; -} - -=item $dep->simplify_deps($facts, @assumed_deps) - -Simplifies the dependency as much as possible given the list of facts (see -object Dpkg::Deps::KnownFacts) and a list of other dependencies that are -known to be true. - -=cut - -sub simplify_deps { - my ($self, $facts, @knowndeps) = @_; - my @new; - -WHILELOOP: - while (@{$self->{list}}) { - my $dep = shift @{$self->{list}}; - my $eval = $dep->get_evaluation($facts); - next if defined($eval) and $eval == 1; - foreach my $odep (@knowndeps, @new) { - next WHILELOOP if $odep->implies($dep); - } - # When a dependency is implied by another dependency that - # follows, then invert them - # "a | b, c, a" becomes "a, c" and not "c, a" - my $i = 0; - foreach my $odep (@{$self->{list}}) { - if (defined $odep and $odep->implies($dep)) { - splice @{$self->{list}}, $i, 1; - unshift @{$self->{list}}, $odep; - next WHILELOOP; - } - $i++; - } - push @new, $dep; - } - $self->{list} = [ @new ]; -} - -=back - -=cut - -package Dpkg::Deps::OR; - -=head2 OBJECT - Dpkg::Deps::OR - -This object represents a list of dependencies of which only one must be met -for the dependency to be true. It inherits from Dpkg::Deps::Multiple. - -=head2 METHODS - Dpkg::Deps::OR - -=over 4 - -=cut - -use strict; -use warnings; - -use parent -norequire, qw(Dpkg::Deps::Multiple); - -=item $dep->output([$fh]) - -The output method uses " | " to join the list of sub-dependencies. - -=cut - -sub output { - my ($self, $fh) = @_; - my $res = join(' | ', map { $_->output() } grep { not $_->is_empty() } $self->get_deps()); - if (defined($fh)) { - print { $fh } $res; - } - return $res; -} - -=item $dep->implies($other_dep) - -Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies -NOT($other_dep). Returns undef when there's no implication. $dep and -$other_dep do not need to be of the same type. - -=cut - -sub implies { - my ($self, $o) = @_; - - # Special case for AND with a single member, replace it by its member - if ($o->isa('Dpkg::Deps::AND')) { - my @subdeps = $o->get_deps(); - if (scalar(@subdeps) == 1) { - $o = $subdeps[0]; - } - } - - # In general, an OR dependency can't imply anything except if each - # of its member implies a member in the other OR dependency - if ($o->isa('Dpkg::Deps::OR')) { - my $subset = 1; - foreach my $dep ($self->get_deps()) { - my $found = 0; - foreach my $odep ($o->get_deps()) { - $found = 1 if $dep->implies($odep); - } - $subset = 0 if not $found; - } - return 1 if $subset; - } - return; -} - -=item $dep->get_evaluation($facts) - -Evaluates the dependency given a list of installed packages and a list of -virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts -object given as parameters. - -Returns 1 when it's true, 0 when it's false, undef when some information -is lacking to conclude. - -=cut - -sub get_evaluation { - my ($self, $facts) = @_; - # Returns false if all members evaluates to 0 - # Returns true if at least one member evaluates to true - # Returns undef otherwise - my $result = 0; - foreach my $dep ($self->get_deps()) { - my $eval = $dep->get_evaluation($facts); - if (not defined $eval) { - $result = undef; - } elsif ($eval == 1) { - $result = 1; - last; - } elsif ($eval == 0) { - # Still possible to have a false evaluation - } - } - return $result; -} - -=item $dep->simplify_deps($facts, @assumed_deps) - -Simplifies the dependency as much as possible given the list of facts (see -object Dpkg::Deps::KnownFacts) and a list of other dependencies that are -known to be true. - -=cut - -sub simplify_deps { - my ($self, $facts) = @_; - my @new; - -WHILELOOP: - while (@{$self->{list}}) { - my $dep = shift @{$self->{list}}; - my $eval = $dep->get_evaluation($facts); - if (defined($eval) and $eval == 1) { - $self->{list} = []; - return; - } - foreach my $odep (@new, @{$self->{list}}) { - next WHILELOOP if $odep->implies($dep); - } - push @new, $dep; - } - $self->{list} = [ @new ]; -} - -=back - -=cut - -package Dpkg::Deps::Union; - -=head2 OBJECT - Dpkg::Deps::Union - -This object represents a list of relationships. It inherits from -Dpkg::Deps::Multiple. - -=head2 METHODS - Dpkg::Deps::Union - -=over 4 - -=cut - -use strict; -use warnings; - -use parent -norequire, qw(Dpkg::Deps::Multiple); - -=item $dep->output([$fh]) - -The output method uses ", " to join the list of relationships. - -=cut - -sub output { - my ($self, $fh) = @_; - my $res = join(', ', map { $_->output() } grep { not $_->is_empty() } $self->get_deps()); - if (defined($fh)) { - print { $fh } $res; - } - return $res; -} - -=item $dep->implies($other_dep) - -=item $dep->get_evaluation($other_dep) - -These methods are not meaningful for this object and always return undef. - -=cut - -sub implies { - # Implication test is not useful on Union. - return; -} - -sub get_evaluation { - # Evaluation is not useful on Union. - return; -} - -=item $dep->simplify_deps($facts) - -The simplification is done to generate an union of all the relationships. -It uses $simple_dep->merge_union($other_dep) to get its job done. - -=cut - -sub simplify_deps { - my ($self, $facts) = @_; - my @new; - -WHILELOOP: - while (@{$self->{list}}) { - my $odep = shift @{$self->{list}}; - foreach my $dep (@new) { - next WHILELOOP if $dep->merge_union($odep); - } - push @new, $odep; - } - $self->{list} = [ @new ]; -} - -=back - -=cut - -package Dpkg::Deps::KnownFacts; - -=head2 OBJECT - Dpkg::Deps::KnownFacts - -This object represents a list of installed packages and a list of virtual -packages provided (by the set of installed packages). - -=head2 METHODS - Dpkg::Deps::KnownFacts - -=over 4 - -=cut - -use strict; -use warnings; - -use Dpkg::Version; - -=item $facts = Dpkg::Deps::KnownFacts->new(); - -Creates a new object. - -=cut - -sub new { - my $this = shift; - my $class = ref($this) || $this; - my $self = { - pkg => {}, - virtualpkg => {}, - }; - bless $self, $class; - return $self; -} - -=item $facts->add_installed_package($package, $version, $arch, $multiarch) - -Records that the given version of the package is installed. If -$version/$arch is undefined we know that the package is installed but we -don't know which version/architecture it is. $multiarch is the Multi-Arch -field of the package. If $multiarch is undef, it will be equivalent to -"Multi-Arch: no". - -Note that $multiarch is only used if $arch is provided. - -=cut - -sub add_installed_package { - my ($self, $pkg, $ver, $arch, $multiarch) = @_; - my $p = { - package => $pkg, - version => $ver, - architecture => $arch, - multiarch => $multiarch // 'no', - }; - $self->{pkg}{"$pkg:$arch"} = $p if defined $arch; - push @{$self->{pkg}{$pkg}}, $p; -} - -=item $facts->add_provided_package($virtual, $relation, $version, $by) - -Records that the "$by" package provides the $virtual package. $relation -and $version correspond to the associated relation given in the Provides -field (if present). - -=cut - -sub add_provided_package { - my ($self, $pkg, $rel, $ver, $by) = @_; - my $v = { - package => $pkg, - relation => $rel, - version => $ver, - provider => $by, - }; - - $self->{virtualpkg}{$pkg} //= []; - push @{$self->{virtualpkg}{$pkg}}, $v; -} - -=item ($check, $param) = $facts->check_package($package) - -$check is one when the package is found. For a real package, $param -contains the version. For a virtual package, $param contains an array -reference containing the list of packages that provide it (each package is -listed as [ $provider, $relation, $version ]). - -This function is obsolete and should not be used. Dpkg::Deps::KnownFacts -is only meant to be filled with data and then passed to Dpkg::Deps -methods where appropriate, but it should not be directly queried. - -=cut - -sub check_package { - my ($self, $pkg) = @_; - - warnings::warnif('deprecated', 'obsolete function, pass ' . - 'Dpkg::Deps::KnownFacts to Dpkg::Deps methods instead'); - - if (exists $self->{pkg}{$pkg}) { - return (1, $self->{pkg}{$pkg}[0]{version}); - } - if (exists $self->{virtualpkg}{$pkg}) { - my $arrayref = [ map { [ - $_->{provider}, $_->{relation}, $_->{version} - ] } @{$self->{virtualpkg}{$pkg}} ]; - return (1, $arrayref); - } - return (0, undef); -} - -## -## The functions below are private to Dpkg::Deps::KnownFacts. -## - -sub _find_package { - my ($self, $dep, $lackinfos) = @_; - my ($pkg, $archqual) = ($dep->{package}, $dep->{archqual}); - return if not exists $self->{pkg}{$pkg}; - my $host_arch = $dep->{host_arch} // Dpkg::Arch::get_host_arch(); - my $build_arch = $dep->{build_arch} // Dpkg::Arch::get_build_arch(); - foreach my $p (@{$self->{pkg}{$pkg}}) { - my $a = $p->{architecture}; - my $ma = $p->{multiarch}; - if (not defined $a) { - $$lackinfos = 1; - next; - } - if (not defined $archqual) { - return $p if $ma eq 'foreign'; - return $p if $a eq $host_arch or $a eq 'all'; - } elsif ($archqual eq 'any') { - return $p if $ma eq 'allowed'; - } elsif ($archqual eq 'native') { - return $p if $a eq $build_arch and $ma ne 'foreign'; - } else { - return $p if $a eq $archqual; - } - } - return; -} - -sub _find_virtual_packages { - my ($self, $pkg) = @_; - return () if not exists $self->{virtualpkg}{$pkg}; - return @{$self->{virtualpkg}{$pkg}}; -} - -=item $facts->evaluate_simple_dep() - -This method is private and should not be used except from within Dpkg::Deps. - -=cut - -sub evaluate_simple_dep { - my ($self, $dep) = @_; - my ($lackinfos, $pkg) = (0, $dep->{package}); - my $p = $self->_find_package($dep, \$lackinfos); - if ($p) { - if (defined $dep->{relation}) { - if (defined $p->{version}) { - return 1 if version_compare_relation($p->{version}, - $dep->{relation}, $dep->{version}); - } else { - $lackinfos = 1; - } - } else { - return 1; - } - } - foreach my $virtpkg ($self->_find_virtual_packages($pkg)) { - next if defined $virtpkg->{relation} and $virtpkg->{relation} ne REL_EQ; - - if (defined $dep->{relation}) { - next if not defined $virtpkg->{version}; - return 1 if version_compare_relation($virtpkg->{version}, - $dep->{relation}, - $dep->{version}); - } else { - return 1; - } - } - return if $lackinfos; - return 0; -} - -=back - -=head1 CHANGES - -=head2 Version 1.06 (dpkg 1.18.7; module version bumped on dpkg 1.18.24) - -New option: Add tests_dep option to Dpkg::Deps::deps_parse(). - -=head2 Version 1.05 (dpkg 1.17.14) - -New function: Dpkg::Deps::deps_iterate(). - -=head2 Version 1.04 (dpkg 1.17.10) - -New options: Add use_profiles, build_profiles, reduce_profiles and -reduce_restrictions to Dpkg::Deps::deps_parse(). - -New methods: Add $dep->profile_is_concerned() and $dep->reduce_profiles() -for all dependency objects. - -=head2 Version 1.03 (dpkg 1.17.0) - -New option: Add build_arch option to Dpkg::Deps::deps_parse(). - -=head2 Version 1.02 (dpkg 1.17.0) - -New function: Dpkg::Deps::deps_concat() +New function: Dpkg::Deps::deps_concat() =head2 Version 1.01 (dpkg 1.16.1) -New method: Add $dep->reset() for all dependency objects. - -New property: Dpkg::Deps::Simple now recognizes the arch qualifier "any" -and stores it in the "archqual" property when present. - -New option: Dpkg::Deps::KnownFacts->add_installed_package() now accepts 2 -supplementary parameters ($arch and $multiarch). - -Deprecated method: Dpkg::Deps::KnownFacts->check_package() is obsolete, -it should not have been part of the public API. + =head2 Version 1.00 (dpkg 1.15.6) diff --git a/scripts/Dpkg/Deps/AND.pm b/scripts/Dpkg/Deps/AND.pm new file mode 100644 index 000000000..e16a2cf35 --- /dev/null +++ b/scripts/Dpkg/Deps/AND.pm @@ -0,0 +1,182 @@ +# Copyright © 1998 Richard Braakman +# Copyright © 1999 Darren Benham +# Copyright © 2000 Sean 'Shaleh' Perry +# Copyright © 2004 Frank Lichtenheld +# Copyright © 2006 Russ Allbery +# Copyright © 2007-2009 Raphaël Hertzog +# Copyright © 2008-2009, 2012-2014 Guillem Jover +# +# This program is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +package Dpkg::Deps::AND; + +=encoding utf8 + +=head1 NAME + +Dpkg::Deps::AND - list of AND dependencies + +=head1 DESCRIPTION + +This object represents a list of dependencies that must be met at the same +time. It inherits from Dpkg::Deps::Multiple. + +=cut + +use strict; +use warnings; + +our $VERSION = '1.00'; + +use parent qw(Dpkg::Deps::Multiple); + +=head1 METHODS + +=over 4 + +=item $dep->output([$fh]) + +The output method uses ", " to join the list of sub-dependencies. + +=cut + +sub output { + my ($self, $fh) = @_; + + my $res = join(', ', map { + $_->output() + } grep { + not $_->is_empty() + } $self->get_deps()); + + if (defined $fh) { + print { $fh } $res; + } + return $res; +} + +=item $dep->implies($other_dep) + +Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies +NOT($other_dep). Returns undef when there's no implication. $dep and +$other_dep do not need to be of the same type. + +=cut + +sub implies { + my ($self, $o) = @_; + + # If any individual member can imply $o or NOT $o, we're fine + foreach my $dep ($self->get_deps()) { + my $implication = $dep->implies($o); + return 1 if defined $implication and $implication == 1; + return 0 if defined $implication and $implication == 0; + } + + # If o is an AND, we might have an implication, if we find an + # implication within us for each predicate in o + if ($o->isa('Dpkg::Deps::AND')) { + my $subset = 1; + foreach my $odep ($o->get_deps()) { + my $found = 0; + foreach my $dep ($self->get_deps()) { + $found = 1 if $dep->implies($odep); + } + $subset = 0 if not $found; + } + return 1 if $subset; + } + return; +} + +=item $dep->get_evaluation($facts) + +Evaluates the dependency given a list of installed packages and a list of +virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts +object given as parameters. + +Returns 1 when it's true, 0 when it's false, undef when some information +is lacking to conclude. + +=cut + +sub get_evaluation { + my ($self, $facts) = @_; + + # Return 1 only if all members evaluates to true + # Return 0 if at least one member evaluates to false + # Return undef otherwise + my $result = 1; + foreach my $dep ($self->get_deps()) { + my $eval = $dep->get_evaluation($facts); + if (not defined $eval) { + $result = undef; + } elsif ($eval == 0) { + $result = 0; + last; + } elsif ($eval == 1) { + # Still possible + } + } + return $result; +} + +=item $dep->simplify_deps($facts, @assumed_deps) + +Simplifies the dependency as much as possible given the list of facts (see +object Dpkg::Deps::KnownFacts) and a list of other dependencies that are +known to be true. + +=cut + +sub simplify_deps { + my ($self, $facts, @knowndeps) = @_; + my @new; + +WHILELOOP: + while (@{$self->{list}}) { + my $dep = shift @{$self->{list}}; + my $eval = $dep->get_evaluation($facts); + next if defined $eval and $eval == 1; + foreach my $odep (@knowndeps, @new) { + next WHILELOOP if $odep->implies($dep); + } + # When a dependency is implied by another dependency that + # follows, then invert them + # "a | b, c, a" becomes "a, c" and not "c, a" + my $i = 0; + foreach my $odep (@{$self->{list}}) { + if (defined $odep and $odep->implies($dep)) { + splice @{$self->{list}}, $i, 1; + unshift @{$self->{list}}, $odep; + next WHILELOOP; + } + $i++; + } + push @new, $dep; + } + $self->{list} = [ @new ]; +} + +=back + +=head1 CHANGES + +=head2 Version 1.00 (dpkg 1.15.6) + +Mark the module as public. + +=cut + +1; diff --git a/scripts/Dpkg/Deps/KnownFacts.pm b/scripts/Dpkg/Deps/KnownFacts.pm new file mode 100644 index 000000000..95770ec00 --- /dev/null +++ b/scripts/Dpkg/Deps/KnownFacts.pm @@ -0,0 +1,244 @@ +# Copyright © 1998 Richard Braakman +# Copyright © 1999 Darren Benham +# Copyright © 2000 Sean 'Shaleh' Perry +# Copyright © 2004 Frank Lichtenheld +# Copyright © 2006 Russ Allbery +# Copyright © 2007-2009 Raphaël Hertzog +# Copyright © 2008-2009, 2012-2014 Guillem Jover +# +# This program is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +package Dpkg::Deps::KnownFacts; + +=encoding utf8 + +=head1 NAME + +Dpkg::Deps::KnownFacts - list of installed real and virtual packages + +=head1 DESCRIPTION + +This object represents a list of installed packages and a list of virtual +packages provided (by the set of installed packages). + +=cut + +use strict; +use warnings; + +our $VERSION = '1.01'; + +use Dpkg::Version; + +=head1 METHODS + +=over 4 + +=item $facts = Dpkg::Deps::KnownFacts->new(); + +Creates a new object. + +=cut + +sub new { + my $this = shift; + my $class = ref($this) || $this; + my $self = { + pkg => {}, + virtualpkg => {}, + }; + + bless $self, $class; + return $self; +} + +=item $facts->add_installed_package($package, $version, $arch, $multiarch) + +Records that the given version of the package is installed. If +$version/$arch is undefined we know that the package is installed but we +don't know which version/architecture it is. $multiarch is the Multi-Arch +field of the package. If $multiarch is undef, it will be equivalent to +"Multi-Arch: no". + +Note that $multiarch is only used if $arch is provided. + +=cut + +sub add_installed_package { + my ($self, $pkg, $ver, $arch, $multiarch) = @_; + my $p = { + package => $pkg, + version => $ver, + architecture => $arch, + multiarch => $multiarch // 'no', + }; + + $self->{pkg}{"$pkg:$arch"} = $p if defined $arch; + push @{$self->{pkg}{$pkg}}, $p; +} + +=item $facts->add_provided_package($virtual, $relation, $version, $by) + +Records that the "$by" package provides the $virtual package. $relation +and $version correspond to the associated relation given in the Provides +field (if present). + +=cut + +sub add_provided_package { + my ($self, $pkg, $rel, $ver, $by) = @_; + my $v = { + package => $pkg, + relation => $rel, + version => $ver, + provider => $by, + }; + + $self->{virtualpkg}{$pkg} //= []; + push @{$self->{virtualpkg}{$pkg}}, $v; +} + +=item ($check, $param) = $facts->check_package($package) + +$check is one when the package is found. For a real package, $param +contains the version. For a virtual package, $param contains an array +reference containing the list of packages that provide it (each package is +listed as [ $provider, $relation, $version ]). + +This function is obsolete and should not be used. Dpkg::Deps::KnownFacts +is only meant to be filled with data and then passed to Dpkg::Deps +methods where appropriate, but it should not be directly queried. + +=cut + +sub check_package { + my ($self, $pkg) = @_; + + warnings::warnif('deprecated', 'obsolete function, pass ' . + 'Dpkg::Deps::KnownFacts to Dpkg::Deps methods instead'); + + if (exists $self->{pkg}{$pkg}) { + return (1, $self->{pkg}{$pkg}[0]{version}); + } + if (exists $self->{virtualpkg}{$pkg}) { + my $arrayref = [ map { [ + $_->{provider}, $_->{relation}, $_->{version} + ] } @{$self->{virtualpkg}{$pkg}} ]; + return (1, $arrayref); + } + return (0, undef); +} + +## +## The functions below are private to Dpkg::Deps::KnownFacts. +## + +sub _find_package { + my ($self, $dep, $lackinfos) = @_; + my ($pkg, $archqual) = ($dep->{package}, $dep->{archqual}); + + return if not exists $self->{pkg}{$pkg}; + + my $host_arch = $dep->{host_arch} // Dpkg::Arch::get_host_arch(); + my $build_arch = $dep->{build_arch} // Dpkg::Arch::get_build_arch(); + + foreach my $p (@{$self->{pkg}{$pkg}}) { + my $a = $p->{architecture}; + my $ma = $p->{multiarch}; + + if (not defined $a) { + $$lackinfos = 1; + next; + } + if (not defined $archqual) { + return $p if $ma eq 'foreign'; + return $p if $a eq $host_arch or $a eq 'all'; + } elsif ($archqual eq 'any') { + return $p if $ma eq 'allowed'; + } elsif ($archqual eq 'native') { + return $p if $a eq $build_arch and $ma ne 'foreign'; + } else { + return $p if $a eq $archqual; + } + } + return; +} + +sub _find_virtual_packages { + my ($self, $pkg) = @_; + + return () if not exists $self->{virtualpkg}{$pkg}; + return @{$self->{virtualpkg}{$pkg}}; +} + +=item $facts->evaluate_simple_dep() + +This method is private and should not be used except from within Dpkg::Deps. + +=cut + +sub evaluate_simple_dep { + my ($self, $dep) = @_; + my ($lackinfos, $pkg) = (0, $dep->{package}); + + my $p = $self->_find_package($dep, \$lackinfos); + if ($p) { + if (defined $dep->{relation}) { + if (defined $p->{version}) { + return 1 if version_compare_relation($p->{version}, + $dep->{relation}, + $dep->{version}); + } else { + $lackinfos = 1; + } + } else { + return 1; + } + } + foreach my $virtpkg ($self->_find_virtual_packages($pkg)) { + next if defined $virtpkg->{relation} and + $virtpkg->{relation} ne REL_EQ; + + if (defined $dep->{relation}) { + next if not defined $virtpkg->{version}; + return 1 if version_compare_relation($virtpkg->{version}, + $dep->{relation}, + $dep->{version}); + } else { + return 1; + } + } + return if $lackinfos; + return 0; +} + +=back + +=head1 CHANGES + +=head2 Version 1.01 (dpkg 1.16.1) + +New option: Dpkg::Deps::KnownFacts->add_installed_package() now accepts 2 +supplementary parameters ($arch and $multiarch). + +Deprecated method: Dpkg::Deps::KnownFacts->check_package() is obsolete, +it should not have been part of the public API. + +=head2 Version 1.00 (dpkg 1.15.6) + +Mark the module as public. + +=cut + +1; diff --git a/scripts/Dpkg/Deps/Multiple.pm b/scripts/Dpkg/Deps/Multiple.pm new file mode 100644 index 000000000..da12f5184 --- /dev/null +++ b/scripts/Dpkg/Deps/Multiple.pm @@ -0,0 +1,250 @@ +# Copyright © 1998 Richard Braakman +# Copyright © 1999 Darren Benham +# Copyright © 2000 Sean 'Shaleh' Perry +# Copyright © 2004 Frank Lichtenheld +# Copyright © 2006 Russ Allbery +# Copyright © 2007-2009 Raphaël Hertzog +# Copyright © 2008-2009, 2012-2014 Guillem Jover +# +# This program is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +package Dpkg::Deps::Multiple; + +=encoding utf8 + +=head1 NAME + +Dpkg::Deps::Multiple - base module to represent multiple dependencies + +=head1 DESCRIPTION + +The Dpkg::Deps::Multiple module provides objects implementing various types +of dependencies. It is the base class for Dpkg::Deps::{AND,OR,Union}. + +=cut + +use strict; +use warnings; + +our $VERSION = '1.02'; + +use Carp; + +use Dpkg::ErrorHandling; + +use parent qw(Dpkg::Interface::Storable); + +=head1 METHODS + +=over 4 + +=item $dep = Dpkg::Deps::Multiple->new(%opts); + +Creates a new object. + +=cut + +sub new { + my $this = shift; + my $class = ref($this) || $this; + my $self = { list => [ @_ ] }; + + bless $self, $class; + return $self; +} + +=item $dep->reset() + +Clears any dependency information stored in $dep so that $dep->is_empty() +returns true. + +=cut + +sub reset { + my $self = shift; + + $self->{list} = []; +} + +=item $dep->add(@deps) + +Adds new dependency objects at the end of the list. + +=cut + +sub add { + my $self = shift; + + push @{$self->{list}}, @_; +} + +=item $dep->get_deps() + +Returns a list of sub-dependencies. + +=cut + +sub get_deps { + my $self = shift; + + return grep { not $_->is_empty() } @{$self->{list}}; +} + +=item $dep->sort() + +Sorts alphabetically the internal list of dependencies. + +=cut + +sub sort { + my $self = shift; + + my @res = (); + @res = sort { Dpkg::Deps::deps_compare($a, $b) } @{$self->{list}}; + $self->{list} = [ @res ]; +} + +=item $dep->arch_is_concerned($arch) + +Returns true if at least one of the sub-dependencies apply to this +architecture. + +=cut + +sub arch_is_concerned { + my ($self, $host_arch) = @_; + + my $res = 0; + foreach my $dep (@{$self->{list}}) { + $res = 1 if $dep->arch_is_concerned($host_arch); + } + return $res; +} + +=item $dep->reduce_arch($arch) + +Simplifies the dependencies to contain only information relevant to the +given architecture. The non-relevant sub-dependencies are simply removed. + +This trims off the architecture restriction list of Dpkg::Deps::Simple +objects. + +=cut + +sub reduce_arch { + my ($self, $host_arch) = @_; + + my @new; + foreach my $dep (@{$self->{list}}) { + $dep->reduce_arch($host_arch); + push @new, $dep if $dep->arch_is_concerned($host_arch); + } + $self->{list} = [ @new ]; +} + +=item $dep->has_arch_restriction() + +Returns the list of package names that have such a restriction. + +=cut + +sub has_arch_restriction { + my $self = shift; + + my @res; + foreach my $dep (@{$self->{list}}) { + push @res, $dep->has_arch_restriction(); + } + return @res; +} + +=item $dep->profile_is_concerned() + +Returns true if at least one of the sub-dependencies apply to this profile. + +=cut + +sub profile_is_concerned { + my ($self, $build_profiles) = @_; + + my $res = 0; + foreach my $dep (@{$self->{list}}) { + $res = 1 if $dep->profile_is_concerned($build_profiles); + } + return $res; +} + +=item $dep->reduce_profiles() + +Simplifies the dependencies to contain only information relevant to the +given profile. The non-relevant sub-dependencies are simply removed. + +This trims off the profile restriction list of Dpkg::Deps::Simple objects. + +=cut + +sub reduce_profiles { + my ($self, $build_profiles) = @_; + + my @new; + foreach my $dep (@{$self->{list}}) { + $dep->reduce_profiles($build_profiles); + push @new, $dep if $dep->profile_is_concerned($build_profiles); + } + $self->{list} = [ @new ]; +} + +=item $dep->is_empty() + +Returns true if the dependency is empty and doesn't contain any useful +information. This is true when a (descendant of) Dpkg::Deps::Multiple +contains an empty list of dependencies. + +=cut + +sub is_empty { + my $self = shift; + + return scalar @{$self->{list}} == 0; +} + +=item $dep->merge_union($other_dep) + +This method is not meaningful for this object, and will always croak. + +=cut + +sub merge_union { + croak 'method merge_union() is only valid for Dpkg::Deps::Simple'; +} + +=back + +=head1 CHANGES + +=head2 Version 1.02 (dpkg 1.17.10) + +New methods: Add $dep->profile_is_concerned() and $dep->reduce_profiles(). + +=head2 Version 1.01 (dpkg 1.16.1) + +New method: Add $dep->reset(). + +=head2 Version 1.00 (dpkg 1.15.6) + +Mark the module as public. + +=cut + +1; diff --git a/scripts/Dpkg/Deps/OR.pm b/scripts/Dpkg/Deps/OR.pm new file mode 100644 index 000000000..b2f8d03ed --- /dev/null +++ b/scripts/Dpkg/Deps/OR.pm @@ -0,0 +1,174 @@ +# Copyright © 1998 Richard Braakman +# Copyright © 1999 Darren Benham +# Copyright © 2000 Sean 'Shaleh' Perry +# Copyright © 2004 Frank Lichtenheld +# Copyright © 2006 Russ Allbery +# Copyright © 2007-2009 Raphaël Hertzog +# Copyright © 2008-2009, 2012-2014 Guillem Jover +# +# This program is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +package Dpkg::Deps::OR; + +=encoding utf8 + +=head1 NAME + +Dpkg::Deps::OR - list of OR dependencies + +=head1 DESCRIPTION + +This object represents a list of dependencies of which only one must be met +for the dependency to be true. It inherits from Dpkg::Deps::Multiple. + +=cut + +use strict; +use warnings; + +our $VERSION = '1.00'; + +use parent qw(Dpkg::Deps::Multiple); + +=head1 METHODS + +=over 4 + +=item $dep->output([$fh]) + +The output method uses " | " to join the list of sub-dependencies. + +=cut + +sub output { + my ($self, $fh) = @_; + + my $res = join(' | ', map { + $_->output() + } grep { + not $_->is_empty() + } $self->get_deps()); + + if (defined $fh) { + print { $fh } $res; + } + return $res; +} + +=item $dep->implies($other_dep) + +Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies +NOT($other_dep). Returns undef when there's no implication. $dep and +$other_dep do not need to be of the same type. + +=cut + +sub implies { + my ($self, $o) = @_; + + # Special case for AND with a single member, replace it by its member + if ($o->isa('Dpkg::Deps::AND')) { + my @subdeps = $o->get_deps(); + if (scalar(@subdeps) == 1) { + $o = $subdeps[0]; + } + } + + # In general, an OR dependency can't imply anything except if each + # of its member implies a member in the other OR dependency + if ($o->isa('Dpkg::Deps::OR')) { + my $subset = 1; + foreach my $dep ($self->get_deps()) { + my $found = 0; + foreach my $odep ($o->get_deps()) { + $found = 1 if $dep->implies($odep); + } + $subset = 0 if not $found; + } + return 1 if $subset; + } + return; +} + +=item $dep->get_evaluation($facts) + +Evaluates the dependency given a list of installed packages and a list of +virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts +object given as parameters. + +Returns 1 when it's true, 0 when it's false, undef when some information +is lacking to conclude. + +=cut + +sub get_evaluation { + my ($self, $facts) = @_; + + # Returns false if all members evaluates to 0 + # Returns true if at least one member evaluates to true + # Returns undef otherwise + my $result = 0; + foreach my $dep ($self->get_deps()) { + my $eval = $dep->get_evaluation($facts); + if (not defined $eval) { + $result = undef; + } elsif ($eval == 1) { + $result = 1; + last; + } elsif ($eval == 0) { + # Still possible to have a false evaluation + } + } + return $result; +} + +=item $dep->simplify_deps($facts, @assumed_deps) + +Simplifies the dependency as much as possible given the list of facts (see +object Dpkg::Deps::KnownFacts) and a list of other dependencies that are +known to be true. + +=cut + +sub simplify_deps { + my ($self, $facts) = @_; + my @new; + +WHILELOOP: + while (@{$self->{list}}) { + my $dep = shift @{$self->{list}}; + my $eval = $dep->get_evaluation($facts); + if (defined $eval and $eval == 1) { + $self->{list} = []; + return; + } + foreach my $odep (@new, @{$self->{list}}) { + next WHILELOOP if $odep->implies($dep); + } + push @new, $dep; + } + $self->{list} = [ @new ]; +} + +=back + +=head1 CHANGES + +=head2 Version 1.00 (dpkg 1.15.6) + +Mark the module as public. + +=cut + +1; diff --git a/scripts/Dpkg/Deps/Simple.pm b/scripts/Dpkg/Deps/Simple.pm new file mode 100644 index 000000000..0557c7cfc --- /dev/null +++ b/scripts/Dpkg/Deps/Simple.pm @@ -0,0 +1,659 @@ +# Copyright © 1998 Richard Braakman +# Copyright © 1999 Darren Benham +# Copyright © 2000 Sean 'Shaleh' Perry +# Copyright © 2004 Frank Lichtenheld +# Copyright © 2006 Russ Allbery +# Copyright © 2007-2009 Raphaël Hertzog +# Copyright © 2008-2009, 2012-2014 Guillem Jover +# +# This program is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +package Dpkg::Deps::Simple; + +=encoding utf8 + +=head1 NAME + +Dpkg::Deps::Simple - represents a single dependency statement + +=head1 DESCRIPTION + +This object has several interesting properties: + +=over 4 + +=item package + +The package name (can be undef if the dependency has not been initialized +or if the simplification of the dependency lead to its removal). + +=item relation + +The relational operator: "=", "<<", "<=", ">=" or ">>". It can be +undefined if the dependency had no version restriction. In that case the +following field is also undefined. + +=item version + +The version. + +=item arches + +The list of architectures where this dependency is applicable. It is +undefined when there's no restriction, otherwise it is an +array ref. It can contain an exclusion list, in that case each +architecture is prefixed with an exclamation mark. + +=item archqual + +The arch qualifier of the dependency (can be undef if there is none). +In the dependency "python:any (>= 2.6)", the arch qualifier is "any". + +=item restrictions + +The restrictions formula for this dependency. It is undefined when there +is no restriction formula. Otherwise it is an array ref. + +=back + +=head1 METHODS + +=over 4 + +=cut + +use strict; +use warnings; + +our $VERSION = '1.02'; + +use Carp; + +use Dpkg::Arch qw(debarch_is_concerned debarch_list_parse); +use Dpkg::BuildProfiles qw(parse_build_profiles evaluate_restriction_formula); +use Dpkg::Version; +use Dpkg::ErrorHandling; +use Dpkg::Gettext; + +use parent qw(Dpkg::Interface::Storable); + +=item $dep = Dpkg::Deps::Simple->new(%opts); + +Creates a new object. Some options can be set through %opts: + +=over + +=item host_arch + +Sets the host architecture. + +=item build_arch + +Sets the build architecture. + +=item build_dep + +Specifies whether the parser should consider it a build dependency. +Defaults to 0. + +=item tests_dep + +Specifies whether the parser should consider it a tests dependency. +Defaults to 0. + +=back + +=cut + +sub new { + my ($this, $arg, %opts) = @_; + my $class = ref($this) || $this; + my $self = {}; + + bless $self, $class; + $self->reset(); + $self->{host_arch} = $opts{host_arch}; + $self->{build_arch} = $opts{build_arch}; + $self->{build_dep} = $opts{build_dep} // 0; + $self->{tests_dep} = $opts{tests_dep} // 0; + $self->parse_string($arg) if defined $arg; + return $self; +} + +=item $dep->reset() + +Clears any dependency information stored in $dep so that $dep->is_empty() +returns true. + +=cut + +sub reset { + my $self = shift; + + $self->{package} = undef; + $self->{relation} = undef; + $self->{version} = undef; + $self->{arches} = undef; + $self->{archqual} = undef; + $self->{restrictions} = undef; +} + +=item $dep->parse($fh, $desc) + +Parses a line from a filehandle. + +=cut + +sub parse { + my ($self, $fh, $desc) = @_; + + my $line = <$fh>; + chomp $line; + return $self->parse_string($line); +} + +=item $dep->parse_string($dep_string) + +Parses the dependency string and modifies internal properties to match the +parsed dependency. + +=cut + +sub parse_string { + my ($self, $dep) = @_; + + my $pkgname_re; + if ($self->{tests_dep}) { + $pkgname_re = qr/[\@a-zA-Z0-9][\@a-zA-Z0-9+.-]*/; + } else { + $pkgname_re = qr/[a-zA-Z0-9][a-zA-Z0-9+.-]*/; + } + + return if not $dep =~ + m{^\s* # skip leading whitespace + ($pkgname_re) # package name + (?: # start of optional part + : # colon for architecture + ([a-zA-Z0-9][a-zA-Z0-9-]*) # architecture name + )? # end of optional part + (?: # start of optional part + \s* \( # open parenthesis for version part + \s* (<<|<=|=|>=|>>|[<>]) # relation part + \s* ([^\)\s]+) # do not attempt to parse version + \s* \) # closing parenthesis + )? # end of optional part + (?: # start of optional architecture + \s* \[ # open bracket for architecture + \s* ([^\]]+) # don't parse architectures now + \s* \] # closing bracket + )? # end of optional architecture + ( + (?: # start of optional restriction + \s* < # open bracket for restriction + \s* [^>]+ # do not parse restrictions now + \s* > # closing bracket + )+ + )? # end of optional restriction + \s*$ # trailing spaces at end + }x; + if (defined $2) { + return if $2 eq 'native' and not $self->{build_dep}; + $self->{archqual} = $2; + } + $self->{package} = $1; + $self->{relation} = version_normalize_relation($3) if defined $3; + if (defined $4) { + $self->{version} = Dpkg::Version->new($4); + } + if (defined $5) { + $self->{arches} = [ debarch_list_parse($5) ]; + } + if (defined $6) { + $self->{restrictions} = [ parse_build_profiles($6) ]; + } +} + +=item $dep->output([$fh]) + +=item "$dep" + +Returns a string representing the dependency. If $fh is set, it prints +the string to the filehandle. + +=cut + +sub output { + my ($self, $fh) = @_; + + my $res = $self->{package}; + if (defined $self->{archqual}) { + $res .= ':' . $self->{archqual}; + } + if (defined $self->{relation}) { + $res .= ' (' . $self->{relation} . ' ' . $self->{version} . ')'; + } + if (defined $self->{arches}) { + $res .= ' [' . join(' ', @{$self->{arches}}) . ']'; + } + if (defined $self->{restrictions}) { + for my $restrlist (@{$self->{restrictions}}) { + $res .= ' <' . join(' ', @{$restrlist}) . '>'; + } + } + if (defined $fh) { + print { $fh } $res; + } + return $res; +} + +# _arch_is_superset(\@p, \@q) +# +# Returns true if the arch list @p is a superset of arch list @q. +# The arguments can also be undef in case there's no explicit architecture +# restriction. +sub _arch_is_superset { + my ($p, $q) = @_; + my $p_arch_neg = defined $p and $p->[0] =~ /^!/; + my $q_arch_neg = defined $q and $q->[0] =~ /^!/; + + # If "p" has no arches, it is a superset of q and we should fall through + # to the version check. + if (not defined $p) { + return 1; + } + # If q has no arches, it is a superset of p and there are no useful + # implications. + elsif (not defined $q) { + return 0; + } + # Both have arches. If neither are negated, we know nothing useful + # unless q is a subset of p. + elsif (not $p_arch_neg and not $q_arch_neg) { + my %p_arches = map { $_ => 1 } @{$p}; + my $subset = 1; + for my $arch (@{$q}) { + $subset = 0 unless $p_arches{$arch}; + } + return 0 unless $subset; + } + # If both are negated, we know nothing useful unless p is a subset of + # q (and therefore has fewer things excluded, and therefore is more + # general). + elsif ($p_arch_neg and $q_arch_neg) { + my %q_arches = map { $_ => 1 } @{$q}; + my $subset = 1; + for my $arch (@{$p}) { + $subset = 0 unless $q_arches{$arch}; + } + return 0 unless $subset; + } + # If q is negated and p isn't, we'd need to know the full list of + # arches to know if there's any relationship, so bail. + elsif (not $p_arch_neg and $q_arch_neg) { + return 0; + } + # If p is negated and q isn't, q is a subset of p if none of the + # negated arches in p are present in q. + elsif ($p_arch_neg and not $q_arch_neg) { + my %q_arches = map { $_ => 1 } @{$q}; + my $subset = 1; + for my $arch (@{$p}) { + $subset = 0 if $q_arches{substr($arch, 1)}; + } + return 0 unless $subset; + } + return 1; +} + +# _arch_qualifier_implies($p, $q) +# +# Returns true if the arch qualifier $p and $q are compatible with the +# implication $p -> $q, false otherwise. $p/$q can be undef/"any"/"native" +# or an architecture string. +# +# Because we are handling dependencies in isolation, and the full context +# of the implications are only known when doing dependency resolution at +# run-time, we can only assert that they are implied if they are equal. +# +# For example dependencies with different arch-qualifiers cannot be simplified +# as these depend on the state of Multi-Arch field in the package depended on. +sub _arch_qualifier_implies { + my ($p, $q) = @_; + + return $p eq $q if defined $p and defined $q; + return 1 if not defined $p and not defined $q; + return 0; +} + +# _restrictions_imply($p, $q) +# +# Returns true if the restrictions $p and $q are compatible with the +# implication $p -> $q, false otherwise. +# NOTE: We don't try to be very clever here, so we may conservatively +# return false when there is an implication. +sub _restrictions_imply { + my ($p, $q) = @_; + + if (not defined $p) { + return 1; + } elsif (not defined $q) { + return 0; + } else { + # Check whether set difference is empty. + my %restr; + + for my $restrlist (@{$q}) { + my $reststr = join ' ', sort @{$restrlist}; + $restr{$reststr} = 1; + } + for my $restrlist (@{$p}) { + my $reststr = join ' ', sort @{$restrlist}; + delete $restr{$reststr}; + } + + return keys %restr == 0; + } +} + +=item $dep->implies($other_dep) + +Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies +NOT($other_dep). Returns undef when there is no implication. $dep and +$other_dep do not need to be of the same type. + +=cut + +sub implies { + my ($self, $o) = @_; + + if ($o->isa('Dpkg::Deps::Simple')) { + # An implication is only possible on the same package + return if $self->{package} ne $o->{package}; + + # Our architecture set must be a superset of the architectures for + # o, otherwise we can't conclude anything. + return unless _arch_is_superset($self->{arches}, $o->{arches}); + + # The arch qualifier must not forbid an implication + return unless _arch_qualifier_implies($self->{archqual}, + $o->{archqual}); + + # Our restrictions must imply the restrictions for o + return unless _restrictions_imply($self->{restrictions}, + $o->{restrictions}); + + # If o has no version clause, then our dependency is stronger + return 1 if not defined $o->{relation}; + # If o has a version clause, we must also have one, otherwise there + # can't be an implication + return if not defined $self->{relation}; + + return Dpkg::Deps::deps_eval_implication($self->{relation}, + $self->{version}, $o->{relation}, $o->{version}); + } elsif ($o->isa('Dpkg::Deps::AND')) { + # TRUE: Need to imply all individual elements + # FALSE: Need to NOT imply at least one individual element + my $res = 1; + foreach my $dep ($o->get_deps()) { + my $implication = $self->implies($dep); + unless (defined $implication and $implication == 1) { + $res = $implication; + last if defined $res; + } + } + return $res; + } elsif ($o->isa('Dpkg::Deps::OR')) { + # TRUE: Need to imply at least one individual element + # FALSE: Need to not apply all individual elements + # UNDEF: The rest + my $res = undef; + foreach my $dep ($o->get_deps()) { + my $implication = $self->implies($dep); + if (defined $implication) { + if (not defined $res) { + $res = $implication; + } else { + if ($implication) { + $res = 1; + } else { + $res = 0; + } + } + last if defined $res and $res == 1; + } + } + return $res; + } else { + croak 'Dpkg::Deps::Simple cannot evaluate implication with a ' . + ref($o); + } +} + +=item $dep->get_deps() + +Returns a list of sub-dependencies, which for this object it means it +returns itself. + +=cut + +sub get_deps { + my $self = shift; + + return $self; +} + +=item $dep->sort() + +This method is a no-op for this object. + +=cut + +sub sort { + # Nothing to sort +} + +=item $dep->arch_is_concerned($arch) + +Returns true if the dependency applies to the indicated architecture. + +=cut + +sub arch_is_concerned { + my ($self, $host_arch) = @_; + + return 0 if not defined $self->{package}; # Empty dep + return 1 if not defined $self->{arches}; # Dep without arch spec + + return debarch_is_concerned($host_arch, @{$self->{arches}}); +} + +=item $dep->reduce_arch($arch) + +Simplifies the dependency to contain only information relevant to the given +architecture. This object can be left empty after this operation. This trims +off the architecture restriction list of these objects. + +=cut + +sub reduce_arch { + my ($self, $host_arch) = @_; + + if (not $self->arch_is_concerned($host_arch)) { + $self->reset(); + } else { + $self->{arches} = undef; + } +} + +=item $dep->has_arch_restriction() + +Returns the package name if the dependency applies only to a subset of +architectures. + +=cut + +sub has_arch_restriction { + my $self = shift; + + if (defined $self->{arches}) { + return $self->{package}; + } else { + return (); + } +} + +=item $dep->profile_is_concerned() + +Returns true if the dependency applies to the indicated profile. + +=cut + +sub profile_is_concerned { + my ($self, $build_profiles) = @_; + + return 0 if not defined $self->{package}; # Empty dep + return 1 if not defined $self->{restrictions}; # Dep without restrictions + return evaluate_restriction_formula($self->{restrictions}, $build_profiles); +} + +=item $dep->reduce_profiles() + +Simplifies the dependency to contain only information relevant to the given +profile. This object can be left empty after this operation. This trims off +the profile restriction list of this object. + +=cut + +sub reduce_profiles { + my ($self, $build_profiles) = @_; + + if (not $self->profile_is_concerned($build_profiles)) { + $self->reset(); + } else { + $self->{restrictions} = undef; + } +} + +=item $dep->get_evaluation($facts) + +Evaluates the dependency given a list of installed packages and a list of +virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts +object given as parameters. + +Returns 1 when it's true, 0 when it's false, undef when some information +is lacking to conclude. + +=cut + +sub get_evaluation { + my ($self, $facts) = @_; + + return if not defined $self->{package}; + return $facts->evaluate_simple_dep($self); +} + +=item $dep->simplify_deps($facts, @assumed_deps) + +Simplifies the dependency as much as possible given the list of facts (see +object Dpkg::Deps::KnownFacts) and a list of other dependencies that are +known to be true. + +=cut + +sub simplify_deps { + my ($self, $facts) = @_; + + my $eval = $self->get_evaluation($facts); + $self->reset() if defined $eval and $eval == 1; +} + +=item $dep->is_empty() + +Returns true if the dependency is empty and doesn't contain any useful +information. This is true when the object has not yet been initialized. + +=cut + +sub is_empty { + my $self = shift; + + return not defined $self->{package}; +} + +=item $dep->merge_union($other_dep) + +Returns true if $dep could be modified to represent the union of both +dependencies. Otherwise returns false. + +=cut + +sub merge_union { + my ($self, $o) = @_; + + return 0 if not $o->isa('Dpkg::Deps::Simple'); + return 0 if $self->is_empty() or $o->is_empty(); + return 0 if $self->{package} ne $o->{package}; + return 0 if defined $self->{arches} or defined $o->{arches}; + + if (not defined $o->{relation} and defined $self->{relation}) { + # Union is the non-versioned dependency + $self->{relation} = undef; + $self->{version} = undef; + return 1; + } + + my $implication = $self->implies($o); + my $rev_implication = $o->implies($self); + if (defined $implication) { + if ($implication) { + $self->{relation} = $o->{relation}; + $self->{version} = $o->{version}; + return 1; + } else { + return 0; + } + } + if (defined $rev_implication) { + if ($rev_implication) { + # Already merged... + return 1; + } else { + return 0; + } + } + return 0; +} + +=back + +=head1 CHANGES + +=head2 Version 1.02 (dpkg 1.17.10) + +New methods: Add $dep->profile_is_concerned() and $dep->reduce_profiles(). + +=head2 Version 1.01 (dpkg 1.16.1) + +New method: Add $dep->reset(). + +New property: recognizes the arch qualifier "any" and stores it in the +"archqual" property when present. + +=head2 Version 1.00 (dpkg 1.15.6) + +Mark the module as public. + +=cut + +1; diff --git a/scripts/Dpkg/Deps/Union.pm b/scripts/Dpkg/Deps/Union.pm new file mode 100644 index 000000000..62cf5c38a --- /dev/null +++ b/scripts/Dpkg/Deps/Union.pm @@ -0,0 +1,119 @@ +# Copyright © 1998 Richard Braakman +# Copyright © 1999 Darren Benham +# Copyright © 2000 Sean 'Shaleh' Perry +# Copyright © 2004 Frank Lichtenheld +# Copyright © 2006 Russ Allbery +# Copyright © 2007-2009 Raphaël Hertzog +# Copyright © 2008-2009, 2012-2014 Guillem Jover +# +# This program is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +package Dpkg::Deps::Union; + +=encoding utf8 + +=head1 NAME + +Dpkg::Deps::Union - list of unrelated dependencies + +=head1 DESCRIPTION + +This object represents a list of relationships. It inherits from +Dpkg::Deps::Multiple. + +=cut + +use strict; +use warnings; + +our $VERSION = '1.00'; + +use parent qw(Dpkg::Deps::Multiple); + +=head1 METHODS + +=over 4 + +=item $dep->output([$fh]) + +The output method uses ", " to join the list of relationships. + +=cut + +sub output { + my ($self, $fh) = @_; + + my $res = join(', ', map { + $_->output() + } grep { + not $_->is_empty() + } $self->get_deps()); + + if (defined $fh) { + print { $fh } $res; + } + return $res; +} + +=item $dep->implies($other_dep) + +=item $dep->get_evaluation($other_dep) + +These methods are not meaningful for this object and always return undef. + +=cut + +sub implies { + # Implication test is not useful on Union. + return; +} + +sub get_evaluation { + # Evaluation is not useful on Union. + return; +} + +=item $dep->simplify_deps($facts) + +The simplification is done to generate an union of all the relationships. +It uses $simple_dep->merge_union($other_dep) to get its job done. + +=cut + +sub simplify_deps { + my ($self, $facts) = @_; + my @new; + +WHILELOOP: + while (@{$self->{list}}) { + my $odep = shift @{$self->{list}}; + foreach my $dep (@new) { + next WHILELOOP if $dep->merge_union($odep); + } + push @new, $odep; + } + $self->{list} = [ @new ]; +} + +=back + +=head1 CHANGES + +=head2 Version 1.00 (dpkg 1.15.6) + +Mark the module as public. + +=cut + +1; diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 28bb4a742..d8160749b 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -79,6 +79,12 @@ nobase_dist_perllib_DATA = \ Dpkg/Control/Tests/Entry.pm \ Dpkg/Control/Types.pm \ Dpkg/Deps.pm \ + Dpkg/Deps/AND.pm \ + Dpkg/Deps/KnownFacts.pm \ + Dpkg/Deps/Multiple.pm \ + Dpkg/Deps/OR.pm \ + Dpkg/Deps/Simple.pm \ + Dpkg/Deps/Union.pm \ Dpkg/Dist/Files.pm \ Dpkg/ErrorHandling.pm \ Dpkg/Exit.pm \ diff --git a/scripts/po/POTFILES.in b/scripts/po/POTFILES.in index dea8cde0e..638fd8b97 100644 --- a/scripts/po/POTFILES.in +++ b/scripts/po/POTFILES.in @@ -46,6 +46,12 @@ scripts/Dpkg/Control/Tests.pm scripts/Dpkg/Control/Tests/Entry.pm scripts/Dpkg/Control/Types.pm scripts/Dpkg/Deps.pm +scripts/Dpkg/Deps/AND.pm +scripts/Dpkg/Deps/KnownFacts.pm +scripts/Dpkg/Deps/Multiple.pm +scripts/Dpkg/Deps/OR.pm +scripts/Dpkg/Deps/Simple.pm +scripts/Dpkg/Deps/Union.pm scripts/Dpkg/Dist/Files.pm scripts/Dpkg/ErrorHandling.pm scripts/Dpkg/Exit.pm -- cgit v1.2.3 From 9ab6c592c04c06952019e5c9bba57b2b54aa3fae Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 8 Jun 2018 03:22:36 +0200 Subject: Dpkg::Source: Do not change patch permissions if not necessary To be able to build a source tree, a user needs write permisions on it, but not necessarily ownership of those files. We check the existing file permissions and avoid changing them if not necessary, which helps in the case where the user does not have ownership of those files, and they were already present. Closes: #898010 Naming-by: Julian Andres Klode --- debian/changelog | 2 ++ scripts/Dpkg/Source/Functions.pm | 13 +++++++++++++ scripts/Dpkg/Source/Package/V2.pm | 4 ++-- scripts/Dpkg/Source/Package/V3/Quilt.pm | 4 ++-- scripts/Dpkg/Source/Quilt.pm | 4 ++-- 5 files changed, 21 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index d0c53872d..28568a5c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -131,6 +131,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium modules. - Dpkg::Gettext: Fix fallback textdomain() to honor its expected interface. - Dpkg::Deps: Split subpackages into their own separate modules. + - Dpkg::Source: Do not change patch permissions if not necessary. + Closes: #898010 * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Source/Functions.pm b/scripts/Dpkg/Source/Functions.pm index 0a940463e..dcb957e13 100644 --- a/scripts/Dpkg/Source/Functions.pm +++ b/scripts/Dpkg/Source/Functions.pm @@ -22,6 +22,7 @@ our $VERSION = '0.01'; our @EXPORT_OK = qw( erasedir fixperms + chmod_if_needed fs_time is_binary ); @@ -70,6 +71,18 @@ sub fixperms { subprocerr("chmod -R -- $modes_set $dir") if $?; } +# Only change the pathname permissions if they differ from the desired. +# +# To be able to build a source tree, a user needs write permisions on it, +# but not necessarily ownership of those files. +sub chmod_if_needed { + my ($newperms, $pathname) = @_; + my $oldperms = (stat $pathname)[2] & 07777; + + return 1 if $oldperms == $newperms; + return chmod $newperms, $pathname; +} + # Touch the file and read the resulting mtime. # # If the file doesn't exist, create it, read the mtime and unlink it. diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index 13e5d7456..2c8529bc1 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/scripts/Dpkg/Source/Package/V2.pm @@ -38,7 +38,7 @@ use Dpkg::Compression; use Dpkg::Source::Archive; use Dpkg::Source::Patch; use Dpkg::Exit qw(push_exit_handler pop_exit_handler); -use Dpkg::Source::Functions qw(erasedir is_binary fs_time); +use Dpkg::Source::Functions qw(erasedir chmod_if_needed is_binary fs_time); use Dpkg::Vendor qw(run_vendor_hook); use Dpkg::Control; use Dpkg::Changelog::Parse; @@ -673,7 +673,7 @@ sub register_patch { if (-s $patch_file) { copy($patch_file, $patch) or syserr(g_('failed to copy %s to %s'), $patch_file, $patch); - chmod(0666 & ~ umask(), $patch) + chmod_if_needed(0666 & ~ umask(), $patch) or syserr(g_("unable to change permission of '%s'"), $patch); my $applied = File::Spec->catfile($dir, 'debian', 'patches', '.dpkg-source-applied'); open(my $applied_fh, '>>', $applied) diff --git a/scripts/Dpkg/Source/Package/V3/Quilt.pm b/scripts/Dpkg/Source/Package/V3/Quilt.pm index 9718ffa2d..7c6137c28 100644 --- a/scripts/Dpkg/Source/Package/V3/Quilt.pm +++ b/scripts/Dpkg/Source/Package/V3/Quilt.pm @@ -28,7 +28,7 @@ use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Version; use Dpkg::Source::Patch; -use Dpkg::Source::Functions qw(erasedir fs_time); +use Dpkg::Source::Functions qw(erasedir chmod_if_needed fs_time); use Dpkg::Source::Quilt; use Dpkg::Exit; @@ -249,7 +249,7 @@ sub register_patch { if (-s $tmpdiff) { copy($tmpdiff, $patch) or syserr(g_('failed to copy %s to %s'), $tmpdiff, $patch); - chmod(0666 & ~ umask(), $patch) + chmod_if_needed(0666 & ~ umask(), $patch) or syserr(g_("unable to change permission of '%s'"), $patch); } elsif (-e $patch) { unlink($patch) or syserr(g_('cannot remove %s'), $patch); diff --git a/scripts/Dpkg/Source/Quilt.pm b/scripts/Dpkg/Source/Quilt.pm index 55b3fbaf8..78a4fdf9a 100644 --- a/scripts/Dpkg/Source/Quilt.pm +++ b/scripts/Dpkg/Source/Quilt.pm @@ -30,7 +30,7 @@ use File::Basename; use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Source::Patch; -use Dpkg::Source::Functions qw(erasedir fs_time); +use Dpkg::Source::Functions qw(erasedir chmod_if_needed fs_time); use Dpkg::Vendor qw(get_current_vendor); sub new { @@ -374,7 +374,7 @@ sub restore_quilt_backup_files { unless (link($_, $target)) { copy($_, $target) or syserr(g_('failed to copy %s to %s'), $_, $target); - chmod((stat(_))[2], $target) + chmod_if_needed((stat _)[2], $target) or syserr(g_("unable to change permission of '%s'"), $target); } } else { -- cgit v1.2.3 From c0c457246d25e7c64f65d1b37f976b7e804b10ab Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 31 Jul 2018 03:53:59 +0200 Subject: dselect: Use override attribute for virtual methods in derived classes C++11 makes it possible to use these attributes so that errors can be avoided, by helping the compiler know when we mean methods to override the ones from the parent class. Warned-by: cppcheck --- dselect/method.h | 18 +++++++++--------- dselect/pkglist.h | 20 ++++++++++---------- scripts/t/Dpkg_Shlibs/patterns.cpp | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'scripts') diff --git a/dselect/method.h b/dselect/method.h index c21e5da0e..f9593ec27 100644 --- a/dselect/method.h +++ b/dselect/method.h @@ -62,15 +62,15 @@ protected: void itd_description(); // Define these virtuals - void redraw1itemsel(int index, int selected); - void redrawcolheads(); - void redrawthisstate(); - void redrawinfo(); - void redrawtitle(); - void setwidths(); - void setheights(); - const char *itemname(int index); - const struct helpmenuentry *helpmenulist(); + void redraw1itemsel(int index, int selected) override; + void redrawcolheads() override; + void redrawthisstate() override; + void redrawinfo() override; + void redrawtitle() override; + void setwidths() override; + void setheights() override; + const char *itemname(int index) override; + const struct helpmenuentry *helpmenulist() override; public: // Keybinding functions */ diff --git a/dselect/pkglist.h b/dselect/pkglist.h index 077cabb88..f60a93169 100644 --- a/dselect/pkglist.h +++ b/dselect/pkglist.h @@ -149,16 +149,16 @@ protected: int deselect_one_of(pkginfo *er, pkginfo *ed, dependency *dep); // Define these virtuals - bool checksearch(char *str); - bool matchsearch(int index); - void redraw1itemsel(int index, int selected); - void redrawcolheads(); - void redrawthisstate(); - void redrawinfo(); - void redrawtitle(); - void setwidths(); - const char *itemname(int index); - const struct helpmenuentry *helpmenulist(); + bool checksearch(char *str) override; + bool matchsearch(int index) override; + void redraw1itemsel(int index, int selected) override; + void redrawcolheads() override; + void redrawthisstate() override; + void redrawinfo() override; + void redrawtitle() override; + void setwidths() override; + const char *itemname(int index) override; + const struct helpmenuentry *helpmenulist() override; // Miscellaneous internal routines diff --git a/scripts/t/Dpkg_Shlibs/patterns.cpp b/scripts/t/Dpkg_Shlibs/patterns.cpp index 3beee43e0..8bfcb4dad 100644 --- a/scripts/t/Dpkg_Shlibs/patterns.cpp +++ b/scripts/t/Dpkg_Shlibs/patterns.cpp @@ -75,7 +75,7 @@ namespace NSB public: ClassD(); virtual ~ClassD(); - virtual void generate_vt(const char *) const; + virtual void generate_vt(const char *) const override; }; EXPORT(ClassD::ClassD()); -- cgit v1.2.3 From a4f0c6f04636ed066eb7e5162403d20a369fceec Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 11 Aug 2018 03:32:37 +0200 Subject: Fix some typos Thanks-to: Niels Thykier (for typo in dpkg(1)) --- ChangeLog.old | 12 ++++++------ debian/changelog | 4 ++-- debian/control | 2 +- doc/rootless-builds.txt | 2 +- lib/compat/getopt.c | 2 +- lib/dpkg/path-remove.c | 2 +- man/dpkg.man | 2 +- scripts/Dpkg/Source/Functions.pm | 2 +- scripts/dpkg-buildpackage.pl | 4 ++-- scripts/t/Dpkg_Changelog/shadow | 8 ++++---- t/pod-coverage.t | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/ChangeLog.old b/ChangeLog.old index 770c9d630..252d901b7 100644 --- a/ChangeLog.old +++ b/ChangeLog.old @@ -1361,7 +1361,7 @@ 2008-08-05 Guillem Jover - * scripts/dpkg-distaddfile.pl: Use _g() instead of mispelled gettext(). + * scripts/dpkg-distaddfile.pl: Use _g() instead of misspelled gettext(). 2008-08-03 Guillem Jover @@ -7444,7 +7444,7 @@ 2006-02-08 Guillem Jover - * debian/contrl (Build-Depends): Depend on version >= 1.28-4 of + * debian/control (Build-Depends): Depend on version >= 1.28-4 of libselinux1-dev as it has pkg-config support. Remove libsepol1-dev, now dragged by libselinux1-dev. Add pkg-config. * m4/libs.m4 (DPKG_LIB_SELINUX): Use pkg-config to get the static @@ -7689,7 +7689,7 @@ 2006-01-23 Bart Martens , Guillem Jover - * debian/contrl (Build-Depends): Add libsepol1-dev as a temporary + * debian/control (Build-Depends): Add libsepol1-dev as a temporary workaround until libselinux1-dev has pkg-config support. * m4/libs.m4 (DPKG_LIB_SELINUX): Explicitly statically link against libsepol. @@ -11001,7 +11001,7 @@ Sun May 19 04:09:25 CDT 2002 Adam Heath * debian/rules: Fix targets, so that if configure fails, but actually succeeds in creating config.status(as might happen if one has a - c-style comment in configure.in, and the shell trys running /foo), then + c-style comment in configure.in, and the shell tries running /foo), then the build will actually fail correctly. Sun May 19 02:31:11 CDT 2002 Adam Heath @@ -13730,7 +13730,7 @@ Tue Feb 8 21:33:58 EST 2000 Ben Collins * main/{processarc,archive}.c: Make the conflictor an array of structs and make sure that check_conflicts uses that and increments a global indexs for the array. The reason that multiple conflicts/replaces were getting - borked had something to do with thre first one in the hash not being + borked had something to do with the first one in the hash not being processed. This was the result of bad pointer games, so this makes it a lot cleaner. @@ -16705,7 +16705,7 @@ Changes in dpkg 0.93.15: * Put packages in `purge' state even if `deinstall' requested if they have no postrm and no conffiles. * Version number comparisons fixed. -* insert-version.pl now installes lib.pl filename too. +* insert-version.pl now installs lib.pl filename too. * Strip trailing slashes when reading files from file lists. Changes in dpkg 0.93.14: diff --git a/debian/changelog b/debian/changelog index b42616b84..fd30747c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -485,7 +485,7 @@ dpkg (1.18.24) unstable; urgency=medium on not cleaning the source tree. * Documentation: - Many spelling fixes. Thanks to Josh Soref . - - Do not include mispellings in changelogs, as that makes detecting them + - Do not include misspellings in changelogs, as that makes detecting them more difficult. * Build system: - Use libexec variable for auxiliary internal programs, and set it to @@ -12719,7 +12719,7 @@ Changes in dpkg 0.93.15: * Put packages in `purge' state even if `deinstall' requested if they have no postrm and no conffiles. * Version number comparisons fixed. -* insert-version.pl now installes lib.pl filename too. +* insert-version.pl now installs lib.pl filename too. * Strip trailing slashes when reading files from file lists. Changes in dpkg 0.93.14: diff --git a/debian/control b/debian/control index 29f9fc5ee..a3f819118 100644 --- a/debian/control +++ b/debian/control @@ -165,7 +165,7 @@ Description: Dpkg perl modules - Dpkg::Build::Info: build information functions - Dpkg::BuildFlags: set, modify and query compilation build flags - Dpkg::BuildOptions: parse and manipulate DEB_BUILD_OPTIONS - - Dpkg::BuildProfile: parse and manipulate build profiles + - Dpkg::BuildProfiles: parse and manipulate build profiles - Dpkg::Changelog: parse changelogs - Dpkg::Changelog::Entry: represents a changelog entry - Dpkg::Changelog::Parse: generic changelog parser for dpkg-parsechangelog diff --git a/doc/rootless-builds.txt b/doc/rootless-builds.txt index 0157879a4..0b6b9d849 100644 --- a/doc/rootless-builds.txt +++ b/doc/rootless-builds.txt @@ -57,7 +57,7 @@ When the builder supports this specification, it MUST notify this fact to the rules file via the "DEB_RULES_REQUIRES_ROOT" environment variable, with the value it has obtained from the Rules-Requires-Root field or some builder specific override mechanism, which will denote the level of support the -builder has choosen to commit to take effect during the build. When set, +builder has chosen to commit to take effect during the build. When set, it MUST be a valid value for the Rules-Requires-Root field. If unset, the build system SHOULD assume that the builder does not recognize the Rules-Requires-Root field at all. diff --git a/lib/compat/getopt.c b/lib/compat/getopt.c index 4c52b8b82..b13f81454 100644 --- a/lib/compat/getopt.c +++ b/lib/compat/getopt.c @@ -88,7 +88,7 @@ USA. */ #endif /* XXX: Disable intl support, because we do not carry the translations anyway - * and this pulls indirectly libintl, wich we do not want to impose. */ + * and this pulls indirectly libintl, which we do not want to impose. */ #ifndef _ #define _(msgid) (msgid) #endif diff --git a/lib/dpkg/path-remove.c b/lib/dpkg/path-remove.c index ef9cde7b5..6afb37607 100644 --- a/lib/dpkg/path-remove.c +++ b/lib/dpkg/path-remove.c @@ -1,6 +1,6 @@ /* * libdpkg - Debian packaging suite library routines - * path-remove.c - path removal functionss + * path-remove.c - path removal functions * * Copyright © 1994-1995 Ian Jackson * Copyright © 2007-2015 Guillem Jover diff --git a/man/dpkg.man b/man/dpkg.man index fdaa87b1c..772c1b324 100644 --- a/man/dpkg.man +++ b/man/dpkg.man @@ -623,7 +623,7 @@ any software not doing syncs before atomic renames. losing data, use with care.\fP \fBscript-chrootless\fP: -Run maintainer scrips without \fBchroot\fP(2)ing into \fBinstdir\fP even +Run maintainer scripts without \fBchroot\fP(2)ing into \fBinstdir\fP even if the package does not support this mode of operation (since dpkg 1.18.5). \fIWarning: This can destroy your host system, use with extreme care.\fP diff --git a/scripts/Dpkg/Source/Functions.pm b/scripts/Dpkg/Source/Functions.pm index dcb957e13..262b80ad1 100644 --- a/scripts/Dpkg/Source/Functions.pm +++ b/scripts/Dpkg/Source/Functions.pm @@ -73,7 +73,7 @@ sub fixperms { # Only change the pathname permissions if they differ from the desired. # -# To be able to build a source tree, a user needs write permisions on it, +# To be able to build a source tree, a user needs write permissions on it, # but not necessarily ownership of those files. sub chmod_if_needed { my ($newperms, $pathname) = @_; diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 9cc6969d3..c50416580 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -629,7 +629,7 @@ if ($signsource) { error(g_('failed to sign %s file'), '.dsc'); } - # Recompute the checksums as the .dsc have changed now. + # Recompute the checksums as the .dsc has changed now. my $buildinfo = Dpkg::Control->new(type => CTRL_FILE_BUILDINFO); $buildinfo->load("../$pva.buildinfo"); my $checksums = Dpkg::Checksums->new(); @@ -731,7 +731,7 @@ sub parse_rules_requires_root { setup_rootcommand(); } - # Notify the childs we do support R³. + # Notify the children we do support R³. $ENV{DEB_RULES_REQUIRES_ROOT} = join ' ', sort keys %rrr; if ($keywords_base > 1 or $keywords_base and $keywords_impl) { diff --git a/scripts/t/Dpkg_Changelog/shadow b/scripts/t/Dpkg_Changelog/shadow index f9b2236f5..5f4bddb85 100644 --- a/scripts/t/Dpkg_Changelog/shadow +++ b/scripts/t/Dpkg_Changelog/shadow @@ -896,7 +896,7 @@ shadow (1:4.0.3-12) unstable; urgency=low shadow (1:4.0.3-11) unstable; urgency=low * update Japanese debconf translation. closes: #210382 - * update Brazilian Portugese debconf translation. closes: #208122 + * update Brazilian Portuguese debconf translation. closes: #208122 * run pam cleanup code as root. closes: #195048 -- Karl Ramm Sat, 13 Sep 2003 17:49:29 -0400 @@ -1108,7 +1108,7 @@ shadow (20000902-7) unstable; urgency=low * Cancel login timeout after authentication so that patient people timing out on network directory services can log in with local accounts. Closes: #107148 - * Add Brazillian Portugese debconf template translation for passwd. + * Add Brazillian Portuguese debconf template translation for passwd. Closes: #105292, #93223 * Pull /usr/share/doc/$package/README.shadow-paper.gz. Closes: #98058 * Use getent instead of group to verify existence of shadow group @@ -1382,7 +1382,7 @@ shadow (19990827-9) unstable; urgency=low shadow (19990827-8) unstable; urgency=low - * src/login.c: fixed loggin of username on successful login (was using + * src/login.c: fixed login of username on successful login (was using the normal username, when it should have used pam_user), closes: #47819 * src/login.c: check for hushed login and pass PAM_SILENT if true, @@ -1586,7 +1586,7 @@ shadow (19990827-1) unstable; urgency=low also call pam_fail_delay() with FAIL_DELAY as the arg before authentication. * etc/login.defs.pam.linux: new file, reflects options that PAM takesover * etc/login.defs.pam.hurd: new file, same for Hurd - * debian/passwd.mk: make sure that login.defs.5 get's installed for Hurd + * debian/passwd.mk: make sure that login.defs.5 gets installed for Hurd * pam.d/: Modified defaults for each service to reflect the old style and also added commented options on how to enable obsoleted options from login.defs in the PAM Way(tm). diff --git a/t/pod-coverage.t b/t/pod-coverage.t index 3cecd8b59..113feb264 100644 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -34,7 +34,7 @@ sub all_pod_modules my $scan_perl_modules = sub { my $module = $File::Find::name; - # Only chack modules, scripts are documented in man pages. + # Only check modules, scripts are documented in man pages. return unless $module =~ s/\.pm$//; my $mod = Module::Metadata->new_from_file($File::Find::name); -- cgit v1.2.3 From 6227aa720d9ce637e676bdc0096fb8316576348f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 23 Jul 2018 12:13:31 +0200 Subject: Dpkg::Substvars: Reword used/unused warnings to clarify their meaning Clarify the unknown and unused substitution variable warnings, to try to make them more clear as to what each implies. Closes: #904258 --- debian/changelog | 2 ++ scripts/Dpkg/Substvars.pm | 6 ++++-- scripts/t/Dpkg_Substvars.t | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index fd30747c2..19fa87c6a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -134,6 +134,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::Deps: Split subpackages into their own separate modules. - Dpkg::Source: Do not change patch permissions if not necessary. Closes: #898010 + - Dpkg::Substvars: Reword used/unused warnings to clarify their meaning. + Closes: #904258 * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm index 1e9f90173..637072846 100644 --- a/scripts/Dpkg/Substvars.pm +++ b/scripts/Dpkg/Substvars.pm @@ -342,7 +342,8 @@ sub substvars { g_('obsolete substitution variable ${%s}'), $vn); } } else { - warning($opts{msg_prefix} . g_('unknown substitution variable ${%s}'), + warning($opts{msg_prefix} . + g_('substitution variable ${%s} used, but is not defined'), $vn) unless $opts{no_warn}; $v = $lhs . $rhs; } @@ -366,7 +367,8 @@ sub warn_about_unused { # that they are not required in the current situation # (example: debhelper's misc:Depends in many cases) next if $self->{vars}{$vn} eq ''; - warning($opts{msg_prefix} . g_('unused substitution variable ${%s}'), + warning($opts{msg_prefix} . + g_('substitution variable ${%s} unused, but is defined'), $vn); } } diff --git a/scripts/t/Dpkg_Substvars.t b/scripts/t/Dpkg_Substvars.t index bb8e14039..6c7be24f2 100644 --- a/scripts/t/Dpkg_Substvars.t +++ b/scripts/t/Dpkg_Substvars.t @@ -97,7 +97,7 @@ is($s->substvars('This is a string with unknown variable ${blubb}'), 'substvars missing'); delete $SIG{__WARN__}; is($output, - 'Dpkg_Substvars.t: warning: test unknown substitution variable ${blubb}' . "\n", + 'Dpkg_Substvars.t: warning: test substitution variable ${blubb} used, but is not defined' . "\n", 'missing variables warning'); # Recursive replace @@ -117,7 +117,7 @@ $SIG{__WARN__} = sub { $output .= $_[0] }; $s->warn_about_unused(); delete $SIG{__WARN__}; is($output, - 'Dpkg_Substvars.t: warning: test unused substitution variable ${var2}' . "\n", + 'Dpkg_Substvars.t: warning: test substitution variable ${var2} unused, but is defined' . "\n", 'unused variables warnings'); # Disable warnings for a certain variable -- cgit v1.2.3 From f277fc2e8e0fd80017e0fd4088789a09737c5c3a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 11 Aug 2018 03:34:24 +0200 Subject: dpkg-gensymbols: Add new -l option This option will make it possible to stop using LD_LIBRARY_PATH when calling this script. --- debian/changelog | 2 ++ man/dpkg-gensymbols.man | 11 +++++++++++ scripts/dpkg-gensymbols.pl | 3 +++ 3 files changed, 16 insertions(+) (limited to 'scripts') diff --git a/debian/changelog b/debian/changelog index 849710fe8..90f81981d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -91,6 +91,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium the end, instead of after each stanza. * Add support for dumping all dpkg-query --status and --print-avail records from the database when no arguments are specified. Closes: #616342 + * Add new dpkg-gensymbols -l option to avoid having to abuse LD_LIBRARY_PATH + for cross-build paths. * Architecture support: - Add support for riscv64 CPU. Closes: #822914 Thanks to Manuel A. Fernandez Montecelo diff --git a/man/dpkg-gensymbols.man b/man/dpkg-gensymbols.man index a708b5e96..36aaf9a3a 100644 --- a/man/dpkg-gensymbols.man +++ b/man/dpkg-gensymbols.man @@ -436,6 +436,17 @@ the \fBFile::Glob\fP(3perl) manual page for details) in \fIlibrary-file\fR to match multiple libraries with a single argument (otherwise you need multiple \fB\-e\fR). .TP +.BI \-l directory +Prepend +.I directory +to the list of directories to search for private shared libraries +(since dpkg 1.19.1). This option can be used multiple times. + +Note: Use this option instead of setting \fBLD_LIBRARY_PATH\fP, +as that environment variable is used to control the run-time linker +and abusing it to set the shared library paths at build-time can be +problematic when cross-compiling for example. +.TP .BI \-I filename Use \fIfilename\fR as reference file to generate the symbols file that is integrated in the package itself. diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl index ef0992883..afc84015d 100755 --- a/scripts/dpkg-gensymbols.pl +++ b/scripts/dpkg-gensymbols.pl @@ -63,6 +63,7 @@ sub usage { 'Usage: %s [