This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=292655415c34db23e6d5014b6f71d0060f5811e4 commit 292655415c34db23e6d5014b6f71d0060f5811e4 Author: Guillem Jover <[email protected]> AuthorDate: Sat Dec 25 01:23:04 2021 +0100 dpkg-shlibdeps: On dpkg-build-api >= 1 require -l instead of LD_LIBRARY_PATH --- man/dpkg-build-api.pod | 5 +++++ scripts/Dpkg/Shlibs.pm | 13 ++++++++++--- scripts/dpkg-gensymbols.pl | 5 ++++- scripts/dpkg-shlibdeps.pl | 6 +++++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/man/dpkg-build-api.pod b/man/dpkg-build-api.pod index de49dfa0e..5f217ae18 100644 --- a/man/dpkg-build-api.pod +++ b/man/dpkg-build-api.pod @@ -51,6 +51,11 @@ build-dependencies. =over +=item * + +B<dpkg-shlibdeps> no longer uses the B<LD_LIBRARY_PATH> environment variable. +The B<-l> option should be used instead. + =back =item v0 diff --git a/scripts/Dpkg/Shlibs.pm b/scripts/Dpkg/Shlibs.pm index 938efed6e..9c245ec84 100644 --- a/scripts/Dpkg/Shlibs.pm +++ b/scripts/Dpkg/Shlibs.pm @@ -49,6 +49,7 @@ use File::Spec; use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Shlibs::Objdump; +use Dpkg::BuildAPI qw(get_build_api); use Dpkg::Path qw(resolve_symlink canonpath); use Dpkg::Arch qw(get_build_arch get_host_arch :mappers); @@ -112,11 +113,17 @@ sub setup_library_paths { my $realpath = Cwd::realpath($path); next unless defined $realpath; if ($realpath =~ m/^\Q$cwd\E/) { - warning(g_('deprecated use of LD_LIBRARY_PATH with private ' . - 'library directory which interferes with ' . - 'cross-building, please use -l option instead')); + if (get_build_api() >= 1) { + error(g_('use -l option instead of LD_LIBRARY_PATH')); + } else { + warning(g_('deprecated use of LD_LIBRARY_PATH with private ' . + 'library directory which interferes with ' . + 'cross-building, please use -l option instead')); + } } + next if get_build_api() >= 1; + # XXX: This should be added to @custom_librarypaths, but as this # is deprecated we do not care as the code will go away. push @system_librarypaths, $path; diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl index 7f3b3c1cc..0bb0bc0d9 100755 --- a/scripts/dpkg-gensymbols.pl +++ b/scripts/dpkg-gensymbols.pl @@ -24,6 +24,7 @@ use warnings; use Dpkg (); use Dpkg::Arch qw(get_host_arch); use Dpkg::Package; +use Dpkg::BuildAPI qw(get_build_api); use Dpkg::Shlibs qw(get_library_paths); use Dpkg::Shlibs::Objdump; use Dpkg::Shlibs::SymbolFile; @@ -156,8 +157,10 @@ if (not defined($sourceversion)) { my $changelog = changelog_parse(); $sourceversion = $changelog->{'Version'}; } +my $control = Dpkg::Control::Info->new(); +# Initialize the build API level. +get_build_api($control); if (not defined($oppackage)) { - my $control = Dpkg::Control::Info->new(); my @packages = map { $_->{'Package'} } $control->get_packages(); if (@packages == 0) { error(g_('no package stanza found in control info')); diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 32f2dfc1d..3dac23e22 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -41,6 +41,7 @@ use Dpkg::Shlibs::Objdump; use Dpkg::Shlibs::SymbolFile; use Dpkg::Substvars; use Dpkg::Arch qw(get_host_arch); +use Dpkg::BuildAPI qw(get_build_api); use Dpkg::Deps; use Dpkg::Control::Info; use Dpkg::Control::Fields; @@ -77,6 +78,10 @@ my $host_arch = get_host_arch(); my (@pkg_shlibs, @pkg_symbols, @pkg_root_dirs); +my $control = Dpkg::Control::Info->new(); +# Initialize build API level. +get_build_api($control); + my ($stdout, %exec); foreach (@ARGV) { if (m/^-T(.*)$/) { @@ -158,7 +163,6 @@ if (-d 'debian') { push @pkg_root_dirs, keys %uniq; } -my $control = Dpkg::Control::Info->new(); my $fields = $control->get_source(); my $bd_value = deps_concat($fields->{'Build-Depends'}, $fields->{'Build-Depends-Arch'}); my $build_deps = deps_parse($bd_value, build_dep => 1, reduce_restrictions => 1); -- Dpkg.Org's dpkg

