summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorVyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>2020-05-05 12:18:09 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-27 10:46:33 +0100
commit30eb63a414ed026cd90329069669b52251988620 (patch)
treefe1a91eb51f21c1dd535cfe1614e00c488da609f /bitbake/lib/bb/fetch2
parent4a8b8a405df5a06a23f57f250c297cd39ab7b1a4 (diff)
downloadpoky-30eb63a414ed026cd90329069669b52251988620.tar.gz
bitbake: fetch2/cvs: Fix CVS fetcher clean method
Clean method assumes that download directory should be determined from CVSDIR variable, but this is handled differently in download method. Now we set download directory for the whole class in urldata_init (Bitbake rev: 6d7ad9b06b82612f0dd17ffccea7ab98f9077198) Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/cvs.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch2/cvs.py b/bitbake/lib/bb/fetch2/cvs.py
index 29123a483c..22abdef792 100644
--- a/bitbake/lib/bb/fetch2/cvs.py
+++ b/bitbake/lib/bb/fetch2/cvs.py
@@ -51,6 +51,10 @@ class Cvs(FetchMethod):
51 51
52 ud.localfile = d.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath)) 52 ud.localfile = d.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath))
53 53
54 pkg = d.getVar('PN')
55 cvsdir = d.getVar("CVSDIR") or (d.getVar("DL_DIR") + "/cvs")
56 ud.pkgdir = os.path.join(cvsdir, pkg)
57
54 def need_update(self, ud, d): 58 def need_update(self, ud, d):
55 if (ud.date == "now"): 59 if (ud.date == "now"):
56 return True 60 return True
@@ -106,10 +110,7 @@ class Cvs(FetchMethod):
106 110
107 # create module directory 111 # create module directory
108 logger.debug(2, "Fetch: checking for module directory") 112 logger.debug(2, "Fetch: checking for module directory")
109 pkg = d.getVar('PN') 113 moddir = os.path.join(ud.pkgdir, localdir)
110 cvsdir = d.getVar("CVSDIR") or (d.getVar("DL_DIR") + "/cvs")
111 pkgdir = os.path.join(cvsdir, pkg)
112 moddir = os.path.join(pkgdir, localdir)
113 workdir = None 114 workdir = None
114 if os.access(os.path.join(moddir, 'CVS'), os.R_OK): 115 if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
115 logger.info("Update " + ud.url) 116 logger.info("Update " + ud.url)
@@ -120,8 +121,8 @@ class Cvs(FetchMethod):
120 else: 121 else:
121 logger.info("Fetch " + ud.url) 122 logger.info("Fetch " + ud.url)
122 # check out sources there 123 # check out sources there
123 bb.utils.mkdirhier(pkgdir) 124 bb.utils.mkdirhier(ud.pkgdir)
124 workdir = pkgdir 125 workdir = ud.pkgdir
125 logger.debug(1, "Running %s", cvscmd) 126 logger.debug(1, "Running %s", cvscmd)
126 bb.fetch2.check_network_access(d, cvscmd, ud.url) 127 bb.fetch2.check_network_access(d, cvscmd, ud.url)
127 cmd = cvscmd 128 cmd = cvscmd
@@ -140,7 +141,7 @@ class Cvs(FetchMethod):
140 # tar them up to a defined filename 141 # tar them up to a defined filename
141 workdir = None 142 workdir = None
142 if 'fullpath' in ud.parm: 143 if 'fullpath' in ud.parm:
143 workdir = pkgdir 144 workdir = ud.pkgdir
144 cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, localdir) 145 cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, localdir)
145 else: 146 else:
146 workdir = os.path.dirname(os.path.realpath(moddir)) 147 workdir = os.path.dirname(os.path.realpath(moddir))
@@ -151,9 +152,6 @@ class Cvs(FetchMethod):
151 def clean(self, ud, d): 152 def clean(self, ud, d):
152 """ Clean CVS Files and tarballs """ 153 """ Clean CVS Files and tarballs """
153 154
154 pkg = d.getVar('PN') 155 bb.utils.remove(ud.pkgdir, True)
155 pkgdir = os.path.join(d.getVar("CVSDIR"), pkg)
156
157 bb.utils.remove(pkgdir, True)
158 bb.utils.remove(ud.localpath) 156 bb.utils.remove(ud.localpath)
159 157