[PATCH] Reset changes made to the apt configuration

Timo Juhani Lindfors timo.lindfors at iki.fi
Mon Sep 12 20:13:25 UTC 2011


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.
---
 runner/adt-run |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/runner/adt-run b/runner/adt-run
index 1de5934..b6fbd00 100755
--- a/runner/adt-run
+++ b/runner/adt-run
@@ -814,6 +814,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)
-- 
1.7.2.5




More information about the autopkgtest-devel mailing list