Exemplo n.º 1
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)
Exemplo n.º 2
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)
Exemplo n.º 3
0
    def localpath(self, url, ud, d):
        if not "module" in ud.parm:
            raise MissingParameterError("cvs method needs a 'module' parameter")
        ud.module = ud.parm["module"]

        ud.tag = ""
        if 'tag' in ud.parm:
            ud.tag = ud.parm['tag']

        # Override the default date in certain cases
        if 'date' in ud.parm:
            ud.date = ud.parm['date']
        elif ud.tag:
            ud.date = ""

        norecurse = ''
        if 'norecurse' in ud.parm:
            norecurse = '_norecurse'

        fullpath = ''
        if 'fullpath' in ud.parm:
            fullpath = '_fullpath'

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

        return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
Exemplo n.º 4
0
    def localpath(self, url, ud, d):
        if not "module" in ud.parm:
            raise MissingParameterError("svk method needs a 'module' parameter")
        else:
            ud.module = ud.parm["module"]

        ud.revision = ud.parm.get('rev', "")

        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)
Exemplo n.º 5
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)
Exemplo n.º 6
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 = 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('${HGDIR}', d), ud.host, relpath)
        ud.moddir = os.path.join(ud.pkgdir, ud.module)

        if 'rev' in ud.parm:
            ud.revision = ud.parm['rev']

        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)