From 65af2acb5daad348a9f69d9a7e40fa460d6acc87 Mon Sep 17 00:00:00 2001 From: sikorsky Date: Wed, 10 Sep 2008 14:16:15 +0000 Subject: [PATCH] Accept comments in {profile}.pkglist and {profile}.exlist. This can be useful to mark what is which package for, who requested it etc. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2117 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/packimage.pm | 2 ++ xCAT-server/share/xcat/netboot/sles/genimage | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index d1db0f297..1b2a7bf99 100644 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -79,6 +79,8 @@ sub process_request { my $excludestr = "find . "; while (<$exlist>) { chomp $_; + s/\s*#.*//; #-- remove comments + next if /^\s*$/; #-- skip empty lines $excludestr .= "'!' -path '".$_."' -a "; } close($exlist); diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index fb400fda5..53e979dd0 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -129,7 +129,9 @@ unless ($onlyinitrd) { } open($yumconfig,"<","$pkglist"); while (<$yumconfig>) { - chomp; + chomp; + s/\s*#.*//; #-- remove comments + next if /^\s*$/; #-- skip empty lines $yumcmd .= $_ . " "; } close($yumconfig);