summaryrefslogtreecommitdiffstats
path: root/build_tools/bin
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-11-28 00:50:27 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-11-28 00:50:27 (GMT)
commitbab5535ac56569b2b6eff60e105268ee7249c2f9 (patch)
treeca7fb817d5b9dc0f1d0133585d670243f8f967b1 /build_tools/bin
parentaa1353347767b50ff844c862fd5d00aed012a3d2 (diff)
downloadlinhes_dev-bab5535ac56569b2b6eff60e105268ee7249c2f9.zip
sync_profile.py: new method of syncing profiles.
This will present you with a menu of types of profiles to sync, and then a menu of which profile to sync from.
Diffstat (limited to 'build_tools/bin')
-rwxr-xr-xbuild_tools/bin/sync_profiles.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/build_tools/bin/sync_profiles.py b/build_tools/bin/sync_profiles.py
new file mode 100755
index 0000000..9b9200c
--- /dev/null
+++ b/build_tools/bin/sync_profiles.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python2
+import os
+profiledir="/build_tools/larch7/larch0/profiles"
+def getProfileList(profileType):
+ profilelist=[]
+ dirlist=os.listdir(profiledir)
+ for dir in dirlist:
+ if dir.startswith("linhes"):
+ if profileType != "All":
+ if dir.find(profileType) > 0:
+ profilelist.append(dir)
+ else:
+ profilelist.append(dir)
+ return profilelist
+
+def SyncTesting():
+ profilelist = getProfileList("testing")
+ return profilelist
+def SyncStable():
+ profilelist = getProfileList("stable")
+ return profilelist
+
+def SyncALL():
+ profilelist = getProfileList("All")
+ return profilelist
+
+options = ['Sync Testing', 'Sync Stable', 'Sync ALL']
+callbacks = [SyncTesting, SyncStable, SyncALL]
+for i,option in enumerate(options):
+ print('%s. %s' % (i, option)) # display all options
+choice = int(raw_input('your choice? '))
+
+profilelist = callbacks[choice]() # call correspondending function
+for i,option in enumerate(profilelist):
+ print('%s. %s' % (i, option)) # display all options
+ print ""
+print "\nSync From which profile"
+choice = int(raw_input('your choice? '))
+srcprofile=profilelist[choice]
+
+for i in profilelist:
+ if i == srcprofile:
+ continue
+ cmd = 'rsync --exclude splash.xpm.gz --exclude splash.xpm --exclude vbg.jpg --exclude=pacman.conf --delete -apv %s/%s/ %s/%s/' %(profiledir,srcprofile,profiledir,i)
+ print cmd
+ os.system(cmd)
+
+
+