From: <mingli.yu@windriver.com>
To: <richard.purdie@linuxfoundation.org>,
<openembedded-core@lists.openembedded.org>
Subject: [PATCH v2] package_manager.py: correct the deploydir when packagefeed-stability inherited
Date: Wed, 24 Oct 2018 18:35:59 +0800 [thread overview]
Message-ID: <20181024103559.207644-1-mingli.yu@windriver.com> (raw)
In-Reply-To: <20181024071813.110075-1-mingli.yu@windriver.com>
From: Mingli Yu <Mingli.Yu@windriver.com>
After create_packages_dir added in below commit:
85e72e1 package_manager: Filter to only rpms we depend upon
When add below line into conf/local.conf
INHERIT += "packagefeed-stability"
There comes below error when do_rootfs
Exception: FileExistsError: [Errno 17] File exists: '/$Prj/tmp/deploy/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm' -> '/$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm'
In create_packages_dir function, there is a logic
as bb.utils.remove(subrepo_dir, recurse=True) to
clean subrepo_dir which is actually as example is
/$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm.
But currently when inherit packagefeed-stability class,
the parameter deploydir passed to create_packages_dir is
still /$Prj/tmp/deploy/rpm as example, it should be
/$Prj/tmp/deploy/rpm-diff. Otherwise, there is a logic
os.link(l, dest) in create_packages_dir function will
result in below logic:
os.link("/$Prj/tmp/deploy/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm", "/$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm")
Actually doesn't clean /$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm-prediff
, need to update the deploydir to make the
logic changed as below to fix the do_rootfs failure
s.link("/$Prj/tmp/deploy/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm", "/$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm/i586/initscripts-1.0-r155.i586.rpm")
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
---
meta/lib/oe/package_manager.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 2cc1c752b3..032d0d811b 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -733,8 +733,10 @@ class RpmPM(PackageManager):
self.primary_arch = self.d.getVar('MACHINE_ARCH')
self.rpm_repo_dir = oe.path.join(self.d.getVar('WORKDIR'), rpm_repo_workdir)
- create_packages_dir(self.d, oe.path.join(self.rpm_repo_dir, "rpm"), d.getVar("DEPLOY_DIR_RPM"), "package_write_rpm", filterbydependencies)
-
+ deploy_prepath = d.getVar("DEPLOY_DIR_RPM")
+ if bb.data.inherits_class('packagefeed-stability', d):
+ deploy_prepath = deploy_prepath + "-prediff"
+ create_packages_dir(self.d, oe.path.join(self.rpm_repo_dir, "rpm"), deploy_prepath, "package_write_rpm", filterbydependencies)
self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name)
if not os.path.exists(self.d.expand('${T}/saved_packaging_data')):
bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data'))
@@ -1147,9 +1149,12 @@ class OpkgPM(OpkgDpkgPM):
self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs)
self.opkg_args += self.d.getVar("OPKG_ARGS")
+ deploy_prepath = d.getVar("DEPLOY_DIR_IPK")
+ if bb.data.inherits_class('packagefeed-stability', d):
+ deploy_prepath = deploy_prepath + "-prediff"
if prepare_index:
- create_packages_dir(self.d, self.deploy_dir, d.getVar("DEPLOY_DIR_IPK"), "package_write_ipk", filterbydependencies)
+ create_packages_dir(self.d, self.deploy_dir, deploy_prepath, "package_write_ipk", filterbydependencies)
opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
if opkg_lib_dir[0] == "/":
@@ -1526,7 +1531,10 @@ class DpkgPM(OpkgDpkgPM):
super(DpkgPM, self).__init__(d, target_rootfs)
self.deploy_dir = oe.path.join(self.d.getVar('WORKDIR'), deb_repo_workdir)
- create_packages_dir(self.d, self.deploy_dir, d.getVar("DEPLOY_DIR_DEB"), "package_write_deb", filterbydependencies)
+ deploy_prepath = d.getVar("DEPLOY_DIR_DEB")
+ if bb.data.inherits_class('packagefeed-stability', d):
+ deploy_prepath = deploy_prepath + "-prediff"
+ create_packages_dir(self.d, self.deploy_dir, deploy_prepath, "package_write_deb", filterbydependencies)
if apt_conf_dir is None:
self.apt_conf_dir = self.d.expand("${APTCONF_TARGET}/apt")
--
2.18.0
next prev parent reply other threads:[~2018-10-24 10:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 7:18 [PATCH] package_manager.py: check the dest before create hard link mingli.yu
2018-10-24 10:35 ` mingli.yu [this message]
2018-10-24 10:38 ` [PATCH v2] package_manager.py: correct the deploydir when packagefeed-stability inherited Yu, Mingli
2018-10-24 10:38 ` [PATCH v3] " mingli.yu
2018-10-25 6:18 ` [PATCH v4] " mingli.yu
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=20181024103559.207644-1-mingli.yu@windriver.com \
--to=mingli.yu@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.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.