/[cvs]/nfo/bash/synccvs
ViewVC logotype

Contents of /nfo/bash/synccvs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Sun Nov 7 02:36:33 2004 UTC (20 years, 1 month ago) by bd
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +8 -5 lines
- made independent of additional libraries
+ added configuration variables
+ added header

1 #!/usr/bin/perl
2
3 # synccvs - checkout / update from cvs made easy
4 # $Id$
5
6 use strict;
7 use warnings;
8
9 my $cvs = '/usr/bin/cvs -q';
10 my $CVSROOT = '/var/lib/cvs';
11
12 sub synccvs {
13 my $which = shift;
14 my $name = shift;
15 my $option = shift;
16
17 $which =~ m/^.*\/(.+?)$/;
18 $name ||= $1;
19
20 my $shellcmd;
21 my $cvscmd;
22 my $exists_name = "CVS";
23 $exists_name = "$name/$exists_name" if $name;
24 if (! -e $exists_name || ($option && $option eq 'checkout')) {
25 $cvscmd = 'checkout';
26 $shellcmd = "$cvs -d $CVSROOT $cvscmd -d $name $which";
27 } else {
28 $cvscmd = 'update';
29 $shellcmd = "$cvs -d $CVSROOT $cvscmd -d $name";
30 }
31 return if !$shellcmd;
32 #print "cmd: $shellcmd", "\n";
33 system($shellcmd);
34 }
35
36 synccvs(shift, shift, shift);
37
38 1;

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed