File: parse.pl

package info (click to toggle)
librcs-perl 1.05-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 476 kB
  • sloc: perl: 1,399; makefile: 2
file content (38 lines) | stat: -rwxr-xr-x 831 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -w
#------------------------------------------
# Parse RCS archive file.
#------------------------------------------
use strict;
use Rcs;

Rcs->bindir('/usr/bin');
my $obj = Rcs->new;

$obj->rcsdir("./project/RCS");
$obj->workdir("./project/src");
$obj->file("testfile");

my $head_rev = $obj->head;
my $locker = $obj->lock;
my $author = $obj->author;
my @access = $obj->access;
my @revisions = $obj->revisions;

my $filename = $obj->file;

if ($locker) {
    print "Head revision $head_rev is locked by $locker\n";
}
else {
    print "Head revision $head_rev is unlocked\n";
}

if (@access) {
    print "\nThe following users are on the access list of file $filename\n";
    map { print "User: $_\n"} @access;
}

print "\nList of all revisions of $filename\n";
foreach (@revisions) {
    print "Revision: $_\n";
}