summaryrefslogtreecommitdiff
path: root/scripts/cvslastchange
authorllornkcor <llornkcor>2005-08-12 01:48:55 (UTC)
committer llornkcor <llornkcor>2005-08-12 01:48:55 (UTC)
commita1b3e5bac75575be3e22b7361d7a4820761403c1 (patch) (side-by-side diff)
tree26cbeaf4a4bf8d36f450c84bf23a4a537ecca0ec /scripts/cvslastchange
parentf0790abc938501893be9b6fdaf49d7009ac9c11f (diff)
downloadopie-a1b3e5bac75575be3e22b7361d7a4820761403c1.zip
opie-a1b3e5bac75575be3e22b7361d7a4820761403c1.tar.gz
opie-a1b3e5bac75575be3e22b7361d7a4820761403c1.tar.bz2
fix with import from kdescripts
Diffstat (limited to 'scripts/cvslastchange') (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/cvslastchange161
1 files changed, 150 insertions, 11 deletions
diff --git a/scripts/cvslastchange b/scripts/cvslastchange
index ca77297..4c0e37a 100644
--- a/scripts/cvslastchange
+++ b/scripts/cvslastchange
@@ -1,2 +1,2 @@
-#!/usr/bin/perl
+!/usr/bin/perl
@@ -4,8 +4,141 @@ use File::Basename;
-die "need a filename!" if (!length($ARGV[0]));
+sub usage()
+{
+ print "Usage:\n";
+ print " $0 [ <filename > | <filename> <rev> | \n" .
+ " M +<digits> -<digits> <filename <rev> ]\n";
+ print "\n";
+
+ exit 5;
+}
+
+my $filename;
+
+my $argc = scalar @ARGV;
+
+if ($argc > 0 and $argc < 3 ) {
+ $filename = $ARGV[0];
+ $cvsversion= dirname($0) . "/cvsversion";
+ $version=`$cvsversion $filename`;
+ chomp $version;
+ $version=$ARGV[1] if ($argc > 1 and $ARGV[1] =~ /^[\d\.]{3,}$/);
+} elsif ($argc == 5) {
+ $filename=$ARGV[3] if (-f $ARGV[3]);
+ $version=$ARGV[4] if ($ARGV[4] =~ /^[\d\.]{3,}$/);
+} else {
+ &usage();
+}
+
+die "$0: filename expected" if(!length($filename));
+die "$filename: $!\n" if (! -f $filename);
+
+my $vold = $version;
+my $vnew = $version;
+
+if ($version=~/^.*\.1$/) {
+ $vold = $1 if ($version=~/^(\d+\.\d+(?:\.\d+\.\d+)*)\.\d+\.1$/);
+}
+else {
+ if ($version=~/^(.*)\.([^.]*)$/) { $v1 = $1; $v2 = $2 }
+ $v2old = ${v2}-1;
+ $vold = $v1 . '.' . $v2old;
+}
+my $base = basename($filename);
+my $dir = dirname($filename);
+my $cmd = "cd $dir; cvs -f log -N -r$vnew $base";
+print "$cmd\n";
+system("$cmd");
+my $whitespace = "";
+$whitespace = "-b" unless (defined $ENV{"CVSLASTCHANGE_KEEP_WHITESPACE"});
+$cmd = "cd $dir; cvs -f diff -kk $whitespace -p -u -r$vold -r$vnew $base";
+print "$cmd\n";
+!/usr/bin/perl
+
+use File::Basename;
+
+sub usage()
+{
+ print "Usage:\n";
+ print " $0 [ <filename > | <filename> <rev> | \n" .
+ " M +<digits> -<digits> <filename <rev> ]\n";
+ print "\n";
+
+ exit 5;
+}
+
+my $filename;
+
+my $argc = scalar @ARGV;
+
+if ($argc > 0 and $argc < 3 ) {
+ $filename = $ARGV[0];
+ $cvsversion= dirname($0) . "/cvsversion";
+ $version=`$cvsversion $filename`;
+ chomp $version;
+ $version=$ARGV[1] if ($argc > 1 and $ARGV[1] =~ /^[\d\.]{3,}$/);
+} elsif ($argc == 5) {
+ $filename=$ARGV[3] if (-f $ARGV[3]);
+ $version=$ARGV[4] if ($ARGV[4] =~ /^[\d\.]{3,}$/);
+} else {
+ &usage();
+}
+
+die "$0: filename expected" if(!length($filename));
+die "$filename: $!\n" if (! -f $filename);
+
+my $vold = $version;
+my $vnew = $version;
+
+if ($version=~/^.*\.1$/) {
+ $vold = $1 if ($version=~/^(\d+\.\d+(?:\.\d+\.\d+)*)\.\d+\.1$/);
+}
+else {
+ if ($version=~/^(.*)\.([^.]*)$/) { $v1 = $1; $v2 = $2 }
+ $v2old = ${v2}-1;
+ $vold = $v1 . '.' . $v2old;
+}
+my $base = basename($filename);
+my $dir = dirname($filename);
+my $cmd = "cd $dir; cvs -f log -N -r$vnew $base";
+print "$cmd\n";
+system("$cmd");
+my $whitespace = "";
+$whitespace = "-b" unless (defined $ENV{"CVSLASTCHANGE_KEEP_WHITESPACE"});
+$cmd = "cd $dir; cvs -f diff -kk $whitespace -p -u -r$vold -r$vnew $base";
+print "$cmd\n";
+sy
+!/usr/bin/perl
+
+use File::Basename;
+
+sub usage()
+{
+ print "Usage:\n";
+ print " $0 [ <filename > | <filename> <rev> | \n" .
+ " M +<digits> -<digits> <filename <rev> ]\n";
+ print "\n";
+
+ exit 5;
+}
+
+my $filename;
+
+my $argc = scalar @ARGV;
+
+if ($argc > 0 and $argc < 3 ) {
+ $filename = $ARGV[0];
+ $cvsversion= dirname($0) . "/cvsversion";
+ $version=`$cvsversion $filename`;
+ chomp $version;
+ $version=$ARGV[1] if ($argc > 1 and $ARGV[1] =~ /^[\d\.]{3,}$/);
+} elsif ($argc == 5) {
+ $filename=$ARGV[3] if (-f $ARGV[3]);
+ $version=$ARGV[4] if ($ARGV[4] =~ /^[\d\.]{3,}$/);
+} else {
+ &usage();
+}
-$cvsversion= dirname($0) . "/cvsversion";
-$version=`$cvsversion $ARGV[0]`;
+die "$0: filename expected" if(!length($filename));
+die "$filename: $!\n" if (! -f $filename);
-chop $version;
my $vold = $version;
@@ -13,4 +146,4 @@ my $vnew = $version;
-if ($version=~/^(.*)\.1$/) {
- $vold = $1 if ($version=~/^([^.]\.[^.])\.[^.]\.[^.]$/);
+if ($version=~/^.*\.1$/) {
+ $vold = $1 if ($version=~/^(\d+\.\d+(?:\.\d+\.\d+)*)\.\d+\.1$/);
}
@@ -21,5 +154,11 @@ else {
}
-print "cvs -f log -N -r$vnew $ARGV[0]\n";
-system("cvs -f log -N -r$vnew $ARGV[0]");
-print "cvs -f diff -bp -u -r$vold -r$vnew $ARGV[0]\n";
-system("cvs -f diff -bp -u -r$vold -r$vnew $ARGV[0]");
+my $base = basename($filename);
+my $dir = dirname($filename);
+my $cmd = "cd $dir; cvs -f log -N -r$vnew $base";
+print "$cmd\n";
+system("$cmd");
+my $whitespace = "";
+$whitespace = "-b" unless (defined $ENV{"CVSLASTCHANGE_KEEP_WHITESPACE"});
+$cmd = "cd $dir; cvs -f diff -kk $whitespace -p -u -r$vold -r$vnew $base";
+print "$cmd\n";
+system("$cmd");