From ca21cc6e5709c7cac4637dc9250495fce3e37ff2 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 1 Jul 2007 15:14:43 +0000 Subject: [PATCH] Apply patch by Raphael Hertzog that: 1) Add a new script dpkg-gensymbol that can produce lists of symbols from shared libraries 2) Modifies dpkg-shlibdeps so that it can use these lists to compute better (i.e. less strict) shlib dependencies. 3) Refactors a lot of code on the way and moves some out to modules (that are not usable for third-party use yet, though and will be installed in dpkg's private library directory --- configure.ac | 1 + debian/dpkg-dev.install | 2 + scripts/Makefile.am | 4 +- scripts/dpkg-gensymbols.pl | 235 ++++++++++++ scripts/dpkg-shlibdeps.pl | 704 ++++++++++++++++------------------ scripts/modules/Makefile.am | 7 + scripts/modules/Objdump.pm | 235 ++++++++++++ scripts/modules/Shlibs.pm | 69 ++++ scripts/modules/SymbolFile.pm | 237 ++++++++++++ scripts/modules/Version.pm | 16 + 10 files changed, 1143 insertions(+), 367 deletions(-) create mode 100644 scripts/dpkg-gensymbols.pl create mode 100644 scripts/modules/Makefile.am create mode 100644 scripts/modules/Objdump.pm create mode 100644 scripts/modules/Shlibs.pm create mode 100644 scripts/modules/SymbolFile.pm create mode 100644 scripts/modules/Version.pm diff --git a/configure.ac b/configure.ac index a023b038..1b899efe 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,7 @@ AC_CONFIG_FILES([ Makefile origins/Makefile po/Makefile.in scripts/Makefile + scripts/modules/Makefile scripts/po/Makefile.in src/Makefile utils/Makefile ]) diff --git a/debian/dpkg-dev.install b/debian/dpkg-dev.install index fda7604b..d5e165c3 100644 --- a/debian/dpkg-dev.install +++ b/debian/dpkg-dev.install @@ -8,6 +8,7 @@ usr/bin/dpkg-checkbuilddeps usr/bin/dpkg-distaddfile usr/bin/dpkg-genchanges usr/bin/dpkg-gencontrol +usr/bin/dpkg-gensymbols usr/bin/dpkg-name usr/bin/dpkg-parsechangelog usr/bin/dpkg-scanpackages @@ -15,6 +16,7 @@ usr/bin/dpkg-scansources usr/bin/dpkg-shlibdeps usr/bin/dpkg-source usr/lib/dpkg/controllib.pl +usr/lib/dpkg/Dpkg usr/lib/dpkg/parsechangelog usr/share/locale/*/LC_MESSAGES/dpkg-dev.mo usr/share/man/*/*/822-date.1 diff --git a/scripts/Makefile.am b/scripts/Makefile.am index b8b36435..45eaedf1 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = po +SUBDIRS = po modules bin_SCRIPTS = \ 822-date \ @@ -10,6 +10,7 @@ bin_SCRIPTS = \ dpkg-distaddfile \ dpkg-genchanges \ dpkg-gencontrol \ + dpkg-gensymbols \ dpkg-name \ dpkg-parsechangelog \ dpkg-scanpackages \ @@ -36,6 +37,7 @@ EXTRA_DIST = \ dpkg-distaddfile.pl \ dpkg-genchanges.pl \ dpkg-gencontrol.pl \ + dpkg-gensymbols.pl \ dpkg-name.sh \ dpkg-parsechangelog.pl \ dpkg-scanpackages.pl \ diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl new file mode 100644 index 00000000..c1066e04 --- /dev/null +++ b/scripts/dpkg-gensymbols.pl @@ -0,0 +1,235 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +our $version; +our $dpkglibdir; +BEGIN { + $version="1.14.4"; # This line modified by Makefile + $dpkglibdir="/usr/lib/dpkg"; # This line modified by Makefile + push(@INC,$dpkglibdir); +} +require 'controllib.pl'; + +use Dpkg::Version qw(compare_versions); +use Dpkg::Shlibs qw(@librarypaths); +use Dpkg::Shlibs::Objdump; +use Dpkg::Shlibs::SymbolFile; + +our $progname; +our (%f, %fi); +our %p2i; +our @librarypaths; + +our $host_arch= `dpkg-architecture -qDEB_HOST_ARCH`; +chomp $host_arch; + +require 'dpkg-gettext.pl'; +textdomain("dpkg-dev"); + +my $controlfile = 'debian/control'; +my $changelogfile = 'debian/changelog'; +my $packagebuilddir = 'debian/tmp'; + +my $sourceversion; +my $stdout; +my $oppackage; +my $compare = 1; # Bail on missing symbols by default +my $output; +my $debug = 0; + +sub version { + printf _g("Debian %s version %s.\n"), $progname, $version; + + printf _g(" +Copyright (C) 2007 Raphael Hertzog. +"); + + printf _g(" +This is free software; see the GNU General Public Licence version 2 or +later for copying conditions. There is NO warranty. +"); +} + +sub usage { + printf _g( +"Usage: %s [