#! /usr/bin/perl
use strict;
use warnings;

use mrw::Targets;
use mrw::Inventory;
use mrw::Util;
use Getopt::Long;
use YAML::Tiny qw(LoadFile);

my $mrwFile = "";
my $outFile = "";
my $configFile = "";

GetOptions(
"m=s" => \$mrwFile,
"c=s" => \$configFile,
"o=s" => \$outFile,
)
or printUsage();

if (($mrwFile eq "") or ($configFile eq "") or ($outFile eq ""))
{
    printUsage();
}

# Load system MRW
my $targets = Targets->new;
$targets->loadXML($mrwFile);
my @inventory = Inventory::getInventory($targets);

# Target Type : Target inventory path
my %defaultPaths = (
    "ETHERNET",
     Util::getObmcName(
         \@inventory,
         Util::getBMCTarget($targets))."/ethernet"
);

# Parse config YAML
my $targetItems = LoadFile($configFile);

# Targets we're interested in, from the config YAML
my @targetNames = keys %{$targetItems};
my %targetHash;
@targetHash{@targetNames} = ();
my @targetTypes;
my @paths;

# Retrieve OBMC path of targets we're interested in
for my $item (@inventory) {
    my $targetType = "";
    my $path = "";

    if (!$targets->isBadAttribute($item->{TARGET}, "TYPE")) {
        $targetType = $targets->getAttribute($item->{TARGET}, "TYPE");
    }
    next if (not exists $targetHash{$targetType});

    push @targetTypes, $targetType;
    push @paths, $item->{OBMC_NAME};
    delete($targetHash{$targetType});
}

for my $type (keys %targetHash)
{
    if(defined $defaultPaths{$type})
    {
        # One or more targets wasn't present in the inventory
        push @targetTypes, $type;
        push @paths, $defaultPaths{$type};
    }
}

open(my $fh, '>', $outFile) or die "Could not open file '$outFile' $!";
print $fh "FRUS=".join ',',@targetTypes;
print $fh "\n";
print $fh "PATHS=".join ',',@paths;
close $fh;

sub printUsage
{
    print "
    $0 -m [MRW file] -c [Config yaml] -o [Output filename]\n";
    exit(1);
}
