summaryrefslogtreecommitdiffstats
path: root/scripts/noncvslist
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /scripts/noncvslist
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'scripts/noncvslist')
-rwxr-xr-xscripts/noncvslist127
1 files changed, 127 insertions, 0 deletions
diff --git a/scripts/noncvslist b/scripts/noncvslist
new file mode 100755
index 00000000..69f5a591
--- /dev/null
+++ b/scripts/noncvslist
@@ -0,0 +1,127 @@
+#! /usr/bin/env perl
+
+# Offline check for extra in a checked-out
+# CVS module. Sirtaj Singh Kang <taj@kde.org> May 2000.
+# Usage:
+# noncvsfiles <module dir>...
+
+@dirqueue = @ARGV;
+%entries = ();
+@files = ();
+
+sub processEntries
+{
+ my ( $dir ) = @_;
+
+ open( ENTRIES, $dir."/CVS/Entries" )
+ || warn "Couldn't read '$dir/CVS/Entries'";
+
+ while( <ENTRIES> ) {
+ if ( m#^\s*D/([^/]+)/# ) {
+ push ( @dirqueue, "$dir/$1" );
+ $entries{ "$dir/$1" } = 1;
+ next;
+ }
+
+ next unless m#^\s*/([^/]+)/([\d\.]*)/([^/]+)/#;
+
+ $fname = $1;
+ $ver = $2;
+ $stamp = $3;
+
+ $entries{ "$dir/$fname" } = $stamp;
+ }
+
+ close( ENTRIES );
+
+ open( IGNORE, $dir."/.cvsignore" ) || return;
+
+ while( <IGNORE> ) {
+ chomp;
+ s/^\s+//;
+ s/\s+$//;
+ $entries{ "$dir/$_" } = "ignored";
+ }
+
+ close( IGNORE );
+}
+
+# month assoc array for name -> index lookups
+$mctr = 0;
+
+foreach $month ( @monthlist ) {
+ $months{ $month } = $mctr;
+ $mctr++;
+}
+
+# Try current directory if none specified
+
+if( $#dirqueue < 0 ) {
+ push( @dirqueue, "." );
+}
+
+# process directory queue, filling entries hash
+foreach $dir ( @dirqueue ) {
+ processEntries( $dir );
+
+ open( FILES, 'find "'.$dir.'" | grep -v "/CVS"|' )
+ || die "Couldn't find files in $dir";
+
+ while( <FILES> ) {
+ chop;
+ next if $_ eq '.';
+ next if m/\/\.#/; #ignore .#blah
+ push @files, $_;
+ }
+}
+
+#foreach my $entry ( sort keys %entries )
+#{
+# print $entry,"\n";
+#}
+
+my $lastfile = "";
+
+foreach my $file ( sort @files )
+{
+ next if $file eq $lastfile;
+ $lastfile = $file;
+
+ if ( !exists $entries{ $file } ) {
+ print $file,"\n";
+ }
+}
+
+=head1 NAME
+
+noncvslist -- List all files in a checked out CVS module that are not
+known by the CVS server.
+
+=head1 SYNOPSIS
+
+When the current directory is a CVS module:
+
+ noncvslist
+
+Checking checked out subdirectories:
+
+ noncvslist [<dir>...]
+
+=head1 DESCRIPTION
+
+This script will list all files and directories in the module(s) that are
+not listed in the CVS/Entries files. These may be files created during builds,
+new un-added sources files etc. It is a useful housekeeping tool.
+
+=head1 EXAMPLES
+
+Assuming baseline/ has kdelibs/ and kdebase/ checked out within it:
+
+ cd baseline/kdelibs; noncvslist
+ cd baseline; noncvslist kdelibs kdebase
+
+=head1 AUTHOR
+
+Sirtaj Singh Kang <taj@kde.org>
+
+=cut