-# an entire Project
-class Project:
- def __init__(self, config, folder, module):
- self.folder = folder
- self.name = module['name']
- # VCS
- vcsName = module['vcs']
- if vcsName == 'git':
- self.vcs = vcs.Git(self.sourceFolder(), module['url'], module['version'])
- elif vcsName == 'svn':
- self.vcs = vcs.SVN(self.sourceFolder(), module['url'], module.get('versionName'))
- else:
- raise Exception("Unknown VCS type "+vcsName)
- # build system
- if config.get('buildDeb', False):
- self.buildSystem = build_system.AutoDebuild(self.sourceFolder(), self.buildFolder(), module, self.vcs, config)
- else:
- buildSystemName = module['buildSystem']
- if buildSystemName == 'cmake':
- self.buildSystem = build_system.CMake(self.sourceFolder(), self.buildFolder(), module, config)
- else:
- raise Exception("Unknown build system type "+buildSystemName)
-
- def sourceFolder(self):
- return os.path.join(self.folder, self.name)
-
- def buildFolder(self):
- return os.path.join(config['buildDir'], self.sourceFolder())
-
-# return the position of the given item in the list
-def findInList(list, item):
- for i in xrange(len(list)):
- if list[i] == item:
- return i
- raise Exception("%s not found in list" % str(item))
+# copy all items which don't exist below, except for those in the exclude list
+def inherit(subConfig, superConfig, exclude = ('name', 'projects')):
+ for name in superConfig.keys():
+ if (not name in subConfig) and (not name in exclude):
+ subConfig[name] = superConfig[name]