[sabayon] Gracefully ignore st_mode if the metadata node is missing that particular prop.



commit dea42facd30f1b326224fdaf672f1dfe0202eeda
Author: Warren Togami <wtogami redhat com>
Date:   Thu Feb 18 13:38:55 2010 -0500

    Gracefully ignore st_mode if the metadata node is missing that particular prop.

 lib/storage.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/lib/storage.py b/lib/storage.py
index e9d3dbf..49718ac 100755
--- a/lib/storage.py
+++ b/lib/storage.py
@@ -546,7 +546,8 @@ class ProfileStorage:
             copy_tree (dst_dir, self.temp_path, path, None, overwrite)
             dir_node = self.__get_dir_node (path)
             st_mode = dir_node.prop ("st_mode")
-            os.chmod (os.path.join(dst_dir,path), int (st_mode))
+            if st_mode:
+                os.chmod (os.path.join(dst_dir,path), int (st_mode))
         elif item_type == "link":
             link_node = self.__get_link_node (path)
             dest = link_node.prop("dest")
@@ -561,7 +562,8 @@ class ProfileStorage:
                 copy_preserving_permissions (os.path.join (self.temp_path, path), dst_path)
                 file_node = self.__get_file_node (path)
                 st_mode = file_node.prop ("st_mode")
-                os.chmod (dst_path, int (st_mode))
+                if st_mode:
+                    os.chmod (dst_path, int (st_mode))
 
     def list (self, source = None):
         """List the current contents of the profile.



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