/usr/share/doc/librcs-perl/examples/daterev.pl is in librcs-perl 1.05-4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/local/bin/perl -w
#------------------------------------------
# Test daterev method
#------------------------------------------
use strict;
use Time::Local;
use lib '.';
use Rcs;
Rcs->bindir('/usr/bin');
my $obj = Rcs->new;
$obj->rcsdir("./project/RCS");
$obj->workdir("./project/src");
$obj->file("testfile");
my @date_array = @ARGV;
my($year, $mon, $mday, $hour, $min, $sec) = @date_array;
$mon--; # convert to 0-11 range
my $target_time = timegm($sec, $min, $hour, $mday, $mon, $year);
print "Called as 6 argument method\n";
# scalar mode
my $revision = $obj->daterev(@date_array);
my $date_str = gmtime($obj->revdate($revision));
print "Date : Revision = $date_str : $revision\n\n";
# list mode
print "List mode\n";
my @revisions = $obj->daterev(@date_array);
foreach (@revisions) {
$date_str = gmtime($obj->revdate($_));
print "Date : Revision = $date_str : $_\n";
}
print "\n\n\n";
print "Called as 1 argument method\n";
print "Time number is $target_time\n";
$revision = $obj->daterev($target_time);
$date_str = gmtime($obj->revdate($revision));
print "Date : Revision = $date_str : $revision\n\n";
# list mode
print "List mode\n";
@revisions = $obj->daterev($target_time);
foreach (@revisions) {
$date_str = gmtime($obj->revdate($_));
print "Date : Revision = $date_str : $_\n";
}
|