1 |
#!/usr/bin/perl |
#!/usr/bin/perl |
2 |
|
|
3 |
|
# synccvs - checkout / update from cvs made easy |
4 |
|
# $Id$ |
5 |
|
|
6 |
use strict; |
use strict; |
7 |
use warnings; |
use warnings; |
8 |
|
|
9 |
use lib qw( /data/libs/nfo/perl/libs ); |
my $cvs = '/usr/bin/cvs -q'; |
10 |
use org::netfrag::shortcuts qw( run_cmd ); |
my $CVSROOT = '/var/lib/cvs'; |
11 |
|
|
12 |
sub synccvs { |
sub synccvs { |
13 |
my $which = shift; |
my $which = shift; |
23 |
$exists_name = "$name/$exists_name" if $name; |
$exists_name = "$name/$exists_name" if $name; |
24 |
if (! -e $exists_name || ($option && $option eq 'checkout')) { |
if (! -e $exists_name || ($option && $option eq 'checkout')) { |
25 |
$cvscmd = 'checkout'; |
$cvscmd = 'checkout'; |
26 |
$shellcmd = "cvs -d /var/lib/cvs $cvscmd -d $name $which"; |
$shellcmd = "$cvs -d $CVSROOT $cvscmd -d $name $which"; |
27 |
} else { |
} else { |
28 |
$cvscmd = 'update'; |
$cvscmd = 'update'; |
29 |
$shellcmd = "cvs -d /var/lib/cvs $cvscmd $name"; |
$shellcmd = "$cvs -d $CVSROOT $cvscmd -d $name"; |
30 |
} |
} |
31 |
return if !$shellcmd; |
return if !$shellcmd; |
32 |
#print "cmd: $shellcmd", "\n"; |
#print "cmd: $shellcmd", "\n"; |
33 |
run_cmd($shellcmd); |
system($shellcmd); |
34 |
} |
} |
35 |
|
|
36 |
synccvs(shift, shift, shift); |
synccvs(shift, shift, shift); |