[meld] Copy permission bits, etc. when copying directories (closes bgo#635885)



commit f3ab948c60250bf6f8e2250aa7d17701c251056f
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Nov 28 11:02:23 2010 +1000

    Copy permission bits, etc. when copying directories (closes bgo#635885)
    
    When we recursively copy directories, we already copy the permission
    bits and other metadata for files, but neglected to do so for
    directories. This commit calls copystat() for each directory we copy.

 meld/misc.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/meld/misc.py b/meld/misc.py
index 8f1460e..bc0ee37 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -308,6 +308,12 @@ def copytree(src, dst):
         else:
             copy2(srcname, dstname)
 
+    try:
+        shutil.copystat(src, dst)
+    except OSError, e:
+        if e.errno != errno.EPERM:
+            raise
+
 def shell_escape(glob_pat):
     # TODO: handle all cases
     assert not re.compile(r"[][*?]").findall(glob_pat)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]