summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-20 11:32:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-20 11:37:16 +0100
commit01606f2b97381164c4b672effaff30fe11af0ea3 (patch)
tree12902632f76958c9d138f8f1f43b053fa8a6868e
parent553a5b184282a11100277c840a0d61d6d0921fff (diff)
downloadpoky-01606f2b97381164c4b672effaff30fe11af0ea3.tar.gz
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>
-rw-r--r--bitbake/lib/bb/fetch2/cvs.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/bitbake/lib/bb/fetch2/cvs.py b/bitbake/lib/bb/fetch2/cvs.py
index 09827e6053..0a014d1e9e 100644
--- a/bitbake/lib/bb/fetch2/cvs.py
+++ b/bitbake/lib/bb/fetch2/cvs.py
@@ -29,7 +29,6 @@ BitBake build tools.
29import os 29import os
30import logging 30import logging
31import bb 31import bb
32from bb import data
33from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger 32from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger
34from bb.fetch2 import runfetchcmd 33from bb.fetch2 import runfetchcmd
35 34
@@ -64,7 +63,7 @@ class Cvs(FetchMethod):
64 if 'fullpath' in ud.parm: 63 if 'fullpath' in ud.parm:
65 fullpath = '_fullpath' 64 fullpath = '_fullpath'
66 65
67 ud.localfile = data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d) 66 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)
68 67
69 def need_update(self, url, ud, d): 68 def need_update(self, url, ud, d):
70 if (ud.date == "now"): 69 if (ud.date == "now"):
@@ -88,10 +87,10 @@ class Cvs(FetchMethod):
88 cvsroot = ud.path 87 cvsroot = ud.path
89 else: 88 else:
90 cvsroot = ":" + method 89 cvsroot = ":" + method
91 cvsproxyhost = data.getVar('CVS_PROXY_HOST', d, True) 90 cvsproxyhost = d.getVar('CVS_PROXY_HOST', True)
92 if cvsproxyhost: 91 if cvsproxyhost:
93 cvsroot += ";proxy=" + cvsproxyhost 92 cvsroot += ";proxy=" + cvsproxyhost
94 cvsproxyport = data.getVar('CVS_PROXY_PORT', d, True) 93 cvsproxyport = d.getVar('CVS_PROXY_PORT', True)
95 if cvsproxyport: 94 if cvsproxyport:
96 cvsroot += ";proxyport=" + cvsproxyport 95 cvsroot += ";proxyport=" + cvsproxyport
97 cvsroot += ":" + ud.user 96 cvsroot += ":" + ud.user
@@ -121,8 +120,8 @@ class Cvs(FetchMethod):
121 120
122 # create module directory 121 # create module directory
123 logger.debug(2, "Fetch: checking for module directory") 122 logger.debug(2, "Fetch: checking for module directory")
124 pkg = data.expand('${PN}', d) 123 pkg = d.getVar('PN', True)
125 pkgdir = os.path.join(data.expand('${CVSDIR}', d), pkg) 124 pkgdir = os.path.join(d.getVar('CVSDIR', True), pkg)
126 moddir = os.path.join(pkgdir, localdir) 125 moddir = os.path.join(pkgdir, localdir)
127 if os.access(os.path.join(moddir, 'CVS'), os.R_OK): 126 if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
128 logger.info("Update " + loc) 127 logger.info("Update " + loc)
@@ -163,12 +162,9 @@ class Cvs(FetchMethod):
163 162
164 def clean(self, ud, d): 163 def clean(self, ud, d):
165 """ Clean CVS Files and tarballs """ 164 """ Clean CVS Files and tarballs """
166 165
167 pkg = data.expand('${PN}', d) 166 pkg = d.getVar('PN', True)
168 localdata = data.createCopy(d) 167 pkgdir = os.path.join(d.getVar("CVSDIR", True), pkg)
169 data.setVar('OVERRIDES', "cvs:%s" % data.getVar('OVERRIDES', localdata), localdata)
170 data.update_data(localdata)
171 pkgdir = os.path.join(data.expand('${CVSDIR}', localdata), pkg)
172 168
173 bb.utils.remove(pkgdir, True) 169 bb.utils.remove(pkgdir, True)
174 bb.utils.remove(ud.localpath) 170 bb.utils.remove(ud.localpath)