Subversion Repositories DevTools

Rev

Rev 7299 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7299 Rev 7300
Line 1... Line 1...
1
########################################################################
1
########################################################################
2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
2
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
3
#
3
#
4
# Module name   : jats_generate_deployable.pl
4
# Module name   : jats_generate_deployable.pl
5
# Module type   : Makefile system
5
# Module type   : Makefile system
6
# Compiler(s)   : Perl
6
# Compiler(s)   : Perl
7
# Environment(s): jats build system
7
# Environment(s): jats build system
Line 59... Line 59...
59
#   Globals
59
#   Globals
60
#
60
#
61
my $DM_DB;              # Data Base Interface
61
my $DM_DB;              # Data Base Interface
62
my %bomList;            # All files in the BOM
62
my %bomList;            # All files in the BOM
63
my $bomInfo;            # Sbom meta data
63
my $bomInfo;            # Sbom meta data
-
 
64
my %baseList;           # List of files in bin
64
 
65
 
65
#
66
#
66
#   Configuration file vars
67
#   Configuration file vars
67
#
68
#
68
my @confFilters;
69
my @confFilters;
Line 299... Line 300...
299
            Error("Failed to make project directory tree $opt_rootdir") if ( $@ || ! -d $opt_rootdir );
300
            Error("Failed to make project directory tree $opt_rootdir") if ( $@ || ! -d $opt_rootdir );
300
        }
301
        }
301
    }
302
    }
302
 
303
 
303
    #
304
    #
-
 
305
    #   Generate a list of all files in the directory
-
 
306
    #
-
 
307
    foreach my $file ( glob("$opt_rootdir/*") ) {
-
 
308
        $baseList{$file}{data} = 1;
-
 
309
    }
-
 
310
 
-
 
311
    #
304
    #   Determine the files to be transferred
312
    #   Determine the files to be transferred
305
    #
313
    #
306
    my @filelist;
314
    my @filelist;
307
    foreach my $file ( keys %bomList)
315
    foreach my $file ( keys %bomList)
308
    {
316
    {
Line 378... Line 386...
378
                    Warning("Failed to delete: $file. ($!)");
386
                    Warning("Failed to delete: $file. ($!)");
379
                }
387
                }
380
            }
388
            }
381
        }
389
        }
382
    }
390
    }
-
 
391
 
-
 
392
    #
-
 
393
    #   Report changed files
-
 
394
    #   Generate a list of all files in the directory
-
 
395
    #
-
 
396
    foreach my $file ( glob("$opt_rootdir/*") ) {
-
 
397
        $baseList{$file}{data} |= 2;
-
 
398
    }
-
 
399
 
-
 
400
    #
-
 
401
    #   Determined added, removed and replaced
-
 
402
    #       
-
 
403
    #
-
 
404
    my (@replaced, @added, @removed, @unchanged, %newList);
-
 
405
    foreach my $entry ( keys %baseList )
-
 
406
    {
-
 
407
        (my $key = $entry) =~ s~\d+~z~g;
-
 
408
        $baseList{$entry}{key} = $key;
-
 
409
 
-
 
410
        (my $name = $entry) =~ s~^\./~~;
-
 
411
        $newList{$key}{$baseList{$entry}{data}} = $entry;
-
 
412
    }
-
 
413
    
-
 
414
    foreach my $key ( sort keys %newList )
-
 
415
    {
-
 
416
        if (exists $newList{$key}{1} && exists $newList{$key}{2}  ) {
-
 
417
            push @replaced, "$newList{$key}{1}   =>   $newList{$key}{2}";
-
 
418
        } elsif (exists $newList{$key}{1}) {
-
 
419
            push @removed, $newList{$key}{1};
-
 
420
        } elsif (exists $newList{$key}{2}) {
-
 
421
            push @added, $newList{$key}{2};
-
 
422
        } elsif (exists $newList{$key}{3}) {
-
 
423
            push @unchanged, $newList{$key}{3};
-
 
424
        }
-
 
425
    }
-
 
426
    
-
 
427
    Message ("Unchanged: " .(@unchanged ? scalar(@unchanged ) : 'None') );
-
 
428
    Message ("Replaced: " . (@replaced ?  scalar(@replaced )  : 'None'), @replaced);
-
 
429
    Message ("Added: " .    (@added    ?  scalar(@added )     : 'None'), @added);
-
 
430
    Message ("Removed: " .  (@removed  ?  scalar(@removed )   : 'None'), @removed);
383
}
431
}
384
 
432
 
385
#-------------------------------------------------------------------------------
433
#-------------------------------------------------------------------------------
386
# Function        : RemoveDuplicates 
434
# Function        : RemoveDuplicates 
387
#
435
#
Line 581... Line 629...
581
    push @tfData2, "// Terraform variable definitions to map clean package name to full file name";
629
    push @tfData2, "// Terraform variable definitions to map clean package name to full file name";
582
    push @tfData2, "variable vixFileName {";
630
    push @tfData2, "variable vixFileName {";
583
    push @tfData2, "    type = \"map\"";
631
    push @tfData2, "    type = \"map\"";
584
    push @tfData2, "    default = {" ;
632
    push @tfData2, "    default = {" ;
585
 
633
 
586
    foreach my $item ( sort keys $bomInfo->{files} )
634
    foreach my $item ( sort keys %{$bomInfo->{files}} )
587
    {
635
    {
588
        push @tfData2, "        \"". $item  ."\" = \"" .$bomInfo->{files}{$item}{fullname} ."\"";
636
        push @tfData2, "        \"". $item  ."\" = \"" .$bomInfo->{files}{$item}{fullname} ."\"";
589
    }
637
    }
590
 
638
 
591
    push @tfData2, "    }" ;
639
    push @tfData2, "    }" ;