[sabayon] Always clean up the gconf source trees, so that if someone is removed from either users.xml or group



commit bba023746aef909eb4cc757917d2e5111c7fc996
Author: Scott Balneaves <sbalneav ltsp org>
Date:   Thu Feb 4 15:16:14 2010 -0600

    Always clean up the gconf source trees, so that if someone is removed from either users.xml or groups.xml, their defaults and mandatory trees are cleaned up

 admin-tool/sabayon-apply |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/admin-tool/sabayon-apply b/admin-tool/sabayon-apply
index 7eb7021..d04c18f 100755
--- a/admin-tool/sabayon-apply
+++ b/admin-tool/sabayon-apply
@@ -84,6 +84,18 @@ if __name__ == '__main__':
         group_membership = util.get_group_membership ()
 
         #
+        # Remove any existing gconf sources.  Should be done here, just in case
+        # a user's been removed from both users.xml and groups.xml, so that
+        # their gconf sources will be cleanly removed regardless.
+        #
+
+        try:
+            shutil.rmtree (os.path.join (util.get_home_dir (), GCONF_DEFAULTS_SOURCE), True)
+            shutil.rmtree (os.path.join (util.get_home_dir (), GCONF_MANDATORY_SOURCE), True)
+        except:
+            pass
+
+        #
         # Begin the process of determining WHICH profile to apply.
         # We have 4 possibilities, rated in order of priority (highest first)
         # 1) We've been passed a profile on the command line.  We'll apply
@@ -124,13 +136,10 @@ if __name__ == '__main__':
             sys.exit (util.EXIT_CODE_NO_USER_PROFILE)
 
         #
-        # We've determined a profile applies to us.  Clean up existing
-        # defaults.
+        # We've determined a profile applies to us.  re-create source trees.
         #
 
         try:
-            shutil.rmtree (os.path.join (util.get_home_dir (), GCONF_DEFAULTS_SOURCE), True)
-            shutil.rmtree (os.path.join (util.get_home_dir (), GCONF_MANDATORY_SOURCE), True)
             os.mkdir (os.path.join (util.get_home_dir (), GCONF_DEFAULTS_SOURCE))
             os.mkdir (os.path.join (util.get_home_dir (), GCONF_MANDATORY_SOURCE))
         except:



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