summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-07-29 10:59:56 (GMT)
committerRichard Maw <richard.maw@codethink.co.uk>2014-07-29 10:59:56 (GMT)
commit18ba01bac46fa19ad6fa6076b987d951058bd9fc (patch)
tree7d3507b7c7d83663813d8fcd852e0aa472f307a0
parent2c61412b43d2a30ac237ee3d03a61fc647fed0ba (diff)
downloadmorph-18ba01bac46fa19ad6fa6076b987d951058bd9fc.tar.gz
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.
-rw-r--r--morphlib/builder2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index 4bb435d..d739dc1 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):