Esempio n. 1
0
def updateRecipes(repos, cfg, recipeList, committedSources):
    committedSourcesByNB = {}
    for name, version, flavor in committedSources:
        committedSourcesByNB[name, version.branch()] = version
    for recipe in recipeList:
        recipeDir = os.path.dirname(recipe)
        stateFilePath = recipeDir + '/CONARY'
        if not os.path.exists(stateFilePath):
            continue
        conaryStateFile = state.ConaryStateFromFile(stateFilePath)
        if not conaryStateFile.hasSourceState():
            continue
        context = conaryStateFile.getContext()
        stateFile = conaryStateFile.getSourceState()
        troveName = stateFile.getName()
        branch = stateFile.getBranch()
        if (troveName, branch) not in committedSourcesByNB:
            continue
        stateVersion = stateFile.getVersion()
        newVersion = committedSourcesByNB[troveName, branch]
        if stateVersion != versions.NewVersion():
            log.info('Updating %s after commit' % recipeDir)
            try:
                # Added in CNY-3035
                checkin.nologUpdateSrc(repos, [recipeDir])
            except checkin.builderrors.UpToDate:
                pass # Don't mention if the source is already up to date
            except checkin.builderrors.CheckinError, e:
                e.logError()
            except AttributeError:
                checkin.updateSrc(repos, [recipeDir])
Esempio n. 2
0
    def runCommand(self, cfg, argSet, args, profile = False,
                   callback = None, repos = None):
        args = args[2:]
        if argSet: return self.usage()

        kwargs = {'callback': callback}
        checkin.updateSrc(repos, versionList = args, **kwargs)
Esempio n. 3
0
    def runCommand(self,
                   cfg,
                   argSet,
                   args,
                   profile=False,
                   callback=None,
                   repos=None):
        args = args[2:]
        if argSet: return self.usage()

        kwargs = {'callback': callback}
        checkin.updateSrc(repos, versionList=args, **kwargs)
Esempio n. 4
0
def updateRecipes(repos, cfg, recipeList, committedSources):
    committedSourcesByNB = {}
    for name, version, flavor in committedSources:
        committedSourcesByNB[name, version.branch()] = version
    for recipe in recipeList:
        recipeDir = os.path.dirname(recipe)
        stateFilePath = recipeDir + '/CONARY'
        if not os.path.exists(stateFilePath):
            continue
        conaryStateFile = state.ConaryStateFromFile(stateFilePath)
        if not conaryStateFile.hasSourceState():
            continue
        context = conaryStateFile.getContext()
        stateFile = conaryStateFile.getSourceState()
        troveName = stateFile.getName()
        branch = stateFile.getBranch()
        if (troveName, branch) not in committedSourcesByNB:
            continue
        stateVersion = stateFile.getVersion()
        newVersion = committedSourcesByNB[troveName, branch]
        if stateVersion != versions.NewVersion():
            log.info('Updating %s after commit' % recipeDir)
            if compat.ConaryVersion().updateSrcTakesMultipleVersions():
                try:
                    # Added in CNY-3035
                    checkin.nologUpdateSrc(repos, [recipeDir])
                except checkin.builderrors.UpToDate:
                    pass  # Don't mention if the source is already up to date
                except checkin.builderrors.CheckinError, e:
                    e.logError()
                except AttributeError:
                    checkin.updateSrc(repos, [recipeDir])
            else:
                curDir = os.getcwd()
                try:
                    os.chdir(recipeDir)
                    checkin.updateSrc(repos)
                finally:
                    os.chdir(curDir)
Esempio n. 5
0
        @return: Status
        @rtype: bool
        """
        # Conary likes absolute paths RBLD-137
        targetDir = os.path.abspath(targetDir)
        try:
            return checkin.nologUpdateSrc(self._getRepositoryClient(),
                                          [targetDir])
        except (builderrors.UpToDate, builderrors.NotCheckedInError):
            # The end result is an up to date checkout, so ignore the exception
            return True
        except builderrors.CheckinError, e:
            # All other exceptions are deemed failures
            raise errors.RbuildError(str(e))
        except AttributeError:
            return checkin.updateSrc(self._getRepositoryClient(), [targetDir])

    def getCheckoutStatus(self, targetDir):
        """
        Create summary of changes regarding all files in a directory
        as a list of C{(I{status}, I{filename})} tuples where
        C{I{status}} is a single character describing the status
        of the file C{I{filename}}:
         - C{?}: File not managed by Conary
         - C{A}: File added since last commit (or since package created if no commit)
         - C{M}: File modified since last commit
         - C{R}: File removed since last commit
        @param targetDir: name of directory for which to fetch status.
        @type targetDir: string
        @return: lines of text describing differences
        @rtype: list
Esempio n. 6
0
        @return: Status
        @rtype: bool
        """
        # Conary likes absolute paths RBLD-137
        targetDir = os.path.abspath(targetDir)
        try:
            return checkin.nologUpdateSrc(self._getRepositoryClient(),
                                          [targetDir])
        except (builderrors.UpToDate, builderrors.NotCheckedInError):
            # The end result is an up to date checkout, so ignore the exception
            return True
        except builderrors.CheckinError, e:
            # All other exceptions are deemed failures
            raise errors.RbuildError(str(e))
        except AttributeError:
            return checkin.updateSrc(self._getRepositoryClient(), [targetDir])

    def getCheckoutStatus(self, targetDir):
        """
        Create summary of changes regarding all files in a directory
        as a list of C{(I{status}, I{filename})} tuples where
        C{I{status}} is a single character describing the status
        of the file C{I{filename}}:
         - C{?}: File not managed by Conary
         - C{A}: File added since last commit (or since package created if no commit)
         - C{M}: File modified since last commit
         - C{R}: File removed since last commit
        @param targetDir: name of directory for which to fetch status.
        @type targetDir: string
        @return: lines of text describing differences
        @rtype: list