[SCM] Git repository for devscripts branch, master, updated. v2.12.4-209-g129e290

James McCoy jamessan at debian.org
Sun May 5 06:07:36 UTC 2013


The following commit has been merged in the master branch:
commit 129e290bc334a649f2c5505b80c85311daa15fd0
Author: James McCoy <jamessan at debian.org>
Date:   Sun May 5 02:07:01 2013 -0400

    who-permits-upload:  Fix handling of encoding
    
    Signed-off-by: James McCoy <jamessan at debian.org>

diff --git a/README b/README
index 35aeefa..639030f 100644
--- a/README
+++ b/README
@@ -239,7 +239,8 @@ And now, in mostly alphabetical order, the scripts:
 - whodepends: check which maintainers' packages depend on a package
 
 - who-permits-upload: Retrieve information about Debian Maintainer access
-  control lists [gnupg, libparse-debcontrol-perl, libwww-perl, debian-keyring]
+  control lists [gnupg, libencode-locale-perl, libparse-debcontrol-perl,
+  libwww-perl, debian-keyring]
 
 - who-uploads: determine the most recent uploaders of a package to the Debian
   archive [gnupg, debian-keyring, debian-maintainers, wget]
diff --git a/debian/changelog b/debian/changelog
index ef9c7b2..098a284 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,7 @@ devscripts (2.13.2) UNRELEASED; urgency=low
   * who-permits-upload:
     + Use consistent formatting in the "SEE ALSO" section of the POD.
     + Fix spelling mistakes.
+    + Fix handling of encoding.
 
   [ Christoph Berg ]
   * dget: "--all pkg" will download all binaries for source package pkg.
diff --git a/debian/control b/debian/control
index 1dd17a6..34f6bab 100644
--- a/debian/control
+++ b/debian/control
@@ -46,6 +46,7 @@ Recommends: at,
             fakeroot,
             gnupg,
             libdistro-info-perl,
+            libencode-locale-perl,
             libjson-perl,
             libparse-debcontrol-perl,
             liburi-perl,
@@ -196,8 +197,8 @@ Description: scripts to make the life of a Debian Package maintainer easier
   - wnpp-check: check whether there is an open request for packaging or
     intention to package bug for a package [wget | curl]
   - who-permits-upload: Retrieve information about Debian Maintainer access
-    control lists [gnupg, libparse-debcontrol-perl, libwww-perl,
-    debian-keyring]
+    control lists [gnupg, libencode-locale-perl, libparse-debcontrol-perl,
+    libwww-perl, debian-keyring]
   - wrap-and-sort: wrap long lines and sort items in packaging files
     [python3-debian]
  .
diff --git a/scripts/who-permits-upload.pl b/scripts/who-permits-upload.pl
index 21a2b9b..c63e436 100755
--- a/scripts/who-permits-upload.pl
+++ b/scripts/who-permits-upload.pl
@@ -21,6 +21,8 @@
 use strict;
 use Parse::DebControl;
 use LWP::UserAgent;
+use Encode::Locale;
+use Encode;
 use Getopt::Long;
 use constant {TYPE_PACKAGE => "package", TYPE_UID => "uid", TYPE_SPONSOR => "sponsor"};
 use constant {SPONSOR_FINGERPRINT => 0, SPONSOR_NAME => 1};
@@ -31,6 +33,9 @@ our $TYPE = "package";
 our $GPG = "/usr/bin/gpg";
 our ($HELP, @ARGUMENTS, @DM_DATA, %GPG_CACHE);
 
+binmode STDIN, ':encoding(console_in)';
+binmode STDOUT, ':encoding(console_out)';
+binmode STDERR, ':encoding(console_out)';
 
 =encoding utf8
 
@@ -246,8 +251,9 @@ sub lookup_fingerprint
         }
         push(@gpg_arguments, ("--keyring", $keyring));
     }
-    push(@gpg_arguments, ("--no-options", "--no-auto-check-trustdb", "--no-default-keyring", "--list-key", "--with-colons", "$fingerprint"));
+    push(@gpg_arguments, ("--no-options", "--no-auto-check-trustdb", "--no-default-keyring", "--list-key", "--with-colons", encode(locale => $fingerprint)));
     open(CMD, '-|', $GPG, @gpg_arguments) || leave "$GPG: $!\n";
+    binmode CMD, ':encoding(UTF-8)';
     while (my $l = <CMD>)
     {
         if ($l =~ /^pub/)
@@ -332,6 +338,7 @@ else
 
 foreach my $argument (@ARGUMENTS)
 {
+    $argument = decode(locale => $argument);
     my @rows = find_matching_row($argument, $TYPE);
     if (not @rows)
     {

-- 
Git repository for devscripts



More information about the devscripts-devel mailing list