-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcvsshowunkn.pl
More file actions
executable file
·44 lines (31 loc) · 924 Bytes
/
cvsshowunkn.pl
File metadata and controls
executable file
·44 lines (31 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/perl -w
#
# author Olaf Klischat
use strict;
use Getopt::Long;
my $cvscmd = "cvs";
my $quiet = 0;
exit(1) unless GetOptions ("cvs=s" => \$cvscmd,
"quiet|q" => \$quiet);
sub infoMsg {
! $quiet and print STDERR "cvsshowunkn.pl: @_\n";
}
infoMsg("running $cvscmd status...");
open(CVSSTATUS,"$cvscmd status 2>&1 |") or die "$!";
my @knownFiles;
my $currDir;
while (<CVSSTATUS>) {
if (/^cvs .*: Examining (.*)/) {
$currDir = "${1}";
$currDir ne "." and $currDir = "./$currDir";
}
elsif (/^File: (\S+).+Status:/) { # TODO: file names containing whitespaces won't be recognized this way
push @knownFiles, "${currDir}/$1";
}
}
infoMsg("finding unknown files...");
use File::Find;
find(\&findCallback, '.');
sub findCallback {
-f && $File::Find::name !~ /\/CVS\// && ! ( grep {$_ eq $File::Find::name} @knownFiles ) && print "$File::Find::name\n";
}