diff options
author | Anibal Limon <anibal.ezau.limon.belmares@linux.intel.com> | 2014-09-29 14:28:17 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-09-30 14:33:31 +0100 |
commit | c34775f8864f9bf9a2b32af1e3a803f7d84e11ba (patch) | |
tree | d33ab3f2e342606eca693f9d732c7ddaa86909aa /meta/lib | |
parent | a08bf9a13673dd6eafc87062f078d3f9fd6c9a60 (diff) | |
download | poky-c34775f8864f9bf9a2b32af1e3a803f7d84e11ba.tar.gz |
deb_packaging: Added support for multilib
The Package Manager implementation for deb didn't
take a look about multilib enabled variants.
Changes are made for generate apt.conf, sources.list and
debian repo index Release and Packages files.
[YOCTO #1502]
(From OE-Core rev: b5fb879b351cc23977f3e441f758101551297566)
Signed-off-by: Anibal Limon <anibal.ezau.limon.belmares@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/package_manager.py | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index b3b3b2de80..27fdf26e07 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -167,6 +167,9 @@ class DpkgIndexer(Indexer): | |||
167 | if a not in pkg_archs: | 167 | if a not in pkg_archs: |
168 | arch_list.append(a) | 168 | arch_list.append(a) |
169 | 169 | ||
170 | all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split() | ||
171 | arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in arch_list) | ||
172 | |||
170 | apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive") | 173 | apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive") |
171 | gzip = bb.utils.which(os.getenv('PATH'), "gzip") | 174 | gzip = bb.utils.which(os.getenv('PATH'), "gzip") |
172 | 175 | ||
@@ -1474,6 +1477,10 @@ class DpkgPM(PackageManager): | |||
1474 | 1477 | ||
1475 | self.apt_args = d.getVar("APT_ARGS", True) | 1478 | self.apt_args = d.getVar("APT_ARGS", True) |
1476 | 1479 | ||
1480 | self.all_arch_list = self.d.getVar('PACKAGE_ARCHS', True).split() | ||
1481 | all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split() | ||
1482 | self.all_arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in self.all_arch_list) | ||
1483 | |||
1477 | self._create_configs(archs, base_archs) | 1484 | self._create_configs(archs, base_archs) |
1478 | 1485 | ||
1479 | self.indexer = DpkgIndexer(self.d, self.deploy_dir) | 1486 | self.indexer = DpkgIndexer(self.d, self.deploy_dir) |
@@ -1631,8 +1638,8 @@ class DpkgPM(PackageManager): | |||
1631 | sources_conf = os.path.join("%s/etc/apt/sources.list" | 1638 | sources_conf = os.path.join("%s/etc/apt/sources.list" |
1632 | % self.target_rootfs) | 1639 | % self.target_rootfs) |
1633 | arch_list = [] | 1640 | arch_list = [] |
1634 | archs = self.d.getVar('PACKAGE_ARCHS', True) | 1641 | |
1635 | for arch in archs.split(): | 1642 | for arch in self.all_arch_list: |
1636 | if not os.path.exists(os.path.join(self.deploy_dir, arch)): | 1643 | if not os.path.exists(os.path.join(self.deploy_dir, arch)): |
1637 | continue | 1644 | continue |
1638 | arch_list.append(arch) | 1645 | arch_list.append(arch) |
@@ -1655,7 +1662,7 @@ class DpkgPM(PackageManager): | |||
1655 | bb.utils.mkdirhier(self.apt_conf_dir + "/apt.conf.d/") | 1662 | bb.utils.mkdirhier(self.apt_conf_dir + "/apt.conf.d/") |
1656 | 1663 | ||
1657 | arch_list = [] | 1664 | arch_list = [] |
1658 | for arch in archs.split(): | 1665 | for arch in self.all_arch_list: |
1659 | if not os.path.exists(os.path.join(self.deploy_dir, arch)): | 1666 | if not os.path.exists(os.path.join(self.deploy_dir, arch)): |
1660 | continue | 1667 | continue |
1661 | arch_list.append(arch) | 1668 | arch_list.append(arch) |
@@ -1684,15 +1691,25 @@ class DpkgPM(PackageManager): | |||
1684 | sources_file.write("deb file:%s/ ./\n" % | 1691 | sources_file.write("deb file:%s/ ./\n" % |
1685 | os.path.join(self.deploy_dir, arch)) | 1692 | os.path.join(self.deploy_dir, arch)) |
1686 | 1693 | ||
1694 | base_arch_list = base_archs.split() | ||
1695 | multilib_variants = self.d.getVar("MULTILIB_VARIANTS", True); | ||
1696 | for variant in multilib_variants.split(): | ||
1697 | if variant == "lib32": | ||
1698 | base_arch_list.append("i386") | ||
1699 | elif variant == "lib64": | ||
1700 | base_arch_list.append("amd64") | ||
1701 | |||
1687 | with open(self.apt_conf_file, "w+") as apt_conf: | 1702 | with open(self.apt_conf_file, "w+") as apt_conf: |
1688 | with open(self.d.expand("${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample")) as apt_conf_sample: | 1703 | with open(self.d.expand("${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample")) as apt_conf_sample: |
1689 | for line in apt_conf_sample.read().split("\n"): | 1704 | for line in apt_conf_sample.read().split("\n"): |
1690 | line = re.sub("Architecture \".*\";", | 1705 | match_arch = re.match(" Architecture \".*\";$", line) |
1691 | "Architecture \"%s\";" % base_archs, line) | 1706 | if match_arch: |
1692 | line = re.sub("#ROOTFS#", self.target_rootfs, line) | 1707 | for base_arch in base_arch_list: |
1693 | line = re.sub("#APTCONF#", self.apt_conf_dir, line) | 1708 | apt_conf.write(" Architecture \"%s\";\n" % base_arch) |
1694 | 1709 | else: | |
1695 | apt_conf.write(line + "\n") | 1710 | line = re.sub("#ROOTFS#", self.target_rootfs, line) |
1711 | line = re.sub("#APTCONF#", self.apt_conf_dir, line) | ||
1712 | apt_conf.write(line + "\n") | ||
1696 | 1713 | ||
1697 | target_dpkg_dir = "%s/var/lib/dpkg" % self.target_rootfs | 1714 | target_dpkg_dir = "%s/var/lib/dpkg" % self.target_rootfs |
1698 | bb.utils.mkdirhier(os.path.join(target_dpkg_dir, "info")) | 1715 | bb.utils.mkdirhier(os.path.join(target_dpkg_dir, "info")) |