From: "Vyacheslav Yurkov" <uvv.mail@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
Subject: [PATCH] bitbake: fetch2: Fix CVS fetcher clean method
Date: Tue, 5 May 2020 12:18:09 +0200 [thread overview]
Message-ID: <20200505101809.702174-1-uvv.mail@gmail.com> (raw)
From: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
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
Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
---
bitbake/lib/bb/fetch2/cvs.py | 20 +++++++++-----------
1 file 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):
ud.localfile = d.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath))
+ pkg = d.getVar('PN')
+ cvsdir = d.getVar("CVSDIR") or (d.getVar("DL_DIR") + "/cvs")
+ ud.pkgdir = os.path.join(cvsdir, pkg)
+
def need_update(self, ud, d):
if (ud.date == "now"):
return True
@@ -106,10 +110,7 @@ class Cvs(FetchMethod):
# create module directory
logger.debug(2, "Fetch: checking for module directory")
- pkg = d.getVar('PN')
- cvsdir = d.getVar("CVSDIR") or (d.getVar("DL_DIR") + "/cvs")
- pkgdir = os.path.join(cvsdir, pkg)
- moddir = os.path.join(pkgdir, localdir)
+ moddir = os.path.join(ud.pkgdir, localdir)
workdir = None
if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
logger.info("Update " + ud.url)
@@ -120,8 +121,8 @@ class Cvs(FetchMethod):
else:
logger.info("Fetch " + ud.url)
# check out sources there
- bb.utils.mkdirhier(pkgdir)
- workdir = pkgdir
+ bb.utils.mkdirhier(ud.pkgdir)
+ workdir = ud.pkgdir
logger.debug(1, "Running %s", cvscmd)
bb.fetch2.check_network_access(d, cvscmd, ud.url)
cmd = cvscmd
@@ -140,7 +141,7 @@ class Cvs(FetchMethod):
# tar them up to a defined filename
workdir = None
if 'fullpath' in ud.parm:
- workdir = pkgdir
+ workdir = ud.pkgdir
cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, localdir)
else:
workdir = os.path.dirname(os.path.realpath(moddir))
@@ -151,9 +152,6 @@ class Cvs(FetchMethod):
def clean(self, ud, d):
""" Clean CVS Files and tarballs """
- pkg = d.getVar('PN')
- pkgdir = os.path.join(d.getVar("CVSDIR"), pkg)
-
- bb.utils.remove(pkgdir, True)
+ bb.utils.remove(ud.pkgdir, True)
bb.utils.remove(ud.localpath)
--
2.25.1
next reply other threads:[~2020-05-05 10:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 10:18 Vyacheslav Yurkov [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-05-04 16:44 [PATCH] bitbake: fetch2: Fix CVS fetcher clean method Vyacheslav Yurkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200505101809.702174-1-uvv.mail@gmail.com \
--to=uvv.mail@gmail.com \
--cc=Vyacheslav.Yurkov@bruker.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.