source: vpy/reconfig @ 2948

Last change on this file since 2948 was 2948, checked in by wehart, 11 years ago

Removing Coopr stable branches.

Adding the vpy reconfig script and associated README file.

File size: 1.1 KB
Line 
1#! /usr/bin/env python
2#
3# A script to reconfigure externals for configuration files
4#
5
6import ConfigParser
7import glob
8import os
9import sys
10import commands
11
12for file in glob.glob("*.ini"):
13    print "Processing "+file
14    config = ConfigParser.ConfigParser()
15    config.read(file)
16    #
17    name = os.path.splitext(file)[0]
18    if not os.path.exists(name+'_trunk'):
19        print commands.getoutput('svn mkdir '+name+'_trunk')
20    #
21    externals = []
22    for section in config.sections():
23        for option in config.options(section):
24            if option in 'release':
25                externals.append(section+' '+config.get(section,option))
26            elif option == 'root':
27                externals.append(section+' '+config.get(section,option)+'/trunk')
28    if len(externals) > 0:
29        os.chdir(name+'_trunk')
30        OUTPUT = open('Externals','w')
31        print >>OUTPUT, '\n'.join(externals)
32        OUTPUT.close()
33        commands.getoutput('svn add Externals')
34        commands.getoutput('svn propset -F Externals svn:externals .')
35        commands.getoutput('svn commit -m "Updating externals"')
36        os.chdir('..')
37
38       
39       
40   
Note: See TracBrowser for help on using the repository browser.