From 45492244fd0fc4d52ff297b7e24844313ec380c3 Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Mon, 6 Aug 2012 07:07:50 +0000 Subject: [PATCH] Skipping comments in pkglist and ospkglist before processing git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13433 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/imgutils/imgutils.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm b/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm index aed5b1976..a96adfc77 100644 --- a/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm +++ b/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm @@ -65,6 +65,11 @@ sub include_file chomp($_); s/\s+$//; #remove trailing spaces next if /^\s*$/; #-- skip empty lines + next + if ( /^\s*#/ + && !/^\s*#INCLUDE:[^#^\n]+#/ + && !/^\s*#NEW_INSTALL_LIST#/ + && !/^\s*#ENV:[^#^\n]+#/); #-- skip comments push(@text, $_); } @@ -86,6 +91,11 @@ sub get_package_names { chomp; s/\s+$//; #remove trailing white spaces next if /^\s*$/; #-- skip empty lines + next + if ( /^\s*#/ + && !/^\s*#INCLUDE:[^#^\n]+#/ + && !/^\s*#NEW_INSTALL_LIST#/ + && !/^\s*#ENV:[^#^\n]+#/); #-- skip comments push(@tmp_array,$_); } close($pkgfile);