--- trunk/svn2cvs.pl 2007/09/07 16:53:56 36 +++ trunk/svn2cvs.pl 2007/09/07 17:16:48 37 @@ -225,20 +225,6 @@ exit 0; } -# my ($dir,$file) = dir_file($path); -sub dir_file($) { - my $path = shift; - if ($path !~ m,^(.*?/*)([^/]+)$,) { - die "can't split '$path' to dir and file!"; - } else { - my ($d,$f) = ($1,$2); - if ($d !~ m,/$, && $d ne "") { - $d .= "/"; - } - return ($d,$f); - } -} - # return all files in CVS/Entries sub entries($) { my $dir = shift; @@ -265,13 +251,21 @@ # check if file exists in CVS/Entries sub in_entries($) { my $path = shift; - my ($dir,$file) = dir_file($path); - open(E, "$dir/CVS/Entries") || return 0; - while() { - return(1) if (m,^/$file/,); + if ($path =~ m,^(.*?/*)([^/]+)$,) { + my ($dir,$file) = ($1,$2); + if ($dir !~ m,/$, && $dir ne "") { + $dir .= "/"; + } + + open(my $fh, "$dir/CVS/Entries") || return 0; #die "no entries file: $dir/CVS/Entries"; + while(<$fh>) { + return 1 if (m{^/$file/}); + } + close($fh); + return 0; + } else { + die "can't split '$path' to dir and file!"; } - close(E); - return 0; } cd_tmp;