Procházet zdrojové kódy

Revert "dpkg-gensymbols: Use the original template symbols file when diffing"

This reverts commit 9251cc40db1793d01ad0c27408fb0f170c067772.

There's too much information not being preserved in the symbols files to
be able to regenerate templates for them. Although the #PACKAGE# pattern
has been fixed, there is still comments, #include directives and symbols
order. Let's revert it and consider the request that prompted the change
requires too much work for too little gain.

Closes: #785937, #786840
Guillem Jover před 11 roky
rodič
revize
0ced7a67b6
2 změnil soubory, kde provedl 5 přidání a 6 odebrání
  1. 4 0
      debian/changelog
  2. 1 6
      scripts/dpkg-gensymbols.pl

+ 4 - 0
debian/changelog

@@ -21,6 +21,10 @@ dpkg (1.18.1) UNRELEASED; urgency=low
     member. This meant using compression level 1 when using the zlib shared
     member. This meant using compression level 1 when using the zlib shared
     library to compress the control.tar member, and always failing when using
     library to compress the control.tar member, and always failing when using
     the gzip command. Regression introduced in dpkg 1.17.6. Closes: #786654
     the gzip command. Regression introduced in dpkg 1.17.6. Closes: #786654
+  * Use the generated template file instead of the original one when looking
+    for changes in dpkg-gensymbols. There's too much information not being
+    preserved in the symbols files to be able to regenerate templates for
+    them. Closes: #785937, #786840
   * Perl modules:
   * Perl modules:
     - Add missing strict and warnings pragmas for submodules.
     - Add missing strict and warnings pragmas for submodules.
     - Use non-destructive substitutions inside map.
     - Use non-destructive substitutions inside map.

+ 1 - 6
scripts/dpkg-gensymbols.pl

@@ -21,8 +21,6 @@
 use strict;
 use strict;
 use warnings;
 use warnings;
 
 
-use File::Copy;
-
 use Dpkg ();
 use Dpkg ();
 use Dpkg::Arch qw(get_host_arch);
 use Dpkg::Arch qw(get_host_arch);
 use Dpkg::Package;
 use Dpkg::Package;
@@ -287,14 +285,11 @@ unless ($quiet) {
     my $before = File::Temp->new(TEMPLATE=>'dpkg-gensymbolsXXXXXX');
     my $before = File::Temp->new(TEMPLATE=>'dpkg-gensymbolsXXXXXX');
     my $after = File::Temp->new(TEMPLATE=>'dpkg-gensymbolsXXXXXX');
     my $after = File::Temp->new(TEMPLATE=>'dpkg-gensymbolsXXXXXX');
     if ($ref_symfile->{file}) {
     if ($ref_symfile->{file}) {
-        # If the original template symbols file exists, use it instead of
-        # trying to regenerate it, as the output might differ in sort order
-        # or similar.
-        copy($ref_symfile->{file}, $before);
         $file_label = $ref_symfile->{file};
         $file_label = $ref_symfile->{file};
     } else {
     } else {
         $file_label = 'new_symbol_file';
         $file_label = 'new_symbol_file';
     }
     }
+    $ref_symfile->output($before, package => $oppackage, template_mode => 1);
     $symfile->output($after, package => $oppackage, template_mode => 1);
     $symfile->output($after, package => $oppackage, template_mode => 1);
 
 
     seek $before, 0, 0;
     seek $before, 0, 0;