예제 #1
0
파일: osc.py 프로젝트: SamyGO/oe-b-series
    def localpath(self, url, ud, d):
        if not "module" in ud.parm:
            raise MissingParameterError("osc method needs a 'module' parameter.")

        ud.module = ud.parm["module"]

        # Create paths to osc checkouts
        relpath = ud.path
        if relpath.startswith('/'):
            # Remove leading slash as os.path.join can't cope
            relpath = relpath[1:]
        ud.pkgdir = os.path.join(data.expand('${OSCDIR}', d), ud.host)
        ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module)

        if 'rev' in ud.parm:
            ud.revision = ud.parm['rev']
        else:
            pv = data.getVar("PV", d, 0)
            rev = Fetch.srcrev_internal_helper(ud, d)
            if rev and rev != True:
                ud.revision = rev
            else:
                ud.revision = ""

        ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #2
0
    def localpath(self, url, ud, d):
        if not "module" in ud.parm:
            raise MissingParameterError("hg method needs a 'module' parameter")

        ud.module = ud.parm["module"]

        # Create paths to mercurial checkouts
        relpath = self._strip_leading_slashes(ud.path)
        ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath)
        ud.moddir = os.path.join(ud.pkgdir, ud.module)

        if 'rev' in ud.parm:
            ud.revision = ud.parm['rev']
        else:
            tag = Fetch.srcrev_internal_helper(ud, d)
            if tag is True:
                ud.revision = self.latest_revision(url, ud, d)
            elif tag:
                ud.revision = tag
            else:
                ud.revision = self.latest_revision(url, ud, d)

        ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #3
0
    def localpath(self, url, ud, d):
        if not "module" in ud.parm:
            raise MissingParameterError(
                "osc method needs a 'module' parameter.")

        ud.module = ud.parm["module"]

        # Create paths to osc checkouts
        relpath = ud.path
        if relpath.startswith('/'):
            # Remove leading slash as os.path.join can't cope
            relpath = relpath[1:]
        ud.pkgdir = os.path.join(data.expand('${OSCDIR}', d), ud.host)
        ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module)

        if 'rev' in ud.parm:
            ud.revision = ud.parm['rev']
        else:
            pv = data.getVar("PV", d, 0)
            rev = Fetch.srcrev_internal_helper(ud, d)
            if rev and rev != True:
                ud.revision = rev
            else:
                ud.revision = ""

        ud.localfile = data.expand(
            '%s_%s_%s.tar.gz' % (ud.module.replace(
                '/', '.'), ud.path.replace('/', '.'), ud.revision), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #4
0
파일: git.py 프로젝트: kakunbsc/bb
    def localpath(self, url, ud, d):

        if 'protocol' in ud.parm:
            ud.proto = ud.parm['protocol']
        elif not ud.host:
            ud.proto = 'file'
        else:
            ud.proto = "rsync"

        ud.branch = ud.parm.get("branch", "master")

        tag = Fetch.srcrev_internal_helper(ud, d)
        if tag is True:
            ud.tag = self.latest_revision(url, ud, d)	
        elif tag:
            ud.tag = tag
        else:
            ud.tag = ""

        if not ud.tag or ud.tag == "master":
            ud.tag = self.latest_revision(url, ud, d)

        ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.tag), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #5
