From bd9e6617827818fd043452c08c606f07b78014a0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- scripts/noncvslist | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100755 scripts/noncvslist (limited to 'scripts/noncvslist') 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 May 2000. +# Usage: +# noncvsfiles ... + +@dirqueue = @ARGV; +%entries = (); +@files = (); + +sub processEntries +{ + my ( $dir ) = @_; + + open( ENTRIES, $dir."/CVS/Entries" ) + || warn "Couldn't read '$dir/CVS/Entries'"; + + while( ) { + 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( ) { + 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( ) { + 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 [...] + +=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 + +=cut -- cgit v1.2.1