From 04e106df88c843485b18d9fa595af9cc43109a28 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 16 Jul 2007 16:38:40 +0100 Subject: [PATCH] * Set LANG to C by default for commands (eg builds and tests) run on testbed, and make this configurable. * Make builds work again: Fix `cd *' in work.write (broken by inclusion of `tmpdir' in that directory). * adt-testreport-onepackage has better reporting for DC-running. --- debian/changelog | 6 +++++- runner/adt-run | 16 +++++++++++----- runner/adt-run.1 | 10 ++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index d85ced1..69f1559 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ autopkgtest (1.0.3) unstable; urgency=low - * WIP better reporting for DC-running + * Set LANG to C by default for commands (eg builds and tests) run on + testbed, and make this configurable. + * Make builds work again: Fix `cd *' in work.write (broken by + inclusion of `tmpdir' in that directory). + * adt-testreport-onepackage has better reporting for DC-running. -- diff --git a/runner/adt-run b/runner/adt-run index 1274da8..de2f0cb 100755 --- a/runner/adt-run +++ b/runner/adt-run @@ -421,7 +421,8 @@ def parse_args(): 'deb_forbuilds': 'auto', 'deb_fortests': 'auto', 'tb': False, - 'override_control': None + 'override_control': None, + 'set_lang': 'C' } initial_arghandling = arghandling.copy() n_non_actions = 0 @@ -509,7 +510,6 @@ def parse_args(): ' according to most recent --binaries-* settings') pa_setah('--no-built-binaries', ['dsc_filter'], '_', help='from subsequent sources, do not use any binaries') - #---- binary package processing settings: def pa_setahbins(long,toset,how): @@ -543,6 +543,11 @@ def parse_args(): pa_path('output-dir', OutputDir, dir=True, help='write stderr/out files in PATH') + pa('--leave-lang', dest='set_lang', action='store_false', + help="leave LANG on testbed set to testbed's default") + pa('--set-lang', dest='set_lang', action='store', metavar='LANGVAL', + help='set LANG on testbed to LANGVAL', default='C') + pa('','--tmp-dir', type='string', dest='tmpdir', help='write temporary files to TMPDIR, emptying it' ' beforehand and leaving it behind at the end') @@ -893,7 +898,8 @@ class Testbed: if xdump is not None and 'execute-debug' in tb.caps: cmdl += [xdump] if tmpdir is not None: cmdl.append('env=TMPDIR=%s' % tmpdir) if kind=='install': cmdl.append('env=DEBIAN_FRONTEND=noninteractive') -# cmdl.append('env=LANG=C') + if opts.set_lang is not False: + cmdl.append('env=LANG=%s' % opts.set_lang) rc = tb.commandr1('execute', cmdl) try: rc = int(rc) @@ -1564,7 +1570,7 @@ def build_source(act, control_override): [ create_command ]) script += [ - 'cd */.', + 'cd [a-z0-9]*-*/.', 'pwd >&3', 'set +e; test -f debian/tests/control; echo $? >&3' ] @@ -1663,7 +1669,7 @@ def build_source(act, control_override): debug_b('filter=%s' % filter) if filter != '_': script = tmpdir_script + [ - 'cd '+work.write(True)+'/*/.', + 'cd '+work.write(True)+'/[a-z0-9]*-*/.', opts.user_wrap(opts.gainroot+' debian/rules binary'), 'cd ..', 'echo *.deb >&3', diff --git a/runner/adt-run.1 b/runner/adt-run.1 index b65bd28..fda5fd6 100644 --- a/runner/adt-run.1 +++ b/runner/adt-run.1 @@ -189,6 +189,16 @@ Specifies the virtualisation regime server, as a command and arguments to invoke. All the remaining arguments and options after .B --- are passed to the virtualisation server program. +.TP +.BI --set-lang= langval +When running commands on the testbed, sets the \fBLANG\fR environment +variable to \fIlangval\fR. The default in \fBadt-run\fR is to set it +to \fBC\fR. +.TP +.BI --leave-lang +Suppresses the setting by \fBadt-run\fR of \fBLANG\fR on the testbed. +This results in tests and builds using the testbed's own normal +\fBLANG\fR value setting. .SH OUTPUT FORMAT During a normal test run, one line is printed for each test. This -- 2.30.2