source: devel/reconfig @ 3287

Last change on this file since 3287 was 2970, checked in by wehart, 9 years ago

Migrating the developer externals config into the 'devel'
directory.

File size: 1.2 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
12def create(name,type):
13    #
14    if not os.path.exists(name+'_'+type):
15        print commands.getoutput('svn mkdir '+name+'_'+type)
16    #
17    externals = []
18    for section in config.sections():
19        for option in config.options(section):
20            if option in 'release':
21                externals.append(section+' '+config.get(section,option))
22            elif option == 'root':
23                externals.append(section+' '+config.get(section,option)+'/'+type)
24    if len(externals) > 0:
25        os.chdir(name+'_'+type)
26        OUTPUT = open('Externals','w')
27        print >>OUTPUT, '\n'.join(externals)
28        OUTPUT.close()
29        commands.getoutput('svn add Externals')
30        commands.getoutput('svn propset -F Externals svn:externals .')
31        commands.getoutput('svn commit -m "Updating externals"')
32        os.chdir('..')
33
34for file in glob.glob("../vpy/*.ini"):
35    print "Processing "+file
36    config = ConfigParser.ConfigParser()
37    config.read(file)
38    #
39    name = os.path.splitext(os.path.basename(file))[0]
40    create(name,'trunk')
41    create(name,'stable')
42
43       
44       
45   
Note: See TracBrowser for help on using the repository browser.