#!<> use INSTALL::common; use INSTALL::global; use INSTALL::parameter; use INSTALL::os; use INSTALL::ini; my $pParameters = \%INSTALL::parameter::variables; #============================================================================== #------------------------ Default global values #============================================================================== $pParameters->{asphome} = "<>"; $pParameters->{com_layer} = "<>"; INSTALL::common::set_standard_globals; my $pGlobals = \%INSTALL::global::variables; my $pOS = \%INSTALL::os::Details; sub usage { report("Usage: $0 srcini=... dstini=..."); } if ((not exists $pParameters->{srcini}) || (not exists $pParameters->{dstini}) || (not grep { /(srcini|dstini|[0-9]+)/ } keys %{$pParameters})) { usage; exit(1); } if (!-f $pParameters->{dstini}) { exit(error("Destination ini file was not found")); } if (!-f $pParameters->{srcini}) { exit(error("Source ini file was not found")); } my $dst = INSTALL::ini::load($pParameters->{dstini}); my $src = INSTALL::ini::load($pParameters->{srcini}); my @srcsecs = INSTALL::ini::getSectionNames($src); foreach (@srcsecs) { my $srcsec = INSTALL::ini::openSection($src, $_); my $dstsec = INSTALL::ini::insertSection($dst, $_); if (!$srcsec || !dstsec) { exit(error("Sections could not be opened - $_")); } foreach (keys %{$srcsec}) { $dstsec->{$_} = $srcsec->{$_}; } } INSTALL::ini::save($dst, $pParameters->{dstini}); exit(0);