forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctco
More file actions
69 lines (58 loc) · 1.6 KB
/
ctco
File metadata and controls
69 lines (58 loc) · 1.6 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/perl
sub CTCoUsage {
print STDERR "Usage: ctco [-c \"comment\"] [-nc] element-name [...]\n" ;
print STDERR "Options:\n" ;
print STDERR " -c \"comment\" : provide a comment about this action\n" ;
print STDERR " -nc : expect no comment on this action\n" ;
exit;
}
if ( $#ARGV < 0 ) {
&CTCoUsage ;
}
$tool = $ENV{"DTOOL"} ;
if ( $tool eq "" ) {
die "Environment not configured for CTtools" ;
}
require "$tool/built/include/ctutils.pl" ;
require "$tool/built/include/ctvspec.pl" ;
require "$tool/built/include/ctquery.pl" ;
require "$tool/built/include/ctproj.pl" ;
require "$tool/built/include/ctcm.pl" ;
$comment = "" ;
$skip = 0 ;
@files = () ;
foreach $item ( @ARGV ) {
if ( $skip == 0 ) {
if ( $item eq "-nc" ) {
&CTUDebug( "-nc processed\n" ) ;
} elsif ( $item eq "-c" ) {
$skip = 1 ;
} else {
push( @files, $item ) ;
&CTUDebug( "added '" . $item . "' to files to be processed\n" ) ;
}
} elsif ( $skip == 1 ) {
$comment = $item ;
&CTUDebug( "setting comment to '" . $comment . "'\n" ) ;
$skip = 0 ;
} else {
&CTUDebug( "got to unknown skip value! (" . $skip . ")\n" ) ;
$skip = 0 ;
}
}
if ( $#files < 0 ) {
&CTCoUsage ;
}
$projname = &CTProj ;
$projname =~ tr/A-Z/a-z/ ;
$flav = &CTQueryProj( $projname ) ;
$spec = &CTResolveSpec( $projname, $flav ) ;
foreach $item ( @files ) {
if ( -e $item ) {
if ( ! &CTCMCheckout( $item, $projname, $spec, $comment ) ) {
print STDERR "Could not checkout '$item'\n" ;
}
} else {
print STDERR "No such file '$item'.\n" ;
}
}