Subversion Repositories DevTools

Rev

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

Rev 233 Rev 235
Line 138... Line 138...
138
{
138
{
139
    Error ("Need sbomid and/or rtagid, or -extract",
139
    Error ("Need sbomid and/or rtagid, or -extract",
140
           "Example: -sbomid=13543, for NZS Phase-1",
140
           "Example: -sbomid=13543, for NZS Phase-1",
141
           "Example: -sbomid=13543 -rtagid=xxxx, for NZS Phase-1, comapred against given release",
141
           "Example: -sbomid=13543 -rtagid=xxxx, for NZS Phase-1, comapred against given release",
142
           "Example: -rtagid=2362, for Sydney R1/R2",
142
           "Example: -rtagid=2362, for Sydney R1/R2",
143
           "Example: -rtagid=8384 -root=StockholmSBOM",
143
           "Example: -rtagid=8843 -root=StockholmSBOM",
144
 
144
 
145
    )
145
    )
146
}
146
}
147
 
147
 
148
#
148
#
Line 1418... Line 1418...
1418
#-------------------------------------------------------------------------------
1418
#-------------------------------------------------------------------------------
1419
# Function        : extract_files
1419
# Function        : extract_files
1420
#
1420
#
1421
# Description     : Alternate mode of operation
1421
# Description     : Alternate mode of operation
1422
#                   Extract files from the generated list. This is intended to
1422
#                   Extract files from the generated list. This is intended to
1423
#                   be run as a sperate phase taking the 'extract' file
1423
#                   be run as a seperate phase taking the 'extract' file
1424
#
1424
#
1425
# Inputs          :
1425
# Inputs          :
1426
#
1426
#
1427
# Returns         : 
1427
# Returns         : 
1428
#
1428
#
Line 1444... Line 1444...
1444
    {
1444
    {
1445
        s~[\r\n]+$~~;
1445
        s~[\r\n]+$~~;
1446
        next unless ( $_ );
1446
        next unless ( $_ );
1447
 
1447
 
1448
        my ($view, $label, $path);
1448
        my ($view, $label, $path);
1449
        foreach ( split ' ', $_ )
1449
        if ( m~\s-view=(\S+)~ )
1450
        {
1450
        {
1451
            if ( m~^-view=(.+)~ ) {
1451
            $view = $1;
1452
                $view = $1;
1452
        }
-
 
1453
 
1453
            } elsif ( m~^-label=(.+)~ ) {
1454
        if ( m~\s-label=(\S+)~ )
-
 
1455
        {
1454
                $label = $1;
1456
            $label = $1;
-
 
1457
        }
-
 
1458
 
1455
            } elsif ( m~^-path=(.+)~ ) {
1459
        if ( m~\s-path="(.+)"~ )
-
 
1460
        {
1456
                $path = $1;
1461
            $path = $1;
-
 
1462
        }
1457
                $path =~ s~\"~~g
1463
        elsif ( m~\s-path=(\S+)~ )
1458
            }
1464
        {
-
 
1465
            $path = $1;
1459
        }
1466
        }
1460
 
1467
 
1461
        Error "Duplicate view name: $view" if ( exists $extract{$view} );
-
 
1462
        Error "Bad file format in line: $_" unless ( $view && $label );
1468
        Error "Bad file format in line: $_" unless ( $view && $label );
-
 
1469
        Error "Duplicate view name: $view" if ( exists $extract{$view} );
1463
        push @extract_order, $view;
1470
        push @extract_order, $view;
1464
        $extract{$view}{label} = $label;
1471
        $extract{$view}{label} = $label;
1465
        $extract{$view}{path} = $path;
1472
        $extract{$view}{path} = $path;
1466
    }
1473
    }
1467
    close FH;
1474
    close FH;
Line 1477... Line 1484...
1477
    #
1484
    #
1478
    foreach my $view ( @extract_order )
1485
    foreach my $view ( @extract_order )
1479
    {
1486
    {
1480
        my $label = $extract{$view}{label};
1487
        my $label = $extract{$view}{label};
1481
        my $path = $extract{$view}{path};
1488
        my $path = $extract{$view}{path};
1482
        my $rv = JatsCmd ("extract -extractfiles -view=$view -label=$label -path=$path -root=. -noprefix");
1489
        my $rv = JatsCmd ("extract -extractfiles -view=$view -label=$label -path=\"$path\" -root=. -noprefix");
1483
        print FH "$view : SUCCESS\n" unless $rv;
1490
        print FH "$view : SUCCESS\n" unless $rv;
1484
        print FH "$view : ERROR\n" if $rv;
1491
        print FH "$view : ERROR\n" if $rv;
1485
    }
1492
    }
1486
    close FH;
1493
    close FH;
1487
 
1494