Bug#688830: [new] Please include who-permits-upload as a convenient interface to retrieve DM permissions

Niels Thykier niels at thykier.net
Mon Mar 18 06:50:21 UTC 2013


Hey,

On 2013-03-18 00:27, Arno Töll wrote:
>     open(CMD, '-|', $GPG, @gpg_arguments) || leave "$GPG: $!\n";
>     while (my $l = <CMD>)
>     {
>         if ($l =~ /^pub/)
>         {
>             $uid = $l;
>             last;
>         }
>     }

You may want to consume the rest of CMD here; not sure about GPG, but
some programs will die with a SIGPIPE if you only consume part of their
output.
  I believe something like:

     1 for <CMD>;

should do[1].

>     my @fields = split(":", $uid);
>     $uid = $fields[9];
>     close(CMD) || leave("gpg returned an error: $?");


~Niels

[1] Should be the same as the slightly more verbose:

  {
    local $_;
    while (<CMD>) {
        1;
    }
  }



More information about the devscripts-devel mailing list