summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cp-noerror10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/cp-noerror b/scripts/cp-noerror
index f0cd243586..474f7aa80a 100755
--- a/scripts/cp-noerror
+++ b/scripts/cp-noerror
@@ -21,7 +21,15 @@ def copytree(src, dst, symlinks=False, ignore=None):
21 srcname = os.path.join(src, name) 21 srcname = os.path.join(src, name)
22 dstname = os.path.join(dst, name) 22 dstname = os.path.join(dst, name)
23 try: 23 try:
24 shutil.copy2(srcname, dstname) 24 d = dstname
25 if os.path.isdir(dstname):
26 d = os.path.join(dstname, os.path.basename(srcname))
27 if os.path.exists(d):
28 continue
29 try:
30 os.link(srcname, dstname)
31 except OSError:
32 shutil.copy2(srcname, dstname)
25 # catch the Error from the recursive copytree so that we can 33 # catch the Error from the recursive copytree so that we can
26 # continue with other files 34 # continue with other files
27 except shutil.Error, err: 35 except shutil.Error, err: