From bab1c3b3247f91d8048735cbf03d3df0d5701a2e Mon Sep 17 00:00:00 2001 From: Timo Juhani Lindfors Date: Mon, 17 Oct 2011 21:50:26 +0100 Subject: [PATCH] adt-run: Reset changes made to the apt configuration, on exit After this change running adt-run --quiet --no-built-binaries hello_2.6-1.dsc --- adt-virt-null find /etc -name "*autopkgtest*" does not print any files. [ Ideally we would leave these config file settings somewhere where apt won't find them unless it's told to. That way if adt-run crashes for any reason, we wouldn't be relying on this cleanup code, and we could remove it. However, when I tried to do this I found I couldn't get apt to reliably pick up all the files I needed using command line options. So this is an improvement for now. -iwj ] --- runner/adt-run | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runner/adt-run b/runner/adt-run index 9110236..310c39a 100755 --- a/runner/adt-run +++ b/runner/adt-run @@ -816,6 +816,14 @@ exec '''+shellquote_cmdl(cmdl)+' "$@"'+"\n" if rc: pstderr("\n" "warning: failed to restore" " testbed apt cache, exit code %d" % rc) + what = 'aptconf-reset' + cmdl = ['rm','-f','/etc/apt/apt.conf.d/90autopkgtest', + '/etc/apt/sources.list.d/autopkgtest.list', + '/etc/apt/preferences.d/90autopkgtest'] + rc = tb.execute(what, cmdl, kind='install') + if rc: + pstderr("\n" "warning: failed to reset changes" + " made to testbed apt configuration, exit code %d" % rc) tb._need_reset_apt = False def close(tb): tb._debug('close, scratch=%s' % tb.scratch) -- 2.30.2