Bug#949007: debian-policy: Typo in example

2020-01-15 Thread Russ Allbery
Control: tags -1 pending

Niels Thykier  writes:

> In
> https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-gainrootapi
> we find the following example:


> """
> Examples of valid use of the gain root command:

> # sh-syntax (assumes set -e semantics for error handling)
> $DEB_GAIN_ROOT_CMD some-cmd --which-requires-root

> # perl
> my @cmd = ('some-cmd', '--which-requires-root');
> unshift(@cmd, split(' ', $ENV{DEB_GAIN_ROOT_CMD})) if $ENV{DEB_GAIN_ROOT_CMD};
> system(@cmd) == or die("@cmd failed");

> """

> The Perl code is invalid.  There is missing a 0 after "==" and before
> "or die(...)".

Thanks!  Fixed for the next release.

-- 
Russ Allbery (r...@debian.org)  



Bug#949007: debian-policy: Typo in example

2020-01-15 Thread Jonathan Nieder
Niels Thykier wrote:

> In
> https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-gainrootapi
> we find the following example:
>
> """
> Examples of valid use of the gain root command:
>
> # sh-syntax (assumes set -e semantics for error handling)
> $DEB_GAIN_ROOT_CMD some-cmd --which-requires-root
>
> # perl
> my @cmd = ('some-cmd', '--which-requires-root');
> unshift(@cmd, split(' ', $ENV{DEB_GAIN_ROOT_CMD})) if $ENV{DEB_GAIN_ROOT_CMD};
> system(@cmd) == or die("@cmd failed");
> """
>
> The Perl code is invalid.  There is missing a 0 after "==" and before "or 
> die(...)".

(I don't think this is normative, so probably not needed, but just in
case:)

Seconded.  Thanks for catching it.

Sincerely,
Jonathan



Bug#949007: debian-policy: Typo in example

2020-01-15 Thread Niels Thykier
Source: debian-policy
Severity: minor


In
https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-gainrootapi
we find the following example:


"""
Examples of valid use of the gain root command:

# sh-syntax (assumes set -e semantics for error handling)
$DEB_GAIN_ROOT_CMD some-cmd --which-requires-root

# perl
my @cmd = ('some-cmd', '--which-requires-root');
unshift(@cmd, split(' ', $ENV{DEB_GAIN_ROOT_CMD})) if $ENV{DEB_GAIN_ROOT_CMD};
system(@cmd) == or die("@cmd failed");

"""

The Perl code is invalid.  There is missing a 0 after "==" and before "or 
die(...)".

Thanks,
~Niels