From 18ba01bac46fa19ad6fa6076b987d951058bd9fc Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Tue, 29 Jul 2014 10:59:56 +0000 Subject: Fix not including symlinks in chunks if they exist on the host With os.walk, if the target of the link doesn't exist, or it is a link to a file, it ends up in the basenames list. If it is a link to a directory, it goes in the subdirs list. There's a bug in the subdirsymlinks check, in that it checks if the wrong file is a symlink, so it never returns them. This was missed, since we did not have the cross bootstrap in CI. This is not eligible for our yarn tests, since to trigger this would require changes to the host system's rootfs, so it's a system-level test. To test this properly requires putting the cross bootstrap in CI. --- morphlib/builder2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morphlib/builder2.py b/morphlib/builder2.py index 4bb435d9..d739dc13 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -488,7 +488,7 @@ class ChunkBuilder(BuilderBase): def filepaths(destdir): for dirname, subdirs, basenames in os.walk(destdir): subdirsymlinks = [os.path.join(dirname, x) for x in subdirs - if os.path.islink(x)] + if os.path.islink(os.path.join(dirname, x))] filenames = [os.path.join(dirname, x) for x in basenames] for relpath in (os.path.relpath(x, destdir) for x in [dirname] + subdirsymlinks + filenames): -- cgit v1.2.1