[devscripts] 01/01: mk-origtargz: Restore manual Files-Excluded check

James McCoy jamessan at debian.org
Sun May 4 23:47:31 UTC 2014


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch master
in repository devscripts.

commit 661595da06219c7a93e8cba06bb7e2633d511740
Author: James McCoy <jamessan at debian.org>
Date:   Sun May 4 19:36:21 2014 -0400

    mk-origtargz: Restore manual Files-Excluded check
    
    As Joachim points out, it's more user friendly to warn about improperly
    formed copyright files both for invalidly specified Format and
    non-machine readable files.
    
    This reverts commit 0bb86058a07a83908200af96764acb6ec1b307b2.
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 scripts/mk-origtargz.pl | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/scripts/mk-origtargz.pl b/scripts/mk-origtargz.pl
index c582a66..a299ef4 100755
--- a/scripts/mk-origtargz.pl
+++ b/scripts/mk-origtargz.pl
@@ -272,17 +272,24 @@ for my $copyright_file (@copyright_files) {
     if (not -e $copyright_file) {
 	die "File $copyright_file not found.";
     } elsif (   $data
-	&& defined $data->{format}
-	&& $data->{'files-excluded'})
+	     && defined $data->{format}
+	     && $data->{format} =~ m@^$okformat/?$@)
     {
-	if ($data->{format} =~ m{^$okformat/?$}) {
+	if ($data->{'files-excluded'}) {
 	    push(@exclude_globs, grep { $_ } split(/\s+/, $data->{'files-excluded'}));
-	} else {
-	    warn "WARNING: The file $copyright_file 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";
 	}
+    } else {
+	open my $file, '<', $copyright_file or die "Unable to read $copyright_file: $!\n";
+	while (my $line = <$file>) {
+	    if ($line =~ m/\bFiles-Excluded:/i) {
+		warn "WARNING: The file $copyright_file 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";
+		last;
+	    }
+	}
+	close $file;
     }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list