mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
bitbake: fetch2/cvs: Clean up various data store references
The code in the CVS fetcher is elderly and there are simpler ways of using the data store. This updates to use the modern APIs. (Bitbake rev: 78eee8c70a80997293df99475153aed0b2ad0a17) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -29,7 +29,6 @@ BitBake build tools.
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
|
||||||
from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger
|
from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger
|
||||||
from bb.fetch2 import runfetchcmd
|
from bb.fetch2 import runfetchcmd
|
||||||
|
|
||||||
@@ -64,7 +63,7 @@ class Cvs(FetchMethod):
|
|||||||
if 'fullpath' in ud.parm:
|
if 'fullpath' in ud.parm:
|
||||||
fullpath = '_fullpath'
|
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)
|
ud.localfile = bb.data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d)
|
||||||
|
|
||||||
def need_update(self, url, ud, d):
|
def need_update(self, url, ud, d):
|
||||||
if (ud.date == "now"):
|
if (ud.date == "now"):
|
||||||
@@ -88,10 +87,10 @@ class Cvs(FetchMethod):
|
|||||||
cvsroot = ud.path
|
cvsroot = ud.path
|
||||||
else:
|
else:
|
||||||
cvsroot = ":" + method
|
cvsroot = ":" + method
|
||||||
cvsproxyhost = data.getVar('CVS_PROXY_HOST', d, True)
|
cvsproxyhost = d.getVar('CVS_PROXY_HOST', True)
|
||||||
if cvsproxyhost:
|
if cvsproxyhost:
|
||||||
cvsroot += ";proxy=" + cvsproxyhost
|
cvsroot += ";proxy=" + cvsproxyhost
|
||||||
cvsproxyport = data.getVar('CVS_PROXY_PORT', d, True)
|
cvsproxyport = d.getVar('CVS_PROXY_PORT', True)
|
||||||
if cvsproxyport:
|
if cvsproxyport:
|
||||||
cvsroot += ";proxyport=" + cvsproxyport
|
cvsroot += ";proxyport=" + cvsproxyport
|
||||||
cvsroot += ":" + ud.user
|
cvsroot += ":" + ud.user
|
||||||
@@ -121,8 +120,8 @@ class Cvs(FetchMethod):
|
|||||||
|
|
||||||
# create module directory
|
# create module directory
|
||||||
logger.debug(2, "Fetch: checking for module directory")
|
logger.debug(2, "Fetch: checking for module directory")
|
||||||
pkg = data.expand('${PN}', d)
|
pkg = d.getVar('PN', True)
|
||||||
pkgdir = os.path.join(data.expand('${CVSDIR}', d), pkg)
|
pkgdir = os.path.join(d.getVar('CVSDIR', True), pkg)
|
||||||
moddir = os.path.join(pkgdir, localdir)
|
moddir = os.path.join(pkgdir, localdir)
|
||||||
if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
|
if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
|
||||||
logger.info("Update " + loc)
|
logger.info("Update " + loc)
|
||||||
@@ -164,11 +163,8 @@ class Cvs(FetchMethod):
|
|||||||
def clean(self, ud, d):
|
def clean(self, ud, d):
|
||||||
""" Clean CVS Files and tarballs """
|
""" Clean CVS Files and tarballs """
|
||||||
|
|
||||||
pkg = data.expand('${PN}', d)
|
pkg = d.getVar('PN', True)
|
||||||
localdata = data.createCopy(d)
|
pkgdir = os.path.join(d.getVar("CVSDIR", True), pkg)
|
||||||
data.setVar('OVERRIDES', "cvs:%s" % data.getVar('OVERRIDES', localdata), localdata)
|
|
||||||
data.update_data(localdata)
|
|
||||||
pkgdir = os.path.join(data.expand('${CVSDIR}', localdata), pkg)
|
|
||||||
|
|
||||||
bb.utils.remove(pkgdir, True)
|
bb.utils.remove(pkgdir, True)
|
||||||
bb.utils.remove(ud.localpath)
|
bb.utils.remove(ud.localpath)
|
||||||
|
|||||||
Reference in New Issue
Block a user