[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [OSSTEST PATCH 3/4] ts-xen-build: Factor out config_tree
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@xxxxxxxxxxxxx> --- 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@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |