From 200d792a3af13d31b27d2d15ba8210b30f3e6afd Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Thu, 5 Apr 2012 11:41:58 +0100 Subject: Avoid setting the mtime of broken symlinks. --- morphlib/builder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'morphlib/builder.py') 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)) -- cgit v1.2.1