From bab5535ac56569b2b6eff60e105268ee7249c2f9 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Sun, 28 Nov 2010 00:50:27 +0000 Subject: 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. --- build_tools/bin/sync_profiles.py | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 build_tools/bin/sync_profiles.py 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) + + + -- cgit v0.12