示例#1
0
 def testResolveTroveListError(self):
     repos = self.openRepository()
     oldResolveTroves = self.buildCfg.resolveTroves
     self.buildCfg.resolveTroves = [[('group-dist', None, None)]]
     try:
         try:
             buildcmd._getResolveTroveTups(self.buildCfg, repos)
         except errors.RmakeError, msg:
             assert(str(msg) == 'Could not find resolve troves for [default] context: group-dist'
                            ' was not found on path localhost@rpl:linux\n')
         else:
示例#2
0
 def testResolveTroveListError(self):
     repos = self.openRepository()
     oldResolveTroves = self.buildCfg.resolveTroves
     self.buildCfg.resolveTroves = [[('group-dist', None, None)]]
     try:
         try:
             buildcmd._getResolveTroveTups(self.buildCfg, repos)
         except errors.RmakeError, msg:
             assert (
                 str(msg) ==
                 'Could not find resolve troves for [default] context: group-dist'
                 ' was not found on path localhost@rpl:linux\n')
         else:
示例#3
0
 def testResolveTroveList(self):
     repos = self.openRepository()
     self.addComponent('foo:run', '1')
     grp = self.addCollection('group-dist', '1', ['foo:run'])
     oldResolveTroves = self.buildCfg.resolveTroves
     self.buildCfg.resolveTroves = [[('group-dist', None, None)]]
     try:
         resolveTroveTups = buildcmd._getResolveTroveTups(self.buildCfg, repos)
     finally:
         self.buildCfg.resolveTroves = oldResolveTroves
     assert(resolveTroveTups == [[grp.getNameVersionFlavor()]])
示例#4
0
 def testResolveTroveList(self):
     repos = self.openRepository()
     self.addComponent('foo:run', '1')
     grp = self.addCollection('group-dist', '1', ['foo:run'])
     oldResolveTroves = self.buildCfg.resolveTroves
     self.buildCfg.resolveTroves = [[('group-dist', None, None)]]
     try:
         resolveTroveTups = buildcmd._getResolveTroveTups(
             self.buildCfg, repos)
     finally:
         self.buildCfg.resolveTroves = oldResolveTroves
     assert (resolveTroveTups == [[grp.getNameVersionFlavor()]])
示例#5
0
文件: main.py 项目: pombreda/bob
    def _configure(self):
        '''
        Pre-build setup
        '''
        cfg = self._helper.cfg
        self._macros = self._cfg.getMacros()

        cfg.strictMode = True
        cfg.copyInConary = cfg.copyInConfig = False

        # These options translate directly from the plan to rMake
        # or conary
        for x in (
                'resolveTrovesOnly',
                'rpmRequirements',
                'shortenGroupFlavors',
                ):
            cfg[x] = self._cfg[x]

        # And these are a little more indirect
        cfg.buildLabel = self._cfg.getTargetLabel()
        cfg.cleanAfterCook = not self._cfg.noClean
        cfg.resolveTroves = substResolveTroves(self._cfg.resolveTroves,
            self._macros)
        if not self._cfg.depMode:
            cfg.resolveTroveTups = buildcmd._getResolveTroveTups(
                cfg, self._helper.getRepos())
        cfg.autoLoadRecipes = substStringList(self._cfg.autoLoadRecipes,
                                              self._macros)
        if not self._cfg.isDefault('defaultBuildReqs'):
            cfg.defaultBuildReqs = substStringList(
                    self._cfg.defaultBuildReqs, self._macros)

        installLabelPath = self._cfg.installLabelPath
        cfg.installLabelPath = substILP(installLabelPath, self._macros)

        cfg.initializeFlavors()

        # Set up global macros
        for key, value in self._cfg.macros.iteritems():
            if key in self._cfg.skipMacros:
                continue
            try:
                cfg.configLine('macros %s %s' % (key, value % self._macros))
            except MacroKeyError:
                # Maybe requires a build-time macro
                pass

        if self._cfg.needWmsToken:
            self._wmsCli = wms.WmsClient(self._cfg)
            self._wmsToken = self._wmsCli.create_token()
            if self._wmsToken:
                creds = self._wmsToken
            else:
                creds = self._wmsCli.wmsUser
            encoded = base64.b64encode('%s:%s' % creds)
            cfg.configLine('macros wms_token %s' % encoded)

        if not self._cfg.depMode:
            self._helper.getrMakeClient().addRepositoryInfo(cfg)
        self._helper.configChanged()