[devscripts] 01/01: mk-origtargz: When debian/copyright is not in the right format,

Niels Thykier niels at thykier.net
Wed Apr 23 15:59:27 UTC 2014


On 2014-04-23 16:52, Joachim Breitner wrote:
> This is an automated email from the git hooks/post-receive script.
> 
> nomeata pushed a commit to branch master
> in repository devscripts.
> 

Hi,

I have a remark about this commit, see below:

> commit 6b50047be8b1bfde987b9d1385f523636a74d354
> Author: Joachim Breitner <nomeata at debian.org>
> Date:   Wed Apr 23 16:52:15 2014 +0200
> 
>     mk-origtargz: When debian/copyright is not in the right format,
>     
>     but mentions Files-Excluded, print a warning. This was suggested by
>     Gunnar Wolf on debian-devel.
> ---
>  scripts/mk-origtargz.pl | 27 ++++++++++++++-----
>  test/test_mk-origtargz  | 71 ++++++++++++++++++++++++++++++++++---------------
>  2 files changed, 69 insertions(+), 29 deletions(-)
> 
> diff --git a/scripts/mk-origtargz.pl b/scripts/mk-origtargz.pl
> index a4ea492..62e88de 100755
> --- a/scripts/mk-origtargz.pl
> +++ b/scripts/mk-origtargz.pl
> [...]
> +	} elsif (-r $copyright_file) {
> +		# be helpful
> +		my $has_files_excluded = 0;
> +		open COPYRIGHT, '<', $copyright_file;
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Missing check of return value !  Perl's open behaves more like C's Open
(i.e. returns on error) rather than Python/Java's (throws exception).

A common fix would be to add something like:
  or die "cannot open $copyright_file: $!";

 (see line 244 or 372 of the same file)
> +		$has_files_excluded ||= /Files-Excluded/i while (<COPYRIGHT>);
> +		close COPYRIGHT;
> +		print STDERR
> +		      "WARNING: The file debian/copyright mentions Files-Excluded, but its ".
> +		      "format is not recognized. Specify Format: ".
> +		      "http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ ".
> +		      "in order to remove files from the tarball with mk_origtargz.\n"
> +					if ($has_files_excluded);
> +	}
>  }
>  [...]



More information about the devscripts-devel mailing list