0
    def localpath(self, url, ud, d):

        ud.proto = "rsync"
        if 'protocol' in ud.parm:
            ud.proto = ud.parm['protocol']

        ud.branch = ud.parm.get("branch", "master")

        tag = Fetch.srcrev_internal_helper(ud, d)
        if tag is True:
            ud.tag = self.latest_revision(url, ud, d)
        elif tag:
            ud.tag = tag

        if not ud.tag:
            ud.tag = self.latest_revision(url, ud, d)

        if ud.tag == "master":
            ud.tag = self.latest_revision(url, ud, d)

        ud.localfile = data.expand(
            'git_%s%s_%s.tar.gz' %
            (ud.host, ud.path.replace('/', '.'), ud.tag), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #6
0
    def localpath(self, url, ud, d):
        if not "module" in ud.parm:
            raise MissingParameterError("svn method needs a 'module' parameter")

        ud.module = ud.parm["module"]

        # Create paths to svn checkouts
        relpath = ud.path
        if relpath.startswith("/"):
            # Remove leading slash as os.path.join can't cope
            relpath = relpath[1:]
        ud.pkgdir = os.path.join(data.expand("${SVNDIR}", d), ud.host, relpath)
        ud.moddir = os.path.join(ud.pkgdir, ud.module)

        if "rev" in ud.parm:
            ud.date = ""
            ud.revision = ud.parm["rev"]
        elif "date" in ud.date:
            ud.date = ud.parm["date"]
            ud.revision = ""
        else:
            #
            # ***Nasty hack***
            # If DATE in unexpanded PV, use ud.date (which is set from SRCDATE)
            # Should warn people to switch to SRCREV here
            #
            pv = data.getVar("PV", d, 0)
            if "DATE" in pv:
                ud.revision = ""
            else:
                rev = Fetch.srcrev_internal_helper(ud, d)
                if rev is True:
                    ud.revision = self.latest_revision(url, ud, d)
                    ud.date = ""
                elif rev:
                    ud.revision = rev
                    ud.date = ""
                else:
                    ud.revision = ""

        ud.localfile = data.expand(
            "%s_%s_%s_%s_%s.tar.gz"
            % (ud.module.replace("/", "."), ud.host, ud.path.replace("/", "."), ud.revision, ud.date),
            d,
        )

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #7
0
    def localpath(self, url, ud, d):

        if 'protocol' in ud.parm:
            ud.proto = ud.parm['protocol']
        elif not ud.host:
            ud.proto = 'file'
        else:
            ud.proto = "rsync"

        ud.branch = ud.parm.get("branch", "master")

        gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
        ud.mirrortarball = 'git_%s.tar.gz' % (gitsrcname)
        ud.clonedir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)

        tag = Fetch.srcrev_internal_helper(ud, d)
        if tag is True:
            ud.tag = self.latest_revision(url, ud, d)
        elif tag:
            ud.tag = tag

        if not ud.tag or ud.tag == "master":
            ud.tag = self.latest_revision(url, ud, d)

        subdir = ud.parm.get("subpath", "")
        if subdir != "":
            if subdir.endswith("/"):
                subdir = subdir[:-1]
            subdirpath = os.path.join(ud.path, subdir)
        else:
            subdirpath = ud.path

        if 'fullclone' in ud.parm:
            ud.localfile = ud.mirrortarball
        else:
            ud.localfile = data.expand(
                'git_%s%s_%s.tar.gz' %
                (ud.host, subdirpath.replace('/', '.'), ud.tag), d)

        ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"

        if 'noclone' in ud.parm:
            ud.localfile = None
            return None

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #8
0
파일: bzr.py 프로젝트: ack3000/poky
    def localpath (self, url, ud, d):

        # Create paths to bzr checkouts
        relpath = self._strip_leading_slashes(ud.path)
        ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)

        revision = Fetch.srcrev_internal_helper(ud, d)
        if revision is True:
            ud.revision = self.latest_revision(url, ud, d)
        elif revision:
            ud.revision = revision

        if not ud.revision:
            ud.revision = self.latest_revision(url, ud, d)

        ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #9
