summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-14 14:55:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 09:44:33 +0100
commitad6b73702934c0bb10afe66e13936d1313782352 (patch)
tree5543bfa491b5427585e960fdc66ca15dee7bd36a
parent71d87cce855eb755533d3b55a761c09e76e3cd83 (diff)
downloadpoky-ad6b73702934c0bb10afe66e13936d1313782352.tar.gz
package_manager: Remove rpm specific pieces of create_packages_dir()
This function is generic, tweak the variable names and move out the rpm specific directory name to make it truly generic and reusable for deb/ipk. (From OE-Core rev: dba876639b1fb8ea3ccb182c91e19966c4052115) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/package_manager.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 6011e87350..f1dbe48a72 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -621,7 +621,7 @@ class PackageManager(object, metaclass=ABCMeta):
621 return res 621 return res
622 return _append(uris, base_paths) 622 return _append(uris, base_paths)
623 623
624def create_packages_dir(d, rpm_repo_dir, deploydir, taskname, filterbydependencies): 624def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies):
625 """ 625 """
626 Go through our do_package_write_X dependencies and hardlink the packages we depend 626 Go through our do_package_write_X dependencies and hardlink the packages we depend
627 upon into the repo directory. This prevents us seeing other packages that may 627 upon into the repo directory. This prevents us seeing other packages that may
@@ -636,15 +636,13 @@ def create_packages_dir(d, rpm_repo_dir, deploydir, taskname, filterbydependenci
636 seendirs = set() 636 seendirs = set()
637 multilibs = {} 637 multilibs = {}
638 638
639 rpm_subrepo_dir = oe.path.join(rpm_repo_dir, "rpm") 639 bb.utils.remove(subrepo_dir, recurse=True)
640 640 bb.utils.mkdirhier(subrepo_dir)
641 bb.utils.remove(rpm_subrepo_dir, recurse=True)
642 bb.utils.mkdirhier(rpm_subrepo_dir)
643 641
644 # Detect bitbake -b usage 642 # Detect bitbake -b usage
645 nodeps = d.getVar("BB_LIMITEDDEPS") or False 643 nodeps = d.getVar("BB_LIMITEDDEPS") or False
646 if nodeps or not filterbydependencies: 644 if nodeps or not filterbydependencies:
647 oe.path.symlink(deploydir, rpm_subrepo_dir, True) 645 oe.path.symlink(deploydir, subrepo_dir, True)
648 return 646 return
649 647
650 start = None 648 start = None
@@ -655,24 +653,24 @@ def create_packages_dir(d, rpm_repo_dir, deploydir, taskname, filterbydependenci
655 break 653 break
656 if start is None: 654 if start is None:
657 bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") 655 bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
658 rpmdeps = set() 656 pkgdeps = set()
659 start = [start] 657 start = [start]
660 seen = set(start) 658 seen = set(start)
661 # Support direct dependencies (do_rootfs -> rpms) 659 # Support direct dependencies (do_rootfs -> do_package_write_X)
662 # or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> rpms) 660 # or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> do_package_write_X)
663 while start: 661 while start:
664 next = [] 662 next = []
665 for dep2 in start: 663 for dep2 in start:
666 for dep in taskdepdata[dep2][3]: 664 for dep in taskdepdata[dep2][3]:
667 if taskdepdata[dep][0] != pn: 665 if taskdepdata[dep][0] != pn:
668 if "do_" + taskname in dep: 666 if "do_" + taskname in dep:
669 rpmdeps.add(dep) 667 pkgdeps.add(dep)
670 elif dep not in seen: 668 elif dep not in seen:
671 next.append(dep) 669 next.append(dep)
672 seen.add(dep) 670 seen.add(dep)
673 start = next 671 start = next
674 672
675 for dep in rpmdeps: 673 for dep in pkgdeps:
676 c = taskdepdata[dep][0] 674 c = taskdepdata[dep][0]
677 manifest, d2 = oe.sstatesig.find_sstate_manifest(c, taskdepdata[dep][2], taskname, d, multilibs) 675 manifest, d2 = oe.sstatesig.find_sstate_manifest(c, taskdepdata[dep][2], taskname, d, multilibs)
678 if not manifest: 676 if not manifest:
@@ -683,7 +681,7 @@ def create_packages_dir(d, rpm_repo_dir, deploydir, taskname, filterbydependenci
683 for l in f: 681 for l in f:
684 l = l.strip() 682 l = l.strip()
685 dest = l.replace(deploydir, "") 683 dest = l.replace(deploydir, "")
686 dest = rpm_subrepo_dir + dest 684 dest = subrepo_dir + dest
687 if l.endswith("/"): 685 if l.endswith("/"):
688 if dest not in seendirs: 686 if dest not in seendirs:
689 bb.utils.mkdirhier(dest) 687 bb.utils.mkdirhier(dest)
@@ -725,7 +723,7 @@ class RpmPM(PackageManager):
725 self.primary_arch = self.d.getVar('MACHINE_ARCH') 723 self.primary_arch = self.d.getVar('MACHINE_ARCH')
726 724
727 self.rpm_repo_dir = oe.path.join(self.d.getVar('WORKDIR'), rpm_repo_workdir) 725 self.rpm_repo_dir = oe.path.join(self.d.getVar('WORKDIR'), rpm_repo_workdir)
728 create_packages_dir(self.d, self.rpm_repo_dir, d.getVar("DEPLOY_DIR_RPM"), "package_write_rpm", filterbydependencies) 726 create_packages_dir(self.d, oe.path.join(self.rpm_repo_dir, "rpm"), d.getVar("DEPLOY_DIR_RPM"), "package_write_rpm", filterbydependencies)
729 727
730 self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name) 728 self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name)
731 if not os.path.exists(self.d.expand('${T}/saved_packaging_data')): 729 if not os.path.exists(self.d.expand('${T}/saved_packaging_data')):