From 6f278ae0cbc434ba9dd9ceefeedd0e39483d7685 Mon Sep 17 00:00:00 2001 From: hjp Date: Mon, 18 Mar 2002 20:30:11 +0000 Subject: [PATCH] find_cvs_not_up_to_date --- cvstools/GNUmakefile | 38 +++++++++++++++++++++++++++++ cvstools/configure | 34 ++++++++++++++++++++++++++ cvstools/find_cvs_not_up_to_date.pl | 28 +++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 cvstools/GNUmakefile create mode 100644 cvstools/configure create mode 100755 cvstools/find_cvs_not_up_to_date.pl diff --git a/cvstools/GNUmakefile b/cvstools/GNUmakefile new file mode 100644 index 0000000..9677bb3 --- /dev/null +++ b/cvstools/GNUmakefile @@ -0,0 +1,38 @@ +include GNUmakevars + +CONFDIR=../../configure +CONFDIR_exists=$(shell [ -d $(CONFDIR) ] && echo ok) + +all: configure find_cvs_not_up_to_date + +clean: + rm -f find_cvs_not_up_to_date customize + +distclean: clean + + +install: $(BINDIR) $(BINDIR)/find_cvs_not_up_to_date + +%: %.pl customize + sh ./customize < $< > $@ + chmod +x $@ + +%: %.sh customize + sh ./customize < $< > $@ + chmod +x $@ + +customize: configure + sh ./configure + +ifeq ($(CONFDIR_exists),ok) + +configure: $(CONFDIR)/start $(CONFDIR)/perl $(CONFDIR)/finish + cat $^ > $@ + +endif + +$(BINDIR): + mkdir -p $@ + +include GNUmakerules + diff --git a/cvstools/configure b/cvstools/configure new file mode 100644 index 0000000..6fea68e --- /dev/null +++ b/cvstools/configure @@ -0,0 +1,34 @@ +#!/bin/sh +# +echo "#!/bin/sh" > customize.$$ +echo "sed \\" > customize.$$ +chmod +x customize.$$ + +################################################################ +# find a working perl: +# +for i in /usr/bin/perl /usr/local/bin/perl /usr/bin/perl5 /usr/local/bin/perl5 +do + if $i -e 'exit ($] < 5.000)' + then + echo $i works + perl="$i" + break + fi +done +if [ -z "$perl" ] +then + could not find a working perl command, sorry. + exit 1 +fi +echo " -e 's,@@@perl@@@,$perl,g' \\" >> customize.$$ + + +################################################################ +# finish +# Add trailing newline and rename temp file to final name +# +echo >> customize.$$ + +mv customize.$$ customize + diff --git a/cvstools/find_cvs_not_up_to_date.pl b/cvstools/find_cvs_not_up_to_date.pl new file mode 100755 index 0000000..1277070 --- /dev/null +++ b/cvstools/find_cvs_not_up_to_date.pl @@ -0,0 +1,28 @@ +#!@@@perl@@@ -w +use strict; +use File::Find; +use Getopt::Long; + +my $debug = 0; + +sub check_cvs { + local $/ = + "===================================================================\n"; + return unless (-d "$_/CVS"); + print STDERR "checking $File::Find::dir/$_\n" if ($debug); + + # $_ is a CVS working dir + + open (CVSSTATUS, "cd $_ && cvs -q status|"); + while() { + print if (/Status/ && !/Status: Up-to-date/); + } + close(CVSSTATUS); + + # don't recurse, cvs already did: + $File::Find::prune = 1; +} + +GetOptions("debug" => \$debug); +@ARGV = (".") unless (@ARGV); +find(\&check_cvs, @ARGV);