diff options
-rwxr-xr-x | build_tools/bin/sync_profiles.py | 49 |
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) + + + |