diff options
author | Michal Marek <mmarek@suse.cz> | 2015-03-27 17:32:31 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2015-04-24 16:40:28 +0200 |
commit | 9a7fbae0b556f2f4797b955dd32afccd77f36f3f (patch) | |
tree | c779749071517549efc36bb12ebda572508e1fa5 /bin/guards.in | |
parent | 0407a5f965a7c4e12f4e002d141e959f3ffdeb58 (diff) | |
download | quilt-9a7fbae0b556f2f4797b955dd32afccd77f36f3f.tar.gz |
guards: Add support for an external filelist in --check mode
This will allow us to run --check without a kernel-source.git work tree.
Diffstat (limited to 'bin/guards.in')
-rw-r--r-- | bin/guards.in | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bin/guards.in b/bin/guards.in index 7a18c41..246855a 100644 --- a/bin/guards.in +++ b/bin/guards.in @@ -41,7 +41,18 @@ sub files_in($$) { my $dh = new FileHandle; my (@files, $file); + # @<file> syntax + if ($path =~ s/^@//) { + my $fh; + open($fh, '<', $path) or die "$path: $!\n"; + @files = <$fh>; + close($fh); + chomp(@files); + s:^$dir:: for @files; + return @files; + } + $path = slashme($path); opendir $dh, length("$dir$path") ? "$dir$path" : '.' or die "$dir$path: $!\n"; while ($file = readdir($dh)) { @@ -100,7 +111,8 @@ sub help() { print "SYNOPSIS: $0 [--prefix=dir] [--path=dir1:dir2:...]\n" . " [--default=0|1] [--check|--list] [--invert-match]\n" . " [--with-guards] [--config=file] symbol ...\n\n" . - " Defaults: --default=$default\n"; + " Defaults: --default=$default\n" . + " Use --path=\@<file> to read the list of entries from <file>\n"; exit 0; } @@ -145,7 +157,7 @@ if ($check) { my @files; foreach (@path) { - @files = (@files, files_in($dir, slashme($_))); + @files = (@files, files_in($dir, $_)); } my %files = map { $_ => 0 } @files; |