Fixing bug 3653: with more than 9 new_install_list sessions in otherpkgs.pkglist, perl 'sort' take the integers as string, and so does not sort the order correctly

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16817 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2013-06-28 06:27:23 +00:00
parent 18f0040778
commit 68e4dd3d70

View File

@ -259,7 +259,7 @@ unless ($onlyinitrd) {
my %pkg_hash=imgutils::get_package_names($pkglist);
my $index=1;
my $pass;
foreach $pass (sort (keys(%pkg_hash))) {
foreach $pass (sort {$a <=> $b} (keys(%pkg_hash))) {
my $pkgnames = "";
foreach (keys(%{$pkg_hash{$pass}})) {
if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;}
@ -326,7 +326,7 @@ unless ($onlyinitrd) {
if (keys(%extra_hash) > 0) {
open($yumconfig,">>","/tmp/genimage.$$.yum.conf");
my $index=1;
foreach $pass (sort (keys(%extra_hash))) {
foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) {
foreach (keys(%{$extra_hash{$pass}})) {
if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;}
print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n";
@ -346,7 +346,7 @@ unless ($onlyinitrd) {
# $yumcmd .= "--enablerepo=otherpkgs$_ ";
# }
foreach $pass (sort (keys(%extra_hash))) {
foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) {
$yumcmd = $yumcmd_base;
foreach my $repo_index ( keys %{$repohash{$pass}} ) {
$yumcmd .= "--enablerepo=otherpkgs$repo_index ";