From f442fe034d1c235b4c0391b12d2849b2a82ddefe Mon Sep 17 00:00:00 2001 From: daniceexi Date: Mon, 2 Apr 2012 17:39:46 +0000 Subject: [PATCH] fix the issue if having entry has dir path in the .pkglist, genimage failed git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12094 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/sles/genimage | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 274553270..0e5d73d1c 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -415,14 +415,18 @@ unless ($onlyinitrd) { } } } - $pkgnames .= " " . join(' ', @npa); - $group_pkgnames .= " " . join(' ', @npa_group); + if (@npa) { + $pkgnames .= " " . join(' ', @npa); + } + if (@npa_group) { + $group_pkgnames .= " " . join(' ', @npa_group); + } } my $envlist; if(exists $pkg_hash{$pass}{ENVLIST}){ $envlist = join(' ', @{$pkg_hash{$pass}{ENVLIST}}); } - if($pkgnames ne ' ') + if($pkgnames) { print "$envlist $yumcmd $pkgnames\n"; $rc = system("$envlist $yumcmd $pkgnames"); @@ -432,7 +436,7 @@ unless ($onlyinitrd) { exit 1; } } - if($group_pkgnames ne ' ') + if($group_pkgnames) { print "$envlist $yumcmd -t pattern $group_pkgnames\n"; $rc = system("$envlist $yumcmd -t pattern $group_pkgnames");