Warning, /sdk/kde-dev-scripts/noncvslist is written in an unsupported language. File is not indexed.
0001 #! /usr/bin/env perl
0002
0003 # Offline check for extra in a checked-out
0004 # CVS module. Sirtaj Singh Kang <taj@kde.org> May 2000.
0005 # Usage:
0006 # noncvsfiles <module dir>...
0007
0008 @dirqueue = @ARGV;
0009 %entries = ();
0010 @files = ();
0011
0012 sub processEntries
0013 {
0014 my ( $dir ) = @_;
0015
0016 open( ENTRIES, $dir."/CVS/Entries" )
0017 || warn "Couldn't read '$dir/CVS/Entries'";
0018
0019 while( <ENTRIES> ) {
0020 if ( m#^\s*D/([^/]+)/# ) {
0021 push ( @dirqueue, "$dir/$1" );
0022 $entries{ "$dir/$1" } = 1;
0023 next;
0024 }
0025
0026 next unless m#^\s*/([^/]+)/([\d\.]*)/([^/]+)/#;
0027
0028 $fname = $1;
0029 $ver = $2;
0030 $stamp = $3;
0031
0032 $entries{ "$dir/$fname" } = $stamp;
0033 }
0034
0035 close( ENTRIES );
0036
0037 open( IGNORE, $dir."/.cvsignore" ) || return;
0038
0039 while( <IGNORE> ) {
0040 chomp;
0041 s/^\s+//;
0042 s/\s+$//;
0043 $entries{ "$dir/$_" } = "ignored";
0044 }
0045
0046 close( IGNORE );
0047 }
0048
0049 # month assoc array for name -> index lookups
0050 $mctr = 0;
0051
0052 foreach $month ( @monthlist ) {
0053 $months{ $month } = $mctr;
0054 $mctr++;
0055 }
0056
0057 # Try current directory if none specified
0058
0059 if( $#dirqueue < 0 ) {
0060 push( @dirqueue, "." );
0061 }
0062
0063 # process directory queue, filling entries hash
0064 foreach $dir ( @dirqueue ) {
0065 processEntries( $dir );
0066
0067 open( FILES, 'find "'.$dir.'" | grep -v "/CVS"|' )
0068 || die "Couldn't find files in $dir";
0069
0070 while( <FILES> ) {
0071 chop;
0072 next if $_ eq '.';
0073 next if m/\/\.#/; #ignore .#blah
0074 push @files, $_;
0075 }
0076 }
0077
0078 #foreach my $entry ( sort keys %entries )
0079 #{
0080 # print $entry,"\n";
0081 #}
0082
0083 my $lastfile = "";
0084
0085 foreach my $file ( sort @files )
0086 {
0087 next if $file eq $lastfile;
0088 $lastfile = $file;
0089
0090 if ( !exists $entries{ $file } ) {
0091 print $file,"\n";
0092 }
0093 }
0094
0095 =head1 NAME
0096
0097 noncvslist -- List all files in a checked out CVS module that are not
0098 known by the CVS server.
0099
0100 =head1 SYNOPSIS
0101
0102 When the current directory is a CVS module:
0103
0104 noncvslist
0105
0106 Checking checked out subdirectories:
0107
0108 noncvslist [<dir>...]
0109
0110 =head1 DESCRIPTION
0111
0112 This script will list all files and directories in the module(s) that are
0113 not listed in the CVS/Entries files. These may be files created during builds,
0114 new un-added sources files etc. It is a useful housekeeping tool.
0115
0116 =head1 EXAMPLES
0117
0118 Assuming baseline/ has kdelibs/ and kdebase/ checked out within it:
0119
0120 cd baseline/kdelibs; noncvslist
0121 cd baseline; noncvslist kdelibs kdebase
0122
0123 =head1 AUTHOR
0124
0125 Sirtaj Singh Kang <taj@kde.org>
0126
0127 =cut