Пример #1
0
def SourceFactory(settings):
    """ return sourceBase derived instance for recent settings"""
    EmergeDebug.trace("SourceFactory called", 1)
    source = None

    if settings.hasTarget():
        if settings.hasMultipleTargets():
            url = settings.targetAt(0)
        else:
            url = settings.target()
        source = ArchiveSource(settings)

    ## \todo move settings access into info class
    if settings.hasSvnTarget():
        url = settings.svnTarget()
        sourceType = utils.getVCSType( url )
        if sourceType == "svn":
            source = SvnSource(settings)
        elif sourceType == "hg":
            source = HgSource(settings)
        elif sourceType == "git":
            source = GitSource(settings)

    if source == None:
        EmergeDebug.die("none or unsupported source system set")
    if not source.subinfo:
        source.subinfo = settings
    source.url = url
    return source
Пример #2
0
def SourceFactory(settings):
    """ return sourceBase derived instance for recent settings"""
    utils.trace( "SourceFactory called", 1 )
    source = None

    if settings.hasTarget():
        if settings.hasMultipleTargets():
            url = settings.targetAt(0)
        else:
            url = settings.target()
        source = ArchiveSource(settings)

    ## \todo move settings access into info class
    if settings.hasSvnTarget():
        url = settings.svnTarget()
        sourceType = utils.getVCSType( url )
        if sourceType == "svn":
            source = SvnSource(settings)
        elif sourceType == "hg":
            source = HgSource(settings)
        elif sourceType == "git":
            source = GitSource(settings)

    if source == None:
        utils.die("none or unsupported source system set")
    if not source.subinfo:
        source.subinfo = settings
    source.url = url
    return source
Пример #3
0
 def getUpdatableVCSTargets(self, category, package):
     """ check if the targets are tags or not """
     targetDict = PortageInstance.getAllVCSTargets(category, package)
     retList = []
     for key in targetDict:
         url = targetDict[key]
         if url:
             sourceType = utils.getVCSType(url)
             if sourceType == "svn":
                 # for svn, ignore tags
                 if not url.startswith("tags/") and not "/tags/" in url:
                     retList.append(key)
             elif sourceType == "git":
                 _, branch, tag = utils.splitVCSUrl(url)
                 if tag == "" and not branch.endswith("-patched"):
                     retList.append(key)
             elif not sourceType == "":
                 # for all other vcs types, simply rebuild everything for now
                 retList.append(key)
     return retList
Пример #4
0
 def getUpdatableVCSTargets(self, category, package, version):
     """ check if the targets are tags or not """
     targetDict = PortageInstance.getAllVCSTargets(category, package, version)
     retList = []
     for key in targetDict:
         url = targetDict[key]
         if url:
             sourceType = utils.getVCSType(url)
             if sourceType == "svn":
                 # for svn, ignore tags
                 if not url.startswith("tags/") and not "/tags/" in url:
                     retList.append(key)
             elif sourceType == "git":
                 _, branch, tag = utils.splitVCSUrl(url)
                 if tag == "" and not branch.endswith("-patched"):
                     retList.append(key)
             elif not sourceType == "":
                 # for all other vcs types, simply rebuild everything for now
                 retList.append(key)
     return retList
Пример #5
0
def SourceFactory(settings):
    """ return sourceBase derived instance for recent settings"""
    utils.trace( "SourceFactory called", 1 )
    source = None

    if settings.hasTarget():
        if settings.hasMultipleTargets():
            url = settings.targetAt(0)
        else:
            url = settings.target()
        if url.startswith("[archive]"):
            source = ArchiveSource(settings)
        elif url.find(".exe") != -1 or url.find(".bat") != -1 or url.find(".msi") != -1:
            source = FileSource(settings)
        else:
            source = ArchiveSource(settings)

    ## \todo move settings access into info class
    if settings.hasSvnTarget():
        url = settings.svnTarget()
        sourceType = utils.getVCSType( url )
        if sourceType == "svn":
            source = SvnSource(settings)
        elif sourceType == "hg":
            source = HgSource(settings)
        elif sourceType == "git":
            source = GitSource(settings)
        ## \todo complete more cvs access schemes
        elif sourceType == "cvs":
            source = CvsSource(settings)

    if source == None:
        utils.die("none or unsupported source system set")
    if not source.subinfo:
        source.subinfo = settings
    source.url = url
    return source