From: Ian Jackson Subject: [OSSTEST PATCH 11/32] readglobalconfig: Support Include Date: Tue, 24 Mar 2015 19:02:34 +0000 Message-ID: <1427223775-8592-12-git-send-email-ian.jackson@eu.citrix.com> References: <1427223775-8592-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YaU79-0000zf-3G for xen-devel@lists.xenproject.org; Tue, 24 Mar 2015 19:03:47 +0000 In-Reply-To: <1427223775-8592-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Jackson --- Osstest.pm | 9 ++++++++- README | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Osstest.pm b/Osstest.pm index 8e63389..9fbadbd 100644 --- a/Osstest.pm +++ b/Osstest.pm @@ -20,6 +20,7 @@ use strict; use warnings; use POSIX; +use File::Basename; BEGIN { use Exporter (); @@ -120,7 +121,13 @@ sub readglobalconfig () { s/\s+$//; next if m/^\#/; next unless m/\S/; - if (m/^($cfgvar_re)\s+(\S.*)$/) { + if (m/^include\s+(\S.*)$/i) { + my $newfn = $1; + if ($newfn !~ m#^/|^\./#) { + $newfn = dirname($cfgfile)."/".$newfn; + } + $readcfg->($newfn, 0); + } elsif (m/^($cfgvar_re)\s+(\S.*)$/) { $c{$1} = $2; } elsif (m/^($cfgvar_re)=\s*\<\<(\'?)(.*)\2\s*$/) { my ($vn,$qu,$delim) = ($1,$2,$3); diff --git a/README b/README index 9634185..0aaba2c 100644 --- a/README +++ b/README @@ -276,6 +276,9 @@ To set a value to the empty string, say For an example see ./standalone-config-example Values later in the file, or in a later file, take precedence. +You can say `Include '. is relative to the file +doing the including, unless it starts with `/' or `./'. + ======================================== Important config settings for standalone mode: -- 1.7.10.4