瀏覽代碼

Dpkg::Vendor::get_vendor_file(): replaces spaces by dashes

Also lookup filenames with dashes replacing spaces in the name
of the vendor.
Raphael Hertzog 17 年之前
父節點
當前提交
012ac74f87
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 2 0
      debian/changelog
  2. 5 1
      scripts/Dpkg/Vendor.pm

+ 2 - 0
debian/changelog

@@ -34,6 +34,8 @@ dpkg (1.15.3) UNRELEASED; urgency=low
   * In dpkg-source, explicitely pass --keyring ~/.gnupg/trustedkeys.gpg to
     gpgv as it does not use it if other --keyring parameters are given.
     Closes: #530769
+  * In dpkg-vendor, allow to use dashes instead of spaces in vendor
+    filenames. Closes: #532222
 
   [ Joachim Breitner ]
   * Warn about unused substvars in dpkg-gencontrol. Closes: #532760

+ 5 - 1
scripts/Dpkg/Vendor.pm

@@ -78,7 +78,11 @@ name.
 sub get_vendor_file(;$) {
     my $vendor = shift || "default";
     my $file;
-    foreach my $name ($vendor, lc($vendor), ucfirst($vendor), ucfirst(lc($vendor))) {
+    my @tries = ($vendor, lc($vendor), ucfirst($vendor), ucfirst(lc($vendor)));
+    if ($vendor =~ s/\s+/-/) {
+        push @tries, $vendor, lc($vendor), ucfirst($vendor), ucfirst(lc($vendor));
+    }
+    foreach my $name (@tries) {
         $file = "/etc/dpkg/origins/$name" if -e "/etc/dpkg/origins/$name";
     }
     return $file;