summaryrefslogtreecommitdiff
path: root/morphlib/builder.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-05 11:41:58 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-05 11:43:04 +0100
commit200d792a3af13d31b27d2d15ba8210b30f3e6afd (patch)
tree5fc89711a712522a75ab9f463217bdabd0bbe04a /morphlib/builder.py
parente4b58fe4d67a66c0a59231ac2d08ef06ec480218 (diff)
downloadmorph-200d792a3af13d31b27d2d15ba8210b30f3e6afd.tar.gz
Avoid setting the mtime of broken symlinks.
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r--morphlib/builder.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py
index 23a1c2ca..ed21f623 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -138,7 +138,9 @@ class Factory(object):
for dirname, subdirs, basenames in os.walk(root, topdown=False):
for basename in basenames:
pathname = os.path.join(dirname, basename)
- os.utime(pathname, (now, now))
+ # we need the following check to ignore broken symlinks
+ if os.path.exists(pathname):
+ os.utime(pathname, (now, now))
os.utime(dirname, (now, now))