always ignore CVS and cfgsave

This commit is contained in:
adam 2006-01-03 11:39:31 +00:00 committed by Adam Spiers
parent 9dbb601da0
commit b623fb6de6

22
Stow.pm
View file

@ -541,16 +541,20 @@ sub parent {
sub get_ignore_re_from_file { sub get_ignore_re_from_file {
my ($file) = @_; my ($file) = @_;
# Bootstrap issue - first time we stow, we will be stowing # Bootstrap issue - first time we stow, we will be stowing
# .cvsignore so it won't exist in ~ yet. At that time, use # .cvsignore so it might not exist in ~ yet, or if it does, it could
# a sensible default instead. # be an old version missing the entries we need. So we make sure
open(REGEXPS, $file) or return qr!\.cfgsave\.|^(CVS)$!; # they are there.
my @regexps; my %globs;
while (<REGEXPS>) { if (open(GLOBS, $file)) {
chomp; while (<GLOBS>) {
push @regexps, glob_to_re($_); chomp;
$globs{$_}++;
}
close(GLOBS);
} }
close(REGEXPS); $globs{$_}++ foreach '*.cfgsave.*', 'CVS';
my $re = join '|', @regexps;
my $re = join '|', map glob_to_re($_), keys %globs;
warn "#% ignore regexp is $re\n" if $opts{verbose}; warn "#% ignore regexp is $re\n" if $opts{verbose};
return qr/$re/; return qr/$re/;
} }