From: Ian Jackson Subject: [OSSTEST PATCH 22/32] cr-ensure-disk-space: Permit argument to specify local directory. Date: Tue, 24 Mar 2015 19:02:45 +0000 Message-ID: <1427223775-8592-23-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.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YaU6d-00005m-36 for xen-devel@lists.xenproject.org; Tue, 24 Mar 2015 19:03:15 +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 If the argument is Logs rather than LogsPublish (ie, refers to a local directory (without `:') rather than a remote one (with `:'), do things locally (by invoking sh -ec so that we have identical quoting rules to ssh). No effectively functional change with the current configuration. We still always do a local deletion. This is anomalous and will disappear shortly. Signed-off-by: Ian Jackson --- cr-ensure-disk-space | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space index 1c665b3..1defa6a 100755 --- a/cr-ensure-disk-space +++ b/cr-ensure-disk-space @@ -53,13 +53,22 @@ our @flights; our @sshopts= qw(-o batchmode=yes); my $cfgvalue = $c{$cfgbase}; -$cgvvalue =~ m/\:/ or die "$c{LogsPublish} ?"; -my ($pubhost, $pubdir) = ($`,$'); #'; + +my ($pubhost, $pubdir); +if ($cfgvalue =~ m/\:/) { + ($pubhost, $pubdir) = ($`,$'); #'); +} else { + ($pubhost, $pubdir) = (undef, $cfgvalue); +} sub ontarget ($) { my ($shellcmd) = @_; # returns list to run that command - return qw(ssh -n), @sshopts, $pubhost, $shellcmd; + if (defined $pubhost) { + return qw(ssh -n), @sshopts, $pubhost, $shellcmd; + } else { + return qw(sh -ec), $shellcmd; + } } for (;;) { -- 1.7.10.4