예제 #1
0
파일: commit.py 프로젝트: pombreda/rmake3
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])
예제 #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)
예제 #3
0
파일: cvccmd.py 프로젝트: pombreda/conary-1
    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)
예제 #4
0
파일: commit.py 프로젝트: pombreda/rmake
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)
예제 #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
예제 #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