diff options
authorRichard Maw <>2014-07-29 10:59:56 (GMT)
committerRichard Maw <>2014-07-29 10:59:56 (GMT)
commit18ba01bac46fa19ad6fa6076b987d951058bd9fc (patch)
parent2c61412b43d2a30ac237ee3d03a61fc647fed0ba (diff)
Fix not including symlinks in chunks if they exist on the hostbaserock/richardmaw/bugfix/symlink-include
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.
1 files changed, 1 insertions, 1 deletions
diff --git a/morphlib/ b/morphlib/
index 4bb435d..d739dc1 100644
--- a/morphlib/
+++ b/morphlib/
@@ -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):