summaryrefslogtreecommitdiff
path: root/source3/script
diff options
context:
space:
mode:
authorcvs2svn Import User <samba-bugs@samba.org>2002-08-17 07:09:23 +0000
committercvs2svn Import User <samba-bugs@samba.org>2002-08-17 07:09:23 +0000
commit592dd249579511f7ce863a42030d9a51ca026c27 (patch)
tree805985e633b375fd0a88a564a35c38410093a1dd /source3/script
parent08663f11ed5bc05ff352bda74774d5e7045da1e5 (diff)
parent8690b271a6a4feb112e0a6c03fe99ee25f86430b (diff)
downloadsamba-592dd249579511f7ce863a42030d9a51ca026c27.tar.gz
samba-592dd249579511f7ce863a42030d9a51ca026c27.tar.bz2
samba-592dd249579511f7ce863a42030d9a51ca026c27.zip
This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to be commit 6938b5b98abd9ba055a46583a05c4fc07e32f529)
Diffstat (limited to 'source3/script')
-rwxr-xr-xsource3/script/cvslog.pl102
1 files changed, 102 insertions, 0 deletions
diff --git a/source3/script/cvslog.pl b/source3/script/cvslog.pl
new file mode 100755
index 0000000000..f3d020aa72
--- /dev/null
+++ b/source3/script/cvslog.pl
@@ -0,0 +1,102 @@
+#!/usr/bin/perl -w
+
+my ( $tag, $filename, $date );
+my ( $tmp, $change_flag );
+
+if ( $#ARGV != 2 ) {
+
+ print "Usage: ", $0, " cvstag date file\n";
+ exit 1;
+}
+
+$tag = $ARGV[0];
+$date = $ARGV[1];
+$filename = $ARGV[2];
+
+print STDERR "$filename\n";
+
+open ( CVSLOG, "cvs log -d\"$date\" $filename |" ) || die $!;
+
+##
+## First get the branch revision number
+##
+undef $revision;
+while ( !defined($revision) ) {
+ if ( eof( \*CVSLOG ) ) {
+ print STDERR "Premature end of cvs log output!\n";
+ exit (1);
+ }
+
+ $string = <CVSLOG>;
+ chomp( $string );
+
+ if ( $string =~ /$tag:/ ) {
+ ( $tmp, $revision ) = split( /:/, $string );
+ $revision =~ s/\s+//g;
+ $revision =~ s/\.0\./\./g;
+ }
+}
+
+##
+## Setup the beginning of the first record
+##
+$string = "";
+while ( $string !~ /^-+/ ) {
+ $string = <CVSLOG>;
+ exit(0) if ( eof(\*CVSLOG) );
+}
+
+##
+## Loop starting at the revision number for the entry
+##
+
+while ( $string = <CVSLOG> ) {
+
+ ($tmp, $entry_rev) = split( /\s+/, $string );
+ if ( equal_revision( $revision, $entry_rev ) ) {
+ if ( ! defined($change_flag) ) {
+ print "++++++++++++++++++++++++++++++++++++++++++++++++++\n";
+ print "## $filename\n";
+ print "++\n";
+ $change_flag = 1;
+ }
+
+ while ( $string !~ /^-+/ && !eof(CVSLOG) ) {
+ print "$string";
+ $string = <CVSLOG>;
+ }
+ }
+ else {
+ while ( ($string !~ /^-+/) && !eof(CVSLOG) ) {
+ $string = <CVSLOG>;
+ }
+ }
+}
+
+close( CVSLOG );
+exit 0;
+
+##############################################################
+##
+sub equal_revision {
+ my ( $branch, $newfile ) = @_;
+ my ( $indx );
+ my ( @branch_rev, @file_rev );
+
+ @branch_rev = split( /\./, $branch );
+ @file_rev = split( /\./, $newfile );
+
+ return 0 if ( $#branch_rev != ($#file_rev - 1) );
+
+ $indx = 0;
+ while( $indx <= $#branch_rev ) {
+ if ( $branch_rev[$indx] != $file_rev[$indx] ) {
+ return 0;
+ }
+ $indx++;
+ }
+
+ return 1;
+}
+
+