#! /usr/bin/perl
+#
+# $Id$
+#
+# Recommended aliases:
+# alias cvsfiles='cvsutil --files --print'
+# alias cvsignores='cvsutil --ignores --print'
+# alias cvsignoresall='cvsutil --ignores --workings --print'
+# alias cvsignoresrm='cvsutil --ignores --rm'
+# alias cvsignoresrmall='cvsutil --ignores --workings --rm'
+# alias cvsignoresallrm='cvsutil --ignores --workings --rm'
use strict;
use warnings;
fordirs \&localdir,@dir_dirs;
}
+sub filterout
+{
+my($from,@what)=@_;
+
+ my %hash=map { $_=>1; } @$from;
+ for (@what) {
+ delete $hash{$_};
+ }
+ return keys %hash;
+}
+
sub localreaddir
{
local *E;
}
}
close I;
+ @dir_ignores=filterout \@dir_ignores,@dir_dirs,@dir_files;
}
else {
mayfatal "File \"".CVSIGNORE."\" cannot be opened" if !$!{ENOENT};
mayfatal "Cannot read directory \".\"";
return 0;
}
- @dir_workings=readdir D;
+ @dir_workings=filterout [readdir D],@dir_dirs,@dir_files,@dir_ignores,@all_ignore,".","..";
closedir D;
- my %delworkings=map { $_=>1; } @dir_workings;
- for (@dir_dirs,@dir_files,@dir_ignores,@all_ignore,".","..") {
- delete $delworkings{$_};
- }
- @dir_workings=keys %delworkings;
return 1;
}
sub localactionrootset
{
local *R;
- if (!open R,'>',ROOT) {
+ if (!open R,'+<',ROOT) {
mayfatal "File \"".ROOT."\" cannot be written";
return;
}
print R "$opt_root\n";
+ truncate R,tell R;
close R;
}