[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [emerge] bin: copy file if hardlink failed
From:       Patrick von Reth <vonreth () kde ! org>
Date:       2015-01-31 17:14:06
Message-ID: E1YHbcU-0000a3-Lc () scm ! kde ! org
[Download RAW message or body]

Git commit 1228313e84f564dd3c960047fa09f41242bb69aa by Patrick von Reth.
Committed on 31/01/2015 at 17:13.
Pushed by vonreth into branch 'master'.

copy file if hardlink failed

M  +9    -6    bin/utils.py

http://commits.kde.org/emerge/1228313e84f564dd3c960047fa09f41242bb69aa

diff --git a/bin/utils.py b/bin/utils.py
index 130aa23..00c8649 100644
--- a/bin/utils.py
+++ b/bin/utils.py
@@ -870,13 +870,16 @@ def copyFile(src, dest,linkOnly = emergeSettings.getboolean("General", "UseHardl
         warning( "Overriding %s" % dest )
         os.remove( dest )
     if linkOnly:
-        os.link( src , dest )
-    else:
         try:
-            shutil.copy(src,dest)
-        except OSError:
-            system("cmd /C \"attrib -R %s\"" % dest)
-            shutil.copy(src,dest)
+            os.link( src , dest )
+            return True
+        except:
+            pass
+    try:
+        shutil.copy(src,dest)
+    except OSError:
+        system("cmd /C \"attrib -R %s\"" % dest)
+        shutil.copy(src,dest)
     return True
     
 def copyDir( srcdir, destdir,linkOnly = emergeSettings.getboolean("General", "UseHardlinks", False ) ):

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic