forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctattachcc
More file actions
executable file
·86 lines (80 loc) · 3.16 KB
/
ctattachcc
File metadata and controls
executable file
·86 lines (80 loc) · 3.16 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/perl
if ( $#ARGV != 5 ) {
print STDERR "This is for internal use by attach ONLY\n" ;
exit ;
}
$root = $ARGV[0] ;
$view = $ARGV[1] ;
$branch = $ARGV[2] ;
$label = $ARGV[3] ;
$vobname = $ARGV[4] ;
$proj = $ARGV[5] ;
$tmpname = "/tmp/config.$$" ;
$emitted = 0 ;
$ctdebug = $ENV{"CTATTACH_DEBUG"} ;
if ($ctdebug) {
print STDERR "Params:\n 0: '$root'\n 1: '$view'\n 2: '$branch'\n" ;
print STDERR " 3: '$label'\n 4: '$vobname'\n 5: '$proj'\n" ;
print STDERR "making branch and label types for view " . $view . "\n" ;
print STDERR "executing: /usr/atria/bin/cleartool mkbrtype -vob /vobs/$vobname -c \"Branch type for the $view view\" $branch 2> /dev/null > /dev/null\n" ;
print STDERR "executing: /usr/atria/bin/cleartool mklbtype -vob /vobs/$vobname -c \"Label type for the $view view\" $label 2> /dev/null > /dev/null\n" ;
}
system "/usr/atria/bin/cleartool mkbrtype -vob /vobs/$vobname -c \"Branch type for the $view view\" $branch 2> /dev/null > /dev/null\n" ;
system "/usr/atria/bin/cleartool mklbtype -vob /vobs/$vobname -c \"Label type for the $view view\" $label 2> /dev/null > /dev/null\n" ;
if ($ctdebug) {
print STDERR "creating/updating the config-spec for view " . $view . "\n" ;
}
open( CTINTERFACE, "/usr/atria/bin/cleartool catcs -tag $view |" ) ;
open( TMPFILE, "> $tmpname" ) ;
while ( <CTINTERFACE> ) {
if ( $_ =~ "CHECKEDOUT" ) {
if ($ctdebug) {
print STDERR "case 1:\noutputting: '$_'\n" ;
}
print TMPFILE "$_" ;
} elsif (( $_ =~ /^element \*/ ) && ( $_ =~ "/main/LATEST" ) &&
!( $_ =~ /\/$proj\// )) {
if ( ! $emitted ) {
$emitted = 1 ;
print TMPFILE "element $root/... .../$branch/LATEST\n" ;
print TMPFILE "element $root/... $label -mkbranch $branch\n" ;
print TMPFILE "element $root/... /main/LATEST -mkbranch $branch\n" ;
if ($ctdebug) {
print STDERR "case 2:\n" ;
print STDERR "outputting: 'element $root/... .../$branch/LATEST'\n" ;
print STDERR "outputting: 'element $root/... $label -mkbranch $branch'\n" ;
print STDERR "outputting: 'element $root/... /main/LATEST -mkbranch $branch'\n" ;
}
}
if ($ctdebug) {
print STDERR "case 3:\n" ;
print STDERR "outputting: '$_'\n" ;
}
print TMPFILE "$_" ;
} elsif ( $_ =~ /\/$proj\// ) {
if ( ! $emitted ) {
$emitted = 1 ;
print TMPFILE "element $root/... .../$branch/LATEST\n" ;
print TMPFILE "element $root/... $label -mkbranch $branch\n" ;
print TMPFILE "element $root/... /main/LATEST -mkbranch $branch\n" ;
if ($ctdebug) {
print STDERR "case 4:\n" ;
print STDERR "outputting: 'element $root/... .../$branch/LATEST'\n" ;
print STDERR "outputting: 'element $root/... $label -mkbranch $branch'\n" ;
print STDERR "outputting: 'element $root/... /main/LATEST -mkbranch $branch'\n" ;
}
}
} else {
if ($ctdebug) {
print STDERR "case 5:\n" ;
print STDERR "outputting: '$_'\n" ;
}
print TMPFILE "$_" ;
}
}
close( CTINTERFACE ) ;
close( TMPFILE ) ;
if ($ctdebug) {
print STDERR "output to execute: '/usr/atria/bin/cleartool setcs -tag $view $tmpname ; rm $tmpname'\n" ;
}
system "/usr/atria/bin/cleartool setcs -tag $view $tmpname ; rm $tmpname\n" ;