0
파일: git.py 프로젝트: folkien/poky-fork
    def localpath(self, url, ud, d):

        if 'protocol' in ud.parm:
            ud.proto = ud.parm['protocol']
        elif not ud.host:
            ud.proto = 'file'
        else:
            ud.proto = "rsync"

        ud.branch = ud.parm.get("branch", "master")

        gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
        ud.mirrortarball = 'git_%s.tar.gz' % (gitsrcname)
        ud.clonedir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)

        tag = Fetch.srcrev_internal_helper(ud, d)
        if tag is True:
            ud.tag = self.latest_revision(url, ud, d)
        elif tag:
            ud.tag = tag

        if not ud.tag or ud.tag == "master":
            ud.tag = self.latest_revision(url, ud, d)

        subdir = ud.parm.get("subpath", "")
        if subdir != "":
            if subdir.endswith("/"):
                subdir = subdir[:-1]
            subdirpath = os.path.join(ud.path, subdir);
        else:
            subdirpath = ud.path;

        if 'fullclone' in ud.parm:
            ud.localfile = ud.mirrortarball
        else:
            ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, subdirpath.replace('/', '.'), ud.tag), d)

        ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"

        if 'noclone' in ud.parm:
            ud.localfile = None
            return None

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #10
0
    def localpath(self, url, ud, d):
        if not "module" in ud.parm:
            raise MissingParameterError(
                "svn method needs a 'module' parameter")

        ud.module = ud.parm["module"]

        # Create paths to svn checkouts
        relpath = self._strip_leading_slashes(ud.path)
        ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
        ud.moddir = os.path.join(ud.pkgdir, ud.module)

        if 'rev' in ud.parm:
            ud.date = ""
            ud.revision = ud.parm['rev']
        elif 'date' in ud.date:
            ud.date = ud.parm['date']
            ud.revision = ""
        else:
            #
            # ***Nasty hack***
            # If DATE in unexpanded PV, use ud.date (which is set from SRCDATE)
            # Should warn people to switch to SRCREV here
            #
            pv = data.getVar("PV", d, 0)
            if "DATE" in pv:
                ud.revision = ""
            else:
                rev = Fetch.srcrev_internal_helper(ud, d)
                if rev is True:
                    ud.revision = self.latest_revision(url, ud, d)
                    ud.date = ""
                elif rev:
                    ud.revision = rev
                    ud.date = ""
                else:
                    ud.revision = ""

        ud.localfile = data.expand(
            '%s_%s_%s_%s_%s.tar.gz' %
            (ud.module.replace('/', '.'), ud.host, ud.path.replace(
                '/', '.'), ud.revision, ud.date), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #11
0
    def localpath(self, url, ud, d):

        if 'protocol' in ud.parm:
            ud.proto = ud.parm['protocol']
        elif not ud.host:
            ud.proto = 'file'
        else:
            ud.proto = "rsync"

        ud.branch = ud.parm.get("branch", "master")

        tag = Fetch.srcrev_internal_helper(ud, d)
        if tag is True:
            ud.tag = self.latest_revision(url, ud, d)
        elif tag:
            ud.tag = tag

        if not ud.tag or ud.tag == "master":
            ud.tag = self.latest_revision(url, ud, d)

        if 'repopath' in ud.parm:
            ud.subdir = "%s" % (ud.parm['repopath'])
        else:
            ud.subdir = ""

        if 'module' in ud.parm:
            if ud.subdir != "":
                ud.subdir = os.path.join(ud.subdir, ud.parm['module'])
            else:
                ud.subdir = ud.parm['module']
        else:
            ud.subdir = ""

        if ud.subdir != "":
            tagDir = "%s_%s" % (ud.subdir, ud.tag)
        else:
            tagDir = ud.tag

        ud.localfile = data.expand(
            'git_%s%s_%s.tar.gz' %
            (ud.host, ud.path.replace('/', '.'), tagDir.replace('/', '.')), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #12
0
    def localpath(self, url, ud, d):

        # Create paths to bzr checkouts
        relpath = self._strip_leading_slashes(ud.path)
        ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)

        revision = Fetch.srcrev_internal_helper(ud, d)
        if revision is True:
            ud.revision = self.latest_revision(url, ud, d)
        elif revision:
            ud.revision = revision

        if not ud.revision:
            ud.revision = self.latest_revision(url, ud, d)

        ud.localfile = data.expand(
            'bzr_%s_%s_%s.tar.gz' %
            (ud.host, ud.path.replace('/', '.'), ud.revision), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
예제 #13
0
파일: svn.py 프로젝트: ack3000/poky
    def localpath(self, url, ud, d):
        if not "module" in ud.parm:
            raise MissingParameterError("svn method needs a 'module' parameter")

        ud.module = ud.parm["module"]

        # Create paths to svn checkouts
        relpath = self._strip_leading_slashes(ud.path)
        ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
        ud.moddir = os.path.join(ud.pkgdir, ud.module)

        if 'rev' in ud.parm:
            ud.date = ""
            ud.revision = ud.parm['rev']
        elif 'date' in ud.date:
            ud.date = ud.parm['date']
            ud.revision = ""
        else:
            #
            # ***Nasty hack***
            # If DATE in unexpanded PV, use ud.date (which is set from SRCDATE)
            # Should warn people to switch to SRCREV here
            #
            pv = data.getVar("PV", d, 0)
            if "DATE" in pv:
                ud.revision = ""
            else:
                rev = Fetch.srcrev_internal_helper(ud, d)
                if rev is True:
                    ud.revision = self.latest_revision(url, ud, d)
                    ud.date = ""
                elif rev:
                    ud.revision = rev
                    ud.date = ""
                else:
                    ud.revision = ""

        ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)