From e59ade699e91764ae02d63b853ae7f3bc6c1c3d4 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Tue, 13 Aug 2013 11:08:17 +0100 Subject: fsutils: add invert_paths function This will list all the paths generated by the walker generator function that aren't in the specified set. It removes directories from those returned by the walker, since with os.walk(topdown=True) this culls the search space. In the set of provided paths and the set of returned paths, if a directory is given, then its contents are virtually part of the set. This oddly specific behaviour is because invert_paths is to be used with linux-user-chroot to mark subtrees as read-only, when it only has a set of paths it wants to keep writable. It takes a walker, rather than being given a path and using os.walk, so that it is a pure function, so is easier to unit test. --- without-test-modules | 1 - 1 file changed, 1 deletion(-) (limited to 'without-test-modules') diff --git a/without-test-modules b/without-test-modules index 9e2f39aa..baac8bd5 100644 --- a/without-test-modules +++ b/without-test-modules @@ -3,7 +3,6 @@ morphlib/artifactcachereference.py morphlib/builddependencygraph.py morphlib/tester.py morphlib/git.py -morphlib/fsutils.py morphlib/app.py morphlib/mountableimage.py morphlib/extractedtarball.py -- cgit v1.2.1