Ubuntu Pastebin

Paste from sergiusens at Fri, 15 Jan 2016 19:31:04 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
diff --git a/snapcraft/pluginhandler.py b/snapcraft/pluginhandler.py
index 53d41b9..f2ea1c6 100644
--- a/snapcraft/pluginhandler.py
+++ b/snapcraft/pluginhandler.py
@@ -309,7 +309,9 @@ def _migrate_files(snap_files, snap_dirs, srcdir, dstdir, missing_ok=False):
         os.makedirs(os.path.dirname(dst), exist_ok=True)
         if missing_ok and not os.path.exists(src):
             continue
-        if not os.path.exists(dst) and not os.path.islink(dst):
+        if os.path.exists(dst) and not os.path.islink(dst):
+            os.unlink(dst)
+        if not os.path.islink(dst) and not os.path.islink(dst):
             os.link(src, dst, follow_symlinks=False)
 
 
Download as text