Skip to contentSkip to conversation

package_manager.py: fix bitbake package-index failed

PATCH In review Hongxu Jia 2 participants 3 messages Sep 13, 2016

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover package_manager.py: fix bitbake package-index failed

The following changes since commit 2679a347c576f5411fbe802d2f6201c94036ecb2:

maintainers.inc: rename gtk-doc-stub to gtk-doc, reassign to me (2016-09-09 12:12:59 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib hongxu/package-index
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=hongxu/package-index

Hongxu Jia (1):
package_manager.py: fix bitbake package-index failed

 meta/lib/oe/package_manager.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.8.1
author
#1 lore raw

PATCH 1/1 package_manager.py: fix bitbake package-index failed

Previously the following commit in oe-core move RPM metadata from DEPLOY_DIR to WORKDIR.
-----------
commit a92c196449c516fe51786d429078bbb1213bb029

Author: Stephano Cetola <[email protected]>
Date:   Wed Aug 10 13:03:16 2016 -0700

Allow for simultaneous do_rootfs tasks with rpm

Give each rootfs its own RPM channel to use. This puts the RPM metadata in a private subdirectory of $WORKDIR, rather than living in DEPLOY_DIR where other tasks may race with it.
-----------

In the modification of 'class RpmIndexer, it should not directly set arch_dir with WORKDIR. It caused 'bitbake package-index' could not work correctly.

Assign WORKDIR as input parameter at RpmIndexer initial time could fix the issue.

---
 meta/lib/oe/package_manager.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/lib/oe/package_manager.py +3 -2
index 2802254..30e1de9 100644
@@ -176,7 +176,7 @@ class RpmIndexer(Indexer):
             dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch)
             if os.path.exists(dbpath):
                 bb.utils.remove(dbpath, True)
-            arch_dir = os.path.join(self.d.getVar('WORKDIR', True), 'rpms', arch)
+            arch_dir = os.path.join(self.deploy_dir, arch)
             if not os.path.isdir(arch_dir):
                 continue
 
@@ -686,7 +686,8 @@ class RpmPM(PackageManager):
         if not os.path.exists(self.d.expand('${T}/saved')):
             bb.utils.mkdirhier(self.d.expand('${T}/saved'))
 
-        self.indexer = RpmIndexer(self.d, self.deploy_dir)
+        packageindex_dir = os.path.join(self.d.getVar('WORKDIR', True), 'rpms')
+        self.indexer = RpmIndexer(self.d, packageindex_dir)
         self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var)
 
         self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
Signature · 1 line
2.8.1
#2 lore raw

FYI this is fixing Yocto Project defect 10258.

--Mark

Quoted 50 lines · Hongxu Jia

Previously the following commit in oe-core move RPM metadata from DEPLOY_DIR to WORKDIR.
-----------
commit a92c196449c516fe51786d429078bbb1213bb029

Author: Stephano Cetola <[email protected]>
Date:   Wed Aug 10 13:03:16 2016 -0700

Allow for simultaneous do_rootfs tasks with rpm

Give each rootfs its own RPM channel to use. This puts the RPM metadata in a private subdirectory of $WORKDIR, rather than living in DEPLOY_DIR where other tasks may race with it.
-----------

In the modification of 'class RpmIndexer, it should not directly set arch_dir with WORKDIR. It caused 'bitbake package-index' could not work correctly.

Assign WORKDIR as input parameter at RpmIndexer initial time could fix the issue.

---
 meta/lib/oe/package_manager.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/lib/oe/package_manager.py +3 -2
index 2802254..30e1de9 100644
@@ -176,7 +176,7 @@ class RpmIndexer(Indexer):
             dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch)
             if os.path.exists(dbpath):
                 bb.utils.remove(dbpath, True)
-            arch_dir = os.path.join(self.d.getVar('WORKDIR', True), 'rpms', arch)
+            arch_dir = os.path.join(self.deploy_dir, arch)
             if not os.path.isdir(arch_dir):
                 continue
 
@@ -686,7 +686,8 @@ class RpmPM(PackageManager):
         if not os.path.exists(self.d.expand('${T}/saved')):
             bb.utils.mkdirhier(self.d.expand('${T}/saved'))
 
-        self.indexer = RpmIndexer(self.d, self.deploy_dir)
+        packageindex_dir = os.path.join(self.d.getVar('WORKDIR', True), 'rpms')
+        self.indexer = RpmIndexer(self.d, packageindex_dir)
         self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var)
 
         self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)