From 7528669e7965a5dd9acd8a9fce4ab8f271ca493c Mon Sep 17 00:00:00 2001 From: codehelp Date: Wed, 25 Aug 2010 20:44:21 +0000 Subject: [PATCH] improve the efficiency of the new output for sources. git-svn-id: http://emdebian.org/svn/current@7386 563faec7-e20c-0410-992a-a66f704d0ccd --- multistrap | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/multistrap b/multistrap index c4a9152..09774ee 100755 --- a/multistrap +++ b/multistrap @@ -901,16 +901,14 @@ sub dump_config { " cannot be parsed correctly."), $file); warn ("\n$msg\n"); } - # Translators: followed by a list of section names from the config file. - printf ("bootstrap:\t"._g("Sections specifying packages for downloading in the bootstrap: ").join (", ", sort @debootstrap)."\n"); - # Translators: followed by a list of section names from the config file. - printf ("aptsources:\t"._g("Sections specifying apt sources in the final system: ").join (", ", sort @aptsources)."\n"); @check=(); %uniq=(); push @check, @debootstrap; push @check, @aptsources; foreach my $sect (@check) { $uniq{$sect}++; } - foreach my $sect (sort keys %uniq) { + @check = sort keys %uniq; + %uniq=(); + foreach my $sect (@check) { if (not exists $keys{$sect}) { $msg .= sprintf (_g("ERR: The '%s' section is not defined.\n"), $sect); } @@ -922,7 +920,7 @@ sub dump_config { } # explain the bootstrap section details explicitly and just refer to # those for the apt sources. - foreach my $sect_name (@debootstrap) { + foreach my $sect_name (@check) { printf ("Section:\t$sect_name\n"); print "\tsource: \t$sources{$sect_name}\n"; my @sorted = split(/ /, $packages{$sect_name}); @@ -935,6 +933,7 @@ sub dump_config { print "\tsuite: \t$suites{$sect_name}\n"; print "\tcomponent\t$components{$sect_name}\n"; # only packages can have a list + next if (not grep(/^$sect_name$/i, @debootstrap)); print "\tBootstrap:\tpackages: ".join(" ", @sorted)."\n"; } printf ("Bootstrap:\t%s: %s\n", _g("Sections"), join(" ", sort @debootstrap));