| 6887 |
dpurdie |
1 |
########################################################################
|
|
|
2 |
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
|
|
|
3 |
#
|
|
|
4 |
# Module name : cc2svn_updaterm.pl
|
|
|
5 |
# Module type : Makefile system
|
|
|
6 |
# Compiler(s) : Perl
|
|
|
7 |
# Environment(s): jats
|
|
|
8 |
#
|
|
|
9 |
# Description : Show dirs that have been relabled
|
|
|
10 |
#
|
|
|
11 |
# Usage:
|
|
|
12 |
#
|
|
|
13 |
# Version Who Date Description
|
|
|
14 |
#
|
|
|
15 |
#......................................................................#
|
|
|
16 |
|
|
|
17 |
require 5.008_002;
|
|
|
18 |
use strict;
|
|
|
19 |
use warnings;
|
|
|
20 |
|
|
|
21 |
use Pod::Usage;
|
|
|
22 |
use Getopt::Long;
|
|
|
23 |
|
|
|
24 |
use JatsError;
|
|
|
25 |
|
|
|
26 |
#
|
|
|
27 |
# Globals
|
|
|
28 |
#
|
|
|
29 |
my $VERSION = "1.0.0"; # Update this
|
|
|
30 |
my %pkgInfo;
|
|
|
31 |
#
|
|
|
32 |
# Options
|
|
|
33 |
#
|
|
|
34 |
my $opt_verbose = 0;
|
|
|
35 |
my $opt_help = 0;
|
|
|
36 |
my $opt_package;
|
|
|
37 |
|
|
|
38 |
#-------------------------------------------------------------------------------
|
|
|
39 |
# Function : Main Entry
|
|
|
40 |
#
|
|
|
41 |
# Description :
|
|
|
42 |
#
|
|
|
43 |
# Inputs :
|
|
|
44 |
#
|
|
|
45 |
# Returns :
|
|
|
46 |
#
|
|
|
47 |
my $result = GetOptions (
|
|
|
48 |
"help+" => \$opt_help, # flag, multiple use allowed
|
|
|
49 |
"manual:3" => \$opt_help,
|
|
|
50 |
"verbose:+" => \$opt_verbose, # flag
|
|
|
51 |
'package:s' => \$opt_package,
|
|
|
52 |
);
|
|
|
53 |
|
|
|
54 |
#
|
|
|
55 |
# Process help and manual options
|
|
|
56 |
#
|
|
|
57 |
pod2usage(-verbose => 0, -message => "Version: $VERSION") if ($opt_help == 1 || ! $result);
|
|
|
58 |
pod2usage(-verbose => 1) if ($opt_help == 2);
|
|
|
59 |
pod2usage(-verbose => 2) if ($opt_help > 2);
|
|
|
60 |
|
|
|
61 |
ErrorConfig( 'name' =>'CC2SVN_SHOWL',
|
|
|
62 |
'verbose' => $opt_verbose,
|
|
|
63 |
);
|
|
|
64 |
|
|
|
65 |
Error ("Must specify a package name") unless ( defined $opt_package || $#ARGV >= 0 );
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
foreach my $fileName ( $opt_package, @ARGV )
|
|
|
69 |
{
|
|
|
70 |
next unless ( defined $fileName );
|
|
|
71 |
next if ( $fileName eq 'Dataman' );
|
|
|
72 |
|
|
|
73 |
$fileName =~ s~\.data$~~;
|
|
|
74 |
$fileName =~ s~\.svg$~~;
|
|
|
75 |
$fileName =~ s~\.importlog$~~;
|
|
|
76 |
readPackageDataFile($fileName);
|
|
|
77 |
|
|
|
78 |
foreach my $packageName( sort keys %pkgInfo )
|
|
|
79 |
{
|
|
|
80 |
processPackage($packageName);
|
|
|
81 |
}
|
|
|
82 |
}
|
|
|
83 |
exit 0;
|
|
|
84 |
|
|
|
85 |
#-------------------------------------------------------------------------------
|
|
|
86 |
# Function : readPackageDataFile
|
|
|
87 |
#
|
|
|
88 |
# Description : Read in the data file. It may contain data for more
|
|
|
89 |
# than one package - but this is rare
|
|
|
90 |
#
|
|
|
91 |
# Inputs :
|
|
|
92 |
#
|
|
|
93 |
# Returns : Fills in %pkgInfo
|
|
|
94 |
#
|
|
|
95 |
#
|
|
|
96 |
our %ScmVersions;
|
|
|
97 |
sub readPackageDataFile
|
|
|
98 |
{
|
|
|
99 |
%pkgInfo = ();
|
|
|
100 |
my ($pname) = @_;
|
|
|
101 |
my $fname = $pname . '.data';
|
|
|
102 |
Verbose2 ('Reading Package Data: ' . $fname);
|
|
|
103 |
return unless ( -f $fname );
|
|
|
104 |
Error "Cannot locate $fname" unless ( -f $fname );
|
|
|
105 |
%ScmVersions = ();
|
|
|
106 |
require $fname;
|
|
|
107 |
|
|
|
108 |
Error "Data in $fname is not valid\n"
|
|
|
109 |
unless ( keys(%ScmVersions) >= 0 );
|
|
|
110 |
|
|
|
111 |
foreach (keys %ScmVersions)
|
|
|
112 |
{
|
|
|
113 |
my $entry = $ScmVersions{$_};
|
|
|
114 |
$pkgInfo{$entry->{name}}{$_} = $entry;
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
%ScmVersions = ();
|
|
|
118 |
}
|
|
|
119 |
|
|
|
120 |
#-------------------------------------------------------------------------------
|
|
|
121 |
# Function : processPackage
|
|
|
122 |
#
|
|
|
123 |
# Description : Process data for one package
|
|
|
124 |
#
|
|
|
125 |
# Inputs : Name of the package
|
|
|
126 |
#
|
|
|
127 |
# Returns :
|
|
|
128 |
#
|
|
|
129 |
sub processPackage
|
|
|
130 |
{
|
|
|
131 |
my ($pname) = @_;
|
|
|
132 |
Error ("Internal: Hash data not found")
|
|
|
133 |
unless ( exists $pkgInfo{$pname});
|
|
|
134 |
my $pkgData = $pkgInfo{$pname};
|
|
|
135 |
|
|
|
136 |
foreach (sort {$a <=> $b} keys(%{$pkgInfo{$pname}} ) )
|
|
|
137 |
{
|
|
|
138 |
my $pkgEntry = $pkgInfo{$pname}{$_};
|
|
|
139 |
|
|
|
140 |
if ( exists $pkgEntry->{data}{DirsLabled} )
|
|
|
141 |
{
|
|
|
142 |
next if ( $pkgEntry->{data}{DirsLabled} == 100 );
|
|
|
143 |
#print "$pname: ",$pkgEntry->{vname},", ",$pkgEntry->{data}{DirsLabled},", ", $pkgEntry->{data}{ViewRoot},"\n";
|
|
|
144 |
print $pkgEntry->{data}{ViewRoot},"\n";
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
}
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
|
|
|
151 |
#-------------------------------------------------------------------------------
|
|
|
152 |
# Documentation
|
|
|
153 |
#
|
|
|
154 |
|
|
|
155 |
=pod
|
|
|
156 |
|
|
|
157 |
=for htmltoc SYSUTIL::cc2svn::
|
|
|
158 |
|
|
|
159 |
=head1 NAME
|
|
|
160 |
|
|
|
161 |
cc2svn_show_relabled - Show packages that were relabled
|
|
|
162 |
|
|
|
163 |
=head1 SYNOPSIS
|
|
|
164 |
|
|
|
165 |
jats cc2svn_updaterm [options] [PackageName]*
|
|
|
166 |
|
|
|
167 |
Options:
|
|
|
168 |
-help - brief help message
|
|
|
169 |
-help -help - Detailed help message
|
|
|
170 |
-man - Full documentation
|
|
|
171 |
-verbose - Enable verbosity
|
|
|
172 |
-package=name - Specify single package to be processed
|
|
|
173 |
|
|
|
174 |
=head1 OPTIONS
|
|
|
175 |
|
|
|
176 |
=over 8
|
|
|
177 |
|
|
|
178 |
=item B<-help>
|
|
|
179 |
|
|
|
180 |
Print a brief help message and exits.
|
|
|
181 |
|
|
|
182 |
=item B<-help -help>
|
|
|
183 |
|
|
|
184 |
Print a detailed help message with an explanation for each option.
|
|
|
185 |
|
|
|
186 |
=item B<-man>
|
|
|
187 |
|
|
|
188 |
Prints the manual page and exits.
|
|
|
189 |
|
|
|
190 |
=item B<-[no]test>
|
|
|
191 |
|
|
|
192 |
Invoke the program in test mode. This is the default.
|
|
|
193 |
|
|
|
194 |
In test mode the program will examine each packages 'data' results file
|
|
|
195 |
and report status and errors.
|
|
|
196 |
|
|
|
197 |
In 'notest' the program will update the Release Manager database.
|
|
|
198 |
|
|
|
199 |
=item B<-[no]live>
|
|
|
200 |
|
|
|
201 |
Invoke the program in live-database mode. This is the NOT the default.
|
|
|
202 |
|
|
|
203 |
In live mode the program will access the Live Release Manager database.
|
|
|
204 |
|
|
|
205 |
In non-live mode the program will access the test (RELMANU1) database
|
|
|
206 |
|
|
|
207 |
=item B<-package=name>
|
|
|
208 |
|
|
|
209 |
This option will name one package to be processed. Packages to be
|
|
|
210 |
processed can just be named on the command line.
|
|
|
211 |
|
|
|
212 |
=item B<-database=name>
|
|
|
213 |
|
|
|
214 |
This option specifies the target database. The default value is 'RELMANU1'.
|
|
|
215 |
This is a test database.
|
|
|
216 |
|
|
|
217 |
The production database is RELEASEM.
|
|
|
218 |
|
|
|
219 |
The user must specifically specify the database to update the production system.
|
|
|
220 |
|
|
|
221 |
=item B<-[no]force>
|
|
|
222 |
|
|
|
223 |
This option will force the Release Manager entries to be updated - even if the
|
|
|
224 |
current entry matches the desired result.
|
|
|
225 |
|
|
|
226 |
Useful in testing.
|
|
|
227 |
|
|
|
228 |
=item B<-check=string>
|
|
|
229 |
|
|
|
230 |
This option will pass a string directly to the Release Manager updating proceedure.
|
|
|
231 |
|
|
|
232 |
With this option no packages will be examined or processed.
|
|
|
233 |
|
|
|
234 |
It is only useful for testing.
|
|
|
235 |
|
|
|
236 |
=back
|
|
|
237 |
|
|
|
238 |
=head1 DESCRIPTION
|
|
|
239 |
|
|
|
240 |
This program is a tool used in the conversion of ClearCase VOBS to subversion.
|
|
|
241 |
It will:
|
|
|
242 |
|
|
|
243 |
=over 8
|
|
|
244 |
|
|
|
245 |
=item *
|
|
|
246 |
|
|
|
247 |
Process all packages named on the command line or with the -package option.
|
|
|
248 |
|
|
|
249 |
=item *
|
|
|
250 |
|
|
|
251 |
Examine the packages '.data' file, whcih is created as the package is inserted
|
|
|
252 |
into Subversion.
|
|
|
253 |
|
|
|
254 |
=item *
|
|
|
255 |
|
|
|
256 |
Report the status of the package import and highlight issues.
|
|
|
257 |
|
|
|
258 |
=item *
|
|
|
259 |
|
|
|
260 |
Read the Release Manager entry and ensure that the entry is not the same.
|
|
|
261 |
If the entry is the same then it will not be updated, unless the '-force'
|
|
|
262 |
option has been used.
|
|
|
263 |
|
|
|
264 |
=item *
|
|
|
265 |
|
|
|
266 |
Insert the new Version Control information into the Release Manager entry.
|
|
|
267 |
|
|
|
268 |
=back
|
|
|
269 |
|
|
|
270 |
The default operation of this utility is to test the import process. The
|
|
|
271 |
user needs to provide specific options in order to update the production
|
|
|
272 |
database. This is intentional.
|
|
|
273 |
|
|
|
274 |
=cut
|
|
|
275 |
|