The following commit has been merged in the master branch:
commit ee7dc84822d1bb2d84f8bfebafd233f62a8ee4f2
Author: Modestas Vainius <[email protected]>
Date: Tue Feb 16 01:09:02 2010 +0200
Add -q option to dpkg-gensymbols, -c0 never fails AND shows a diff.
The rationale behind this change that there should be a way to prevent
dpkg-gensymbols from failing if there are lost symbols but still show a
diff at
the same time (which -c0 would not without this patch).
Imagine a source package which builds multiple library binary packages that
are
prone to arch-specific failures (quite typical for C++). Then dh_makeshlibs
would
stop at the first dpkg-gensymbols failure giving only one diff. So it
should be
possible to get diffs for all libraries in the single buildd run regardless
of
check failures (using -c0). The fact that dpkg-gensymbols will never fail is
not that important if maintainer is pretty sure that symbols might be lost
only
due to e.g. unmarked optional symbols or different mangling on other arches.
When updating to a new upstream, maintainer can set
DPKG_GENSYMBOLS_CHECK_LEVEL=1 in the environment to temporary restore
checks.
diff --git a/debian/changelog b/debian/changelog
index 844fd37..8345a0f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -90,6 +90,9 @@ dpkg (1.15.6) UNRELEASED; urgency=low
* Add source version to the dpkg-gensymbols diff label, reformat it according
to the rules of dpkg-name.
* Add -a<arch> option to dpkg-gensymbols.
+ * Add -q option to dpkg-gensymbols. -c0 will never fail but still generate a
+ diff. Use -c0 -q to keep dpkg-gensymbols completely quiet as before
+ (Closes: #568228).
[ Jonathan Nieder ]
* Fix a file handle leak in “dpkg-deb --info”. Thanks to Raphael Geissert
diff --git a/man/dpkg-gensymbols.1 b/man/dpkg-gensymbols.1
index a527c5d..450abd0 100644
--- a/man/dpkg-gensymbols.1
+++ b/man/dpkg-gensymbols.1
@@ -404,17 +404,22 @@ Moreover, some symbols might be omitted when writing a
standard
symbols are always written to the symbol file template.
.TP
.BI \-c [0-4]
-Define the checks to do when comparing the generated symbols file
-with the file used as starting point. By default the level is 1.
-Increasing levels do more checks and include all checks of lower levels.
-Level 0 disables all checks. Level 1 fails if some symbols have
-disappeared. Level 2 fails if some new symbols have been introduced.
-Level 3 fails if some libraries have disappeared. Level 4 fails if some
-libraries have been introduced.
+Define the checks to do when comparing the generated symbols file with the
+template file used as starting point. By default the level is 1. Increasing
+levels do more checks and include all checks of lower levels. Level 0 never
+fails. Level 1 fails if some symbols have disappeared. Level 2 fails if some
+new symbols have been introduced. Level 3 fails if some libraries have
+disappeared. Level 4 fails if some libraries have been introduced.
This value can be overridden by the environment variable
DPKG_GENSYMBOLS_CHECK_LEVEL.
.TP
+.BI \-q
+Keep quiet and never generate a diff between generated symbols file and the
+template file used as starting point or show any warnings about new/lost
+libraries or new/lost symbols. This option only disables informational output
+but not the checks themselves (see \fI\-c\fR option).
+.TP
.BI \-a arch
Assume \fIarch\fR as host architecture when processing symbol files. Use this
option to generate a symbol file or diff for any architecture provided its
diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl
index 14b561a..e710031 100755
--- a/scripts/dpkg-gensymbols.pl
+++ b/scripts/dpkg-gensymbols.pl
@@ -37,6 +37,7 @@ my $sourceversion;
my $stdout;
my $oppackage;
my $compare = 1; # Bail on missing symbols by default
+my $quiet = 0;
my $input;
my $output;
my $template_mode = 0; # non-template mode by default
@@ -68,11 +69,14 @@ Options:
-v<version> version of the packages (defaults to
version extracted from debian/changelog).
-c<level> compare generated symbols file with the
- reference file in the debian directory.
- Fails if difference are too important
- (level goes from 0 for no check, to 4
- for all checks). By default checks at
- level 1.
+ reference template in the debian directory
+ and fail if difference is too important
+ (level goes from 0 for no check, to 4
+ for all checks). By default checks at
+ level 1.
+ -q keep quiet and never emit any warnings or
+ generate a diff between generated symbols
+ file and the reference template.
-I<file> force usage of <file> as reference symbols
file instead of the default file.
-O<file> write to <file>, not .../DEBIAN/symbols.
@@ -97,6 +101,8 @@ while (@ARGV) {
$oppackage = $1;
} elsif (m/^-c(\d)?$/) {
$compare = defined($1) ? $1 : 1;
+ } elsif (m/^-q$/) {
+ $quiet = 1;
} elsif (m/^-d$/) {
$debug = 1;
} elsif (m/^-v(.+)$/) {
@@ -165,7 +171,7 @@ foreach my $file ($input, $output,
"debian/$oppackage.symbols.$host_arch",
if (defined $file and -e $file) {
print "Using references symbols from $file\n" if $debug;
$symfile->load($file);
- $ref_symfile->load($file) if $compare;
+ $ref_symfile->load($file) if $compare || ! $quiet;
last;
}
}
@@ -243,28 +249,33 @@ if ($stdout) {
# Check if generated files differs from reference file
my $exitcode = 0;
-if ($compare) {
- use File::Temp;
- use Digest::MD5;
+if ($compare || ! $quiet) {
# Compare
if (my @libs = $symfile->get_new_libs($ref_symfile)) {
- warning(_g("new libraries appeared in the symbols file: %s"), "@libs");
+ warning(_g("new libraries appeared in the symbols file: %s"), "@libs")
+ unless $quiet;
$exitcode = 4 if ($compare >= 4);
}
if (my @libs = $symfile->get_lost_libs($ref_symfile)) {
- warning(_g("some libraries disappeared in the symbols file: %s"),
"@libs");
+ warning(_g("some libraries disappeared in the symbols file: %s"),
"@libs")
+ unless $quiet;
$exitcode = 3 if ($compare >= 3);
}
if ($symfile->get_new_symbols($ref_symfile)) {
warning(_g("some new symbols appeared in the symbols file: %s"),
- _g("see diff output below"));
+ _g("see diff output below")) unless $quiet;
$exitcode = 2 if ($compare >= 2);
}
if ($symfile->get_lost_symbols($ref_symfile)) {
warning(_g("some symbols or patterns disappeared in the symbols file:
%s"),
- _g("see diff output below"));
+ _g("see diff output below")) unless $quiet;
$exitcode = 1 if ($compare >= 1);
}
+}
+
+unless ($quiet) {
+ use File::Temp;
+ use Digest::MD5;
# Compare template symbols files before and after
my $before = File::Temp->new(TEMPLATE=>'dpkg-gensymbolsXXXXXX');
my $after = File::Temp->new(TEMPLATE=>'dpkg-gensymbolsXXXXXX');
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]