Переглянути джерело

Dpkg::Arch: Assume abitable is always present

Switch the conditional loading of the abitable to expect it to always
exist, and bump libdpkg-perl depends on dpkg to 1.16.3, the version
introducing the file.

This will allow some refactoring.
Guillem Jover 11 роки тому
батько
коміт
add97a770e
3 змінених файлів з 9 додано та 13 видалено
  1. 2 0
      debian/changelog
  2. 1 1
      debian/control
  3. 6 12
      scripts/Dpkg/Arch.pm

+ 2 - 0
debian/changelog

@@ -26,6 +26,8 @@ dpkg (1.18.0) UNRELEASED; urgency=low
   * Remove trailing newline from string literal in warning calls.
   * Test suite:
     - Check perl code compilation, warnings and strictness.
+  * Assume in Dpkg::Arch that the abitable is always present, and bump
+    libdpkg-perl Depends on dpkg to 1.16.3, the version introducing the file.
 
  -- Guillem Jover <guillem@debian.org>  Tue, 09 Dec 2014 23:53:18 +0100
 

+ 1 - 1
debian/control

@@ -108,7 +108,7 @@ Section: perl
 Priority: optional
 Architecture: all
 Multi-Arch: foreign
-Depends: dpkg (>= 1.15.8), perl, libtimedate-perl, ${misc:Depends}
+Depends: dpkg (>= 1.16.3), perl, libtimedate-perl, ${misc:Depends}
 Recommends: libfile-fcntllock-perl, bzip2, xz-utils
 Suggests: debian-keyring, gnupg | gnupg2, gpgv | gpgv2,
  gcc | c-compiler, binutils, patch

+ 6 - 12
scripts/Dpkg/Arch.pm

@@ -194,20 +194,14 @@ sub abitable_load()
     local $_;
     local $/ = "\n";
 
-    # Because the abitable is only for override information, do not fail if
-    # it does not exist, as that will only mean the other tables do not have
-    # an entry needing to be overridden. This way we do not require a newer
-    # dpkg by libdpkg-perl.
-    if (open my $abitable_fh, '<', "$Dpkg::DATADIR/abitable") {
-        while (<$abitable_fh>) {
-            if (m/^(?!\#)(\S+)\s+(\S+)/) {
-                $abibits{$1} = $2;
-            }
+    open my $abitable_fh, '<', "$Dpkg::DATADIR/abitable"
+        or syserr(g_('cannot open %s'), 'abitable');
+    while (<$abitable_fh>) {
+        if (m/^(?!\#)(\S+)\s+(\S+)/) {
+            $abibits{$1} = $2;
         }
-        close $abitable_fh;
-    } elsif ($! != ENOENT) {
-        syserr(g_('cannot open %s'), 'abitable');
     }
+    close $abitable_fh;
 
     $abitable_loaded = 1;
 }