Subversion Repositories DevTools

Rev

Rev 6177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6177 Rev 7447
Line 140... Line 140...
140
#
140
#
141
#   Sanity test
141
#   Sanity test
142
#
142
#
143
unless ( $opt_rtag_id || $opt_sbom_id || $opt_extract || $#ARGV >= 1)
143
unless ( $opt_rtag_id || $opt_sbom_id || $opt_extract || $#ARGV >= 1)
144
{
144
{
145
    Error ("Need sbomid and/or rtagid, or -extract",
145
    Error ("Need -sbomid, -rtagid, Package Verion or -extract",
146
           "Example: -sbomid=13543, for NZS Phase-1",
146
           "Example: -sbomid=13543, for NZS Phase-1",
147
           "Example: -sbomid=13543 -rtagid=xxxx, for NZS Phase-1, compared against given release",
147
           "Example: -sbomid=13543 -rtagid=xxxx, for NZS Phase-1, compared against given release",
148
           "Example: -rtagid=2362, for Sydney R1/R2",
148
           "Example: -rtagid=2362, for Sydney R1/R2",
149
           "Example: -rtagid=8843 -root=StockholmSBOM",
149
           "Example: -rtagid=8843 -root=StockholmSBOM",
150
           "Example: PackageName PackageVersion, for extracting a single package",
150
           "Example: PackageName PackageVersion, for extracting a single package",
-
 
151
           "Example: -extract=release_extract.txt, for perform source code extraction",
-
 
152
           "See jats escrow -man for full details"
151
    )
153
    )
152
}
154
}
153
if ($opt_skim && ! $opt_rtag_id)
155
if ($opt_skim && ! $opt_rtag_id)
154
{
156
{
155
    Error ("The skim option only operates with the rtagid option");
157
    Error ("The skim option only operates with the rtagid option");
156
}
158
}
157
 
159
 
-
 
160
if ($opt_sbom_id && $opt_sbom_id !~ m/^[0-9]$/  ) {
-
 
161
    Error ("sbom_id is not Numeric: $opt_sbom_id");
-
 
162
}
-
 
163
if ($opt_rtag_id && $opt_rtag_id !~ m/^[0-9]$/  ) {
-
 
164
    Error ("rtag_id is not Numeric: $opt_rtag_id");
-
 
165
}
-
 
166
 
158
#
167
#
159
#   The extract option is special
168
#   The extract option is special
160
#   It places the progam in a different mode
169
#   It places the progam in a different mode
161
#
170
#
162
if ( $opt_extract )
171
if ( $opt_extract )
Line 169... Line 178...
169
 
178
 
170
    extract_files();
179
    extract_files();
171
    exit (0);
180
    exit (0);
172
}
181
}
173
 
182
 
174
Warning ("No sbomid provided. Output based an a Release") unless ( $opt_sbom_id );
-
 
175
$dm_base =~ s~BOMID~$opt_sbom_id~ if ($opt_sbom_id);
183
$dm_base =~ s~BOMID~$opt_sbom_id~ if ($opt_sbom_id);
176
$fpref = "release" unless ( $opt_sbom_id );
184
$fpref = "release" unless ( $opt_sbom_id );
177
 
185
 
178
#
186
#
179
#   Import essential EnvVars
187
#   Import essential EnvVars
Line 222... Line 230...
222
        getPkgDetailsByRTAG_ID( $opt_rtag_id );
230
        getPkgDetailsByRTAG_ID( $opt_rtag_id );
223
    }
231
    }
224
}
232
}
225
elsif ( $opt_rtag_id )
233
elsif ( $opt_rtag_id )
226
{
234
{
-
 
235
    Warning ("No sbomid provided. Output based an a Release");
227
    getPkgDetailsByRTAG_ID( $opt_rtag_id );
236
    getPkgDetailsByRTAG_ID( $opt_rtag_id );
228
    if ( $opt_rootpkg )
237
    if ( $opt_rootpkg )
229
    {
238
    {
230
        #
239
        #
231
        #   Base the report on a single package in a release
240
        #   Base the report on a single package in a release
Line 245... Line 254...
245
    }
254
    }
246
    LocateStrays(1) unless $opt_skim;
255
    LocateStrays(1) unless $opt_skim;
247
}
256
}
248
elsif ( $#ARGV >= 1 )
257
elsif ( $#ARGV >= 1 )
249
{
258
{
-
 
259
    Warning ("No sbomid provided. Output based an single package version");
250
    #
260
    #
251
    #   Locate package and dependents
261
    #   Locate package and dependents
252
    #   Convert package name into a PVID
262
    #   Convert package name into a PVID
253
    #
263
    #
254
    my $pv_id = getPkgDetailsByName( @ARGV );
264
    my $pv_id = getPkgDetailsByName( @ARGV );
Line 2136... Line 2146...
2136
 
2146
 
2137
Create a log file showing packages that could not be extracted.
2147
Create a log file showing packages that could not be extracted.
2138
 
2148
 
2139
=back
2149
=back
2140
 
2150
 
-
 
2151
=head1 EXAMPLE
-
 
2152
 
-
 
2153
The following command will generate a 'Full Escrow' - based on an sbom_id
-
 
2154
 
-
 
2155
    jats escrow -sbom=1234
-
 
2156
 
-
 
2157
The following command will generate a 'Release Escrow' - based on an rtag_id
-
 
2158
 
-
 
2159
    jats escrow -rtagid=19083
-
 
2160
 
-
 
2161
The following command will generate a 'Single Package' - based one one package
-
 
2162
 
-
 
2163
     jats escrow crc 26.11.1000.cr
-
 
2164
 
-
 
2165
The following command will take a file generated by a Full/Release/Single package escrow
-
 
2166
extraction and actually extract the source code.
-
 
2167
 
-
 
2168
    jats escrow -extact=release_extract.txt
-
 
2169
 
2141
=cut
2170
=cut
2142
 
2171