xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [OSSTEST PATCH 3/4] ts-xen-build: Factor out config_tree
Date: Tue, 12 Jul 2016 18:40:22 +0100	[thread overview]
Message-ID: <1468345223-6457-4-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1468345223-6457-1-git-send-email-ian.jackson@eu.citrix.com>

Replaces ad-hoc repeated stanzas involving nonempty etc. with a sub
which generates the right output, using build_url_vcs.

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-xen-build | 52 +++++++++++++++++++++-------------------------------
 1 file changed, 21 insertions(+), 31 deletions(-)

diff --git a/ts-xen-build b/ts-xen-build
index 382fe62..5933dd4 100755
--- a/ts-xen-build
+++ b/ts-xen-build
@@ -29,7 +29,22 @@ selectbuildhost(\@ARGV);
 builddirsprops();
 
 my $enable_xsm = ($r{enable_xsm}//'false') =~ m/true/ ? 1 : 0;
-    
+
+sub config_tree ($$$) {
+    my ($which, $configurlvar, $configtagvar) = @_;
+
+    my ($tree,$vcs) = build_url_vcs($which);
+    my $revision = $r{"revision_$which"};
+
+    return
+        (nonempty($tree) ? <<END : '').
+	echo >>.config $configurlvar='$tree'
+END
+        (nonempty($revision) ? <<END : '');
+	echo >>.config $configtagvar='$revision'
+END
+}
+
 sub checkout () {
     prepbuilddirs();
 
@@ -61,36 +76,11 @@ END
 	fi
 	echo >>.config XSM_ENABLE='${build_xsm}'
 END
-               (nonempty($r{tree_qemu}) ? <<END : '').
-	echo >>.config QEMU_REMOTE='$r{tree_qemu}'
-END
-               (nonempty($r{revision_qemu}) ? <<END : '').
-	echo >>.config QEMU_TAG='$r{revision_qemu}'
-END
-               (nonempty($r{tree_qemuu}) ? <<END : '').
-	echo >>.config QEMU_UPSTREAM_URL='$r{tree_qemuu}'
-END
-               (nonempty($r{revision_qemuu}) ? <<END : '').
-	echo >>.config QEMU_UPSTREAM_REVISION='$r{revision_qemuu}'
-END
-               (nonempty($r{tree_seabios}) ? <<END : '').
-	echo >>.config SEABIOS_UPSTREAM_URL='$r{tree_seabios}'
-END
-               (nonempty($r{revision_seabios}) ? <<END : '').
-	echo >>.config SEABIOS_UPSTREAM_TAG='$r{revision_seabios}'
-END
-               (nonempty($r{tree_ovmf}) ? <<END : '').
-	echo >>.config OVMF_UPSTREAM_URL='$r{tree_ovmf}'
-END
-               (nonempty($r{revision_ovmf}) ? <<END : '').
-	echo >>.config OVMF_UPSTREAM_REVISION='$r{revision_ovmf}'
-END
-               (nonempty($r{tree_minios}) ? <<END : '').
-	echo >>.config MINIOS_UPSTREAM_URL='$r{tree_minios}'
-END
-               (nonempty($r{revision_minios}) ? <<END : '').
-	echo >>.config MINIOS_UPSTREAM_REVISION='$r{revision_minios}'
-END
+ (config_tree('qemu',   'QEMU_REMOTE',         'QEMU_TAG')).
+ (config_tree('qemuu',  'QEMU_UPSTREAM_URL',   'QEMU_UPSTREAM_REVISION')).
+ (config_tree('seabios','SEABIOS_UPSTREAM_URL','SEABIOS_UPSTREAM_TAG')).
+ (config_tree('ovmf',   'OVMF_UPSTREAM_URL',   'OVMF_UPSTREAM_REVISION')).
+ (config_tree('minios','MINIOS_UPSTREAM_URL',  'MINIOS_UPSTREAM_REVISION')).
                (nonempty($earlyprintk) ? <<END : '').
 	echo >>.config CONFIG_EARLY_PRINTK=$earlyprintk
 END
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-07-12 17:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 17:40 [OSSTEST PATCH 0/4] Use cached git url for trees cloned by xen.git Ian Jackson
2016-07-12 17:40 ` [OSSTEST PATCH 1/4] Osstest/PDU/eth008: print actual error on failure Ian Jackson
2016-07-12 17:40 ` [OSSTEST PATCH 2/4] TestSupport: Break out build_url_vcs Ian Jackson
2016-07-12 17:40 ` Ian Jackson [this message]
2016-07-12 17:40 ` [OSSTEST PATCH 4/4] build_clone: Move git_massage_url to build_url_vcs Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468345223-6457-4-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).