summaryrefslogtreecommitdiffstats
path: root/sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'sync.py')
-rwxr-xr-xsync.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/sync.py b/sync.py
new file mode 100755
index 0000000..c298da9
--- /dev/null
+++ b/sync.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+from confman import ConfigSource
+import sync_options as options
+
+from os import path
+base_path = path.join(path.dirname(__file__), '..')
+
+def privpub(dir):
+ return [path.join("private", dir), path.join("public", dir)]
+
+dirs = privpub("base")
+if "desktop" in options.tags and not options.is_root:
+ dirs += privpub("desktop")
+
+for dir in dirs:
+ base_dir = path.normpath(path.join(base_path, dir))
+ print base_dir + " => " + "~"
+
+ ConfigSource(base_dir, "~", None, options).sync()
+
+# FIXME remove the "desktop" condition when possible
+if options.is_root and options.is_gentoo and "desktop" in options.tags:
+ dirs = privpub("gentoo")
+
+ for dir in dirs:
+ base_dir = path.normpath(path.join(base_path, dir))
+ print base_dir + " => " + "/etc"
+
+ c = ConfigSource(base_dir, "/etc", None, options).sync()
+