diff options
Diffstat (limited to 'meta/lib/oe/package_manager.py')
| -rw-r--r-- | meta/lib/oe/package_manager.py | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index e5e3c3b679..bb458691e3 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
| @@ -107,16 +107,16 @@ class RpmIndexer(Indexer): | |||
| 107 | target_os = collections.OrderedDict() | 107 | target_os = collections.OrderedDict() |
| 108 | 108 | ||
| 109 | if arch_var is not None and os_var is not None: | 109 | if arch_var is not None and os_var is not None: |
| 110 | package_archs['default'] = self.d.getVar(arch_var, True).split() | 110 | package_archs['default'] = self.d.getVar(arch_var).split() |
| 111 | package_archs['default'].reverse() | 111 | package_archs['default'].reverse() |
| 112 | target_os['default'] = self.d.getVar(os_var, True).strip() | 112 | target_os['default'] = self.d.getVar(os_var).strip() |
| 113 | else: | 113 | else: |
| 114 | package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split() | 114 | package_archs['default'] = self.d.getVar("PACKAGE_ARCHS").split() |
| 115 | # arch order is reversed. This ensures the -best- match is | 115 | # arch order is reversed. This ensures the -best- match is |
| 116 | # listed first! | 116 | # listed first! |
| 117 | package_archs['default'].reverse() | 117 | package_archs['default'].reverse() |
| 118 | target_os['default'] = self.d.getVar("TARGET_OS", True).strip() | 118 | target_os['default'] = self.d.getVar("TARGET_OS").strip() |
| 119 | multilibs = self.d.getVar('MULTILIBS', True) or "" | 119 | multilibs = self.d.getVar('MULTILIBS') or "" |
| 120 | for ext in multilibs.split(): | 120 | for ext in multilibs.split(): |
| 121 | eext = ext.split(':') | 121 | eext = ext.split(':') |
| 122 | if len(eext) > 1 and eext[0] == 'multilib': | 122 | if len(eext) > 1 and eext[0] == 'multilib': |
| @@ -150,8 +150,8 @@ class RpmIndexer(Indexer): | |||
| 150 | return (ml_prefix_list, target_os) | 150 | return (ml_prefix_list, target_os) |
| 151 | 151 | ||
| 152 | def write_index(self): | 152 | def write_index(self): |
| 153 | sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS', True) or "").replace('-', '_').split() | 153 | sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS') or "").replace('-', '_').split() |
| 154 | all_mlb_pkg_archs = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split() | 154 | all_mlb_pkg_archs = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or "").replace('-', '_').split() |
| 155 | 155 | ||
| 156 | mlb_prefix_list = self.get_ml_prefix_and_os_list()[0] | 156 | mlb_prefix_list = self.get_ml_prefix_and_os_list()[0] |
| 157 | 157 | ||
| @@ -165,15 +165,15 @@ class RpmIndexer(Indexer): | |||
| 165 | archs = archs.union(set(sdk_pkg_archs)) | 165 | archs = archs.union(set(sdk_pkg_archs)) |
| 166 | 166 | ||
| 167 | rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo") | 167 | rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo") |
| 168 | if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1': | 168 | if self.d.getVar('PACKAGE_FEED_SIGN') == '1': |
| 169 | signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True)) | 169 | signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND')) |
| 170 | else: | 170 | else: |
| 171 | signer = None | 171 | signer = None |
| 172 | index_cmds = [] | 172 | index_cmds = [] |
| 173 | repomd_files = [] | 173 | repomd_files = [] |
| 174 | rpm_dirs_found = False | 174 | rpm_dirs_found = False |
| 175 | for arch in archs: | 175 | for arch in archs: |
| 176 | dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch) | 176 | dbpath = os.path.join(self.d.getVar('WORKDIR'), 'rpmdb', arch) |
| 177 | if os.path.exists(dbpath): | 177 | if os.path.exists(dbpath): |
| 178 | bb.utils.remove(dbpath, True) | 178 | bb.utils.remove(dbpath, True) |
| 179 | arch_dir = os.path.join(self.deploy_dir, arch) | 179 | arch_dir = os.path.join(self.deploy_dir, arch) |
| @@ -197,11 +197,11 @@ class RpmIndexer(Indexer): | |||
| 197 | # Sign repomd | 197 | # Sign repomd |
| 198 | if signer: | 198 | if signer: |
| 199 | for repomd in repomd_files: | 199 | for repomd in repomd_files: |
| 200 | feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE', True) | 200 | feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE') |
| 201 | is_ascii_sig = (feed_sig_type.upper() != "BIN") | 201 | is_ascii_sig = (feed_sig_type.upper() != "BIN") |
| 202 | signer.detach_sign(repomd, | 202 | signer.detach_sign(repomd, |
| 203 | self.d.getVar('PACKAGE_FEED_GPG_NAME', True), | 203 | self.d.getVar('PACKAGE_FEED_GPG_NAME'), |
| 204 | self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True), | 204 | self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'), |
| 205 | armor=is_ascii_sig) | 205 | armor=is_ascii_sig) |
| 206 | 206 | ||
| 207 | 207 | ||
| @@ -212,8 +212,8 @@ class OpkgIndexer(Indexer): | |||
| 212 | "MULTILIB_ARCHS"] | 212 | "MULTILIB_ARCHS"] |
| 213 | 213 | ||
| 214 | opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index") | 214 | opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index") |
| 215 | if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1': | 215 | if self.d.getVar('PACKAGE_FEED_SIGN') == '1': |
| 216 | signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True)) | 216 | signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND')) |
| 217 | else: | 217 | else: |
| 218 | signer = None | 218 | signer = None |
| 219 | 219 | ||
| @@ -223,7 +223,7 @@ class OpkgIndexer(Indexer): | |||
| 223 | index_cmds = set() | 223 | index_cmds = set() |
| 224 | index_sign_files = set() | 224 | index_sign_files = set() |
| 225 | for arch_var in arch_vars: | 225 | for arch_var in arch_vars: |
| 226 | archs = self.d.getVar(arch_var, True) | 226 | archs = self.d.getVar(arch_var) |
| 227 | if archs is None: | 227 | if archs is None: |
| 228 | continue | 228 | continue |
| 229 | 229 | ||
| @@ -251,12 +251,12 @@ class OpkgIndexer(Indexer): | |||
| 251 | bb.fatal('%s' % ('\n'.join(result))) | 251 | bb.fatal('%s' % ('\n'.join(result))) |
| 252 | 252 | ||
| 253 | if signer: | 253 | if signer: |
| 254 | feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE', True) | 254 | feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE') |
| 255 | is_ascii_sig = (feed_sig_type.upper() != "BIN") | 255 | is_ascii_sig = (feed_sig_type.upper() != "BIN") |
| 256 | for f in index_sign_files: | 256 | for f in index_sign_files: |
| 257 | signer.detach_sign(f, | 257 | signer.detach_sign(f, |
| 258 | self.d.getVar('PACKAGE_FEED_GPG_NAME', True), | 258 | self.d.getVar('PACKAGE_FEED_GPG_NAME'), |
| 259 | self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True), | 259 | self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'), |
| 260 | armor=is_ascii_sig) | 260 | armor=is_ascii_sig) |
| 261 | 261 | ||
| 262 | 262 | ||
| @@ -290,16 +290,16 @@ class DpkgIndexer(Indexer): | |||
| 290 | 290 | ||
| 291 | os.environ['APT_CONFIG'] = self.apt_conf_file | 291 | os.environ['APT_CONFIG'] = self.apt_conf_file |
| 292 | 292 | ||
| 293 | pkg_archs = self.d.getVar('PACKAGE_ARCHS', True) | 293 | pkg_archs = self.d.getVar('PACKAGE_ARCHS') |
| 294 | if pkg_archs is not None: | 294 | if pkg_archs is not None: |
| 295 | arch_list = pkg_archs.split() | 295 | arch_list = pkg_archs.split() |
| 296 | sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS', True) | 296 | sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS') |
| 297 | if sdk_pkg_archs is not None: | 297 | if sdk_pkg_archs is not None: |
| 298 | for a in sdk_pkg_archs.split(): | 298 | for a in sdk_pkg_archs.split(): |
| 299 | if a not in pkg_archs: | 299 | if a not in pkg_archs: |
| 300 | arch_list.append(a) | 300 | arch_list.append(a) |
| 301 | 301 | ||
| 302 | all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").split() | 302 | all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or "").split() |
| 303 | arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in arch_list) | 303 | arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in arch_list) |
| 304 | 304 | ||
| 305 | apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive") | 305 | apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive") |
| @@ -332,7 +332,7 @@ class DpkgIndexer(Indexer): | |||
| 332 | result = oe.utils.multiprocess_exec(index_cmds, create_index) | 332 | result = oe.utils.multiprocess_exec(index_cmds, create_index) |
| 333 | if result: | 333 | if result: |
| 334 | bb.fatal('%s' % ('\n'.join(result))) | 334 | bb.fatal('%s' % ('\n'.join(result))) |
| 335 | if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1': | 335 | if self.d.getVar('PACKAGE_FEED_SIGN') == '1': |
| 336 | raise NotImplementedError('Package feed signing not implementd for dpkg') | 336 | raise NotImplementedError('Package feed signing not implementd for dpkg') |
| 337 | 337 | ||
| 338 | 338 | ||
| @@ -386,7 +386,7 @@ class RpmPkgsList(PkgsList): | |||
| 386 | 386 | ||
| 387 | # Workaround for bug 3565. Simply look to see if we | 387 | # Workaround for bug 3565. Simply look to see if we |
| 388 | # know of a package with that name, if not try again! | 388 | # know of a package with that name, if not try again! |
| 389 | filename = os.path.join(self.d.getVar('PKGDATA_DIR', True), | 389 | filename = os.path.join(self.d.getVar('PKGDATA_DIR'), |
| 390 | 'runtime-reverse', | 390 | 'runtime-reverse', |
| 391 | new_pkg) | 391 | new_pkg) |
| 392 | if os.path.exists(filename): | 392 | if os.path.exists(filename): |
| @@ -464,7 +464,7 @@ class OpkgPkgsList(PkgsList): | |||
| 464 | 464 | ||
| 465 | self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg") | 465 | self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg") |
| 466 | self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir) | 466 | self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir) |
| 467 | self.opkg_args += self.d.getVar("OPKG_ARGS", True) | 467 | self.opkg_args += self.d.getVar("OPKG_ARGS") |
| 468 | 468 | ||
| 469 | def list_pkgs(self, format=None): | 469 | def list_pkgs(self, format=None): |
| 470 | cmd = "%s %s status" % (self.opkg_cmd, self.opkg_args) | 470 | cmd = "%s %s status" % (self.opkg_cmd, self.opkg_args) |
| @@ -512,9 +512,9 @@ class PackageManager(object, metaclass=ABCMeta): | |||
| 512 | self.d = d | 512 | self.d = d |
| 513 | self.deploy_dir = None | 513 | self.deploy_dir = None |
| 514 | self.deploy_lock = None | 514 | self.deploy_lock = None |
| 515 | self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS', True) or "" | 515 | self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS') or "" |
| 516 | self.feed_base_paths = self.d.getVar('PACKAGE_FEED_BASE_PATHS', True) or "" | 516 | self.feed_base_paths = self.d.getVar('PACKAGE_FEED_BASE_PATHS') or "" |
| 517 | self.feed_archs = self.d.getVar('PACKAGE_FEED_ARCHS', True) | 517 | self.feed_archs = self.d.getVar('PACKAGE_FEED_ARCHS') |
| 518 | 518 | ||
| 519 | """ | 519 | """ |
| 520 | Update the package manager package database. | 520 | Update the package manager package database. |
| @@ -568,7 +568,7 @@ class PackageManager(object, metaclass=ABCMeta): | |||
| 568 | def install_complementary(self, globs=None): | 568 | def install_complementary(self, globs=None): |
| 569 | # we need to write the list of installed packages to a file because the | 569 | # we need to write the list of installed packages to a file because the |
| 570 | # oe-pkgdata-util reads it from a file | 570 | # oe-pkgdata-util reads it from a file |
| 571 | installed_pkgs_file = os.path.join(self.d.getVar('WORKDIR', True), | 571 | installed_pkgs_file = os.path.join(self.d.getVar('WORKDIR'), |
| 572 | "installed_pkgs.txt") | 572 | "installed_pkgs.txt") |
| 573 | with open(installed_pkgs_file, "w+") as installed_pkgs: | 573 | with open(installed_pkgs_file, "w+") as installed_pkgs: |
| 574 | pkgs = self.list_installed() | 574 | pkgs = self.list_installed() |
| @@ -576,10 +576,10 @@ class PackageManager(object, metaclass=ABCMeta): | |||
| 576 | installed_pkgs.write(output) | 576 | installed_pkgs.write(output) |
| 577 | 577 | ||
| 578 | if globs is None: | 578 | if globs is None: |
| 579 | globs = self.d.getVar('IMAGE_INSTALL_COMPLEMENTARY', True) | 579 | globs = self.d.getVar('IMAGE_INSTALL_COMPLEMENTARY') |
| 580 | split_linguas = set() | 580 | split_linguas = set() |
| 581 | 581 | ||
| 582 | for translation in self.d.getVar('IMAGE_LINGUAS', True).split(): | 582 | for translation in self.d.getVar('IMAGE_LINGUAS').split(): |
| 583 | split_linguas.add(translation) | 583 | split_linguas.add(translation) |
| 584 | split_linguas.add(translation.split('-')[0]) | 584 | split_linguas.add(translation.split('-')[0]) |
| 585 | 585 | ||
| @@ -592,9 +592,9 @@ class PackageManager(object, metaclass=ABCMeta): | |||
| 592 | return | 592 | return |
| 593 | 593 | ||
| 594 | cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"), | 594 | cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"), |
| 595 | "-p", self.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file, | 595 | "-p", self.d.getVar('PKGDATA_DIR'), "glob", installed_pkgs_file, |
| 596 | globs] | 596 | globs] |
| 597 | exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY', True) | 597 | exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY') |
| 598 | if exclude: | 598 | if exclude: |
| 599 | cmd.extend(['--exclude=' + '|'.join(exclude.split())]) | 599 | cmd.extend(['--exclude=' + '|'.join(exclude.split())]) |
| 600 | try: | 600 | try: |
| @@ -659,7 +659,7 @@ class RpmPM(PackageManager): | |||
| 659 | self.task_name = task_name | 659 | self.task_name = task_name |
| 660 | self.providename = providename | 660 | self.providename = providename |
| 661 | self.fullpkglist = list() | 661 | self.fullpkglist = list() |
| 662 | self.deploy_dir = self.d.getVar('DEPLOY_DIR_RPM', True) | 662 | self.deploy_dir = self.d.getVar('DEPLOY_DIR_RPM') |
| 663 | self.etcrpm_dir = os.path.join(self.target_rootfs, "etc/rpm") | 663 | self.etcrpm_dir = os.path.join(self.target_rootfs, "etc/rpm") |
| 664 | self.install_dir_name = "oe_install" | 664 | self.install_dir_name = "oe_install" |
| 665 | self.install_dir_path = os.path.join(self.target_rootfs, self.install_dir_name) | 665 | self.install_dir_path = os.path.join(self.target_rootfs, self.install_dir_name) |
| @@ -669,7 +669,7 @@ class RpmPM(PackageManager): | |||
| 669 | # 1 = --log-level=info (includes information about executing scriptlets and their output) | 669 | # 1 = --log-level=info (includes information about executing scriptlets and their output) |
| 670 | # 2 = --log-level=debug | 670 | # 2 = --log-level=debug |
| 671 | # 3 = --log-level=debug plus dumps of scriplet content and command invocation | 671 | # 3 = --log-level=debug plus dumps of scriplet content and command invocation |
| 672 | self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG', True) or "0") | 672 | self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG') or "0") |
| 673 | self.smart_opt = ["--log-level=%s" % | 673 | self.smart_opt = ["--log-level=%s" % |
| 674 | ("warning" if self.debug_level == 0 else | 674 | ("warning" if self.debug_level == 0 else |
| 675 | "info" if self.debug_level == 1 else | 675 | "info" if self.debug_level == 1 else |
| @@ -684,7 +684,7 @@ class RpmPM(PackageManager): | |||
| 684 | if not os.path.exists(self.d.expand('${T}/saved')): | 684 | if not os.path.exists(self.d.expand('${T}/saved')): |
| 685 | bb.utils.mkdirhier(self.d.expand('${T}/saved')) | 685 | bb.utils.mkdirhier(self.d.expand('${T}/saved')) |
| 686 | 686 | ||
| 687 | packageindex_dir = os.path.join(self.d.getVar('WORKDIR', True), 'rpms') | 687 | packageindex_dir = os.path.join(self.d.getVar('WORKDIR'), 'rpms') |
| 688 | self.indexer = RpmIndexer(self.d, packageindex_dir) | 688 | self.indexer = RpmIndexer(self.d, packageindex_dir) |
| 689 | self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var) | 689 | self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var) |
| 690 | 690 | ||
| @@ -702,7 +702,7 @@ class RpmPM(PackageManager): | |||
| 702 | # List must be prefered to least preferred order | 702 | # List must be prefered to least preferred order |
| 703 | default_platform_extra = list() | 703 | default_platform_extra = list() |
| 704 | platform_extra = list() | 704 | platform_extra = list() |
| 705 | bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or "" | 705 | bbextendvariant = self.d.getVar('BBEXTENDVARIANT') or "" |
| 706 | for mlib in self.ml_os_list: | 706 | for mlib in self.ml_os_list: |
| 707 | for arch in self.ml_prefix_list[mlib]: | 707 | for arch in self.ml_prefix_list[mlib]: |
| 708 | plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib] | 708 | plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib] |
| @@ -750,7 +750,7 @@ class RpmPM(PackageManager): | |||
| 750 | Create configs for rpm and smart, and multilib is supported | 750 | Create configs for rpm and smart, and multilib is supported |
| 751 | ''' | 751 | ''' |
| 752 | def create_configs(self): | 752 | def create_configs(self): |
| 753 | target_arch = self.d.getVar('TARGET_ARCH', True) | 753 | target_arch = self.d.getVar('TARGET_ARCH') |
| 754 | platform = '%s%s-%s' % (target_arch.replace('-', '_'), | 754 | platform = '%s%s-%s' % (target_arch.replace('-', '_'), |
| 755 | self.target_vendor, | 755 | self.target_vendor, |
| 756 | self.ml_os_list['default']) | 756 | self.ml_os_list['default']) |
| @@ -758,7 +758,7 @@ class RpmPM(PackageManager): | |||
| 758 | # List must be prefered to least preferred order | 758 | # List must be prefered to least preferred order |
| 759 | default_platform_extra = list() | 759 | default_platform_extra = list() |
| 760 | platform_extra = list() | 760 | platform_extra = list() |
| 761 | bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or "" | 761 | bbextendvariant = self.d.getVar('BBEXTENDVARIANT') or "" |
| 762 | for mlib in self.ml_os_list: | 762 | for mlib in self.ml_os_list: |
| 763 | for arch in self.ml_prefix_list[mlib]: | 763 | for arch in self.ml_prefix_list[mlib]: |
| 764 | plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib] | 764 | plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib] |
| @@ -841,7 +841,7 @@ class RpmPM(PackageManager): | |||
| 841 | if not new_pkg: | 841 | if not new_pkg: |
| 842 | # Failed to translate, package not found! | 842 | # Failed to translate, package not found! |
| 843 | err_msg = '%s not found in the %s feeds (%s) in %s.' % \ | 843 | err_msg = '%s not found in the %s feeds (%s) in %s.' % \ |
| 844 | (pkg, mlib, " ".join(feed_archs), self.d.getVar('DEPLOY_DIR_RPM', True)) | 844 | (pkg, mlib, " ".join(feed_archs), self.d.getVar('DEPLOY_DIR_RPM')) |
| 845 | if not attempt_only: | 845 | if not attempt_only: |
| 846 | bb.error(err_msg) | 846 | bb.error(err_msg) |
| 847 | bb.fatal("This is often caused by an empty package declared " \ | 847 | bb.fatal("This is often caused by an empty package declared " \ |
| @@ -860,7 +860,7 @@ class RpmPM(PackageManager): | |||
| 860 | new_pkg = self._search_pkg_name_in_feeds(pkg, default_archs) | 860 | new_pkg = self._search_pkg_name_in_feeds(pkg, default_archs) |
| 861 | if not new_pkg: | 861 | if not new_pkg: |
| 862 | err_msg = '%s not found in the feeds (%s) in %s.' % \ | 862 | err_msg = '%s not found in the feeds (%s) in %s.' % \ |
| 863 | (pkg, " ".join(default_archs), self.d.getVar('DEPLOY_DIR_RPM', True)) | 863 | (pkg, " ".join(default_archs), self.d.getVar('DEPLOY_DIR_RPM')) |
| 864 | if not attempt_only: | 864 | if not attempt_only: |
| 865 | bb.error(err_msg) | 865 | bb.error(err_msg) |
| 866 | bb.fatal("This is often caused by an empty package declared " \ | 866 | bb.fatal("This is often caused by an empty package declared " \ |
| @@ -887,7 +887,7 @@ class RpmPM(PackageManager): | |||
| 887 | 887 | ||
| 888 | channel_priority = 5 | 888 | channel_priority = 5 |
| 889 | platform_dir = os.path.join(self.etcrpm_dir, "platform") | 889 | platform_dir = os.path.join(self.etcrpm_dir, "platform") |
| 890 | sdkos = self.d.getVar("SDK_OS", True) | 890 | sdkos = self.d.getVar("SDK_OS") |
| 891 | with open(platform_dir, "w+") as platform_fd: | 891 | with open(platform_dir, "w+") as platform_fd: |
| 892 | platform_fd.write(platform + '\n') | 892 | platform_fd.write(platform + '\n') |
| 893 | for pt in platform_extra: | 893 | for pt in platform_extra: |
| @@ -957,8 +957,8 @@ class RpmPM(PackageManager): | |||
| 957 | bb.fatal("Create rpm database failed. Command '%s' " | 957 | bb.fatal("Create rpm database failed. Command '%s' " |
| 958 | "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8"))) | 958 | "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8"))) |
| 959 | # Import GPG key to RPM database of the target system | 959 | # Import GPG key to RPM database of the target system |
| 960 | if self.d.getVar('RPM_SIGN_PACKAGES', True) == '1': | 960 | if self.d.getVar('RPM_SIGN_PACKAGES') == '1': |
| 961 | pubkey_path = self.d.getVar('RPM_GPG_PUBKEY', True) | 961 | pubkey_path = self.d.getVar('RPM_GPG_PUBKEY') |
| 962 | cmd = [self.rpm_cmd, '--root', self.target_rootfs, '--dbpath', '/var/lib/rpm', '--import', pubkey_path] | 962 | cmd = [self.rpm_cmd, '--root', self.target_rootfs, '--dbpath', '/var/lib/rpm', '--import', pubkey_path] |
| 963 | try: | 963 | try: |
| 964 | subprocess.check_output(cmd, stderr=subprocess.STDOUT) | 964 | subprocess.check_output(cmd, stderr=subprocess.STDOUT) |
| @@ -974,10 +974,10 @@ class RpmPM(PackageManager): | |||
| 974 | self._invoke_smart(['config', '--set', 'rpm-root=%s' % self.target_rootfs]) | 974 | self._invoke_smart(['config', '--set', 'rpm-root=%s' % self.target_rootfs]) |
| 975 | self._invoke_smart(['config', '--set', 'rpm-dbpath=/var/lib/rpm']) | 975 | self._invoke_smart(['config', '--set', 'rpm-dbpath=/var/lib/rpm']) |
| 976 | self._invoke_smart(['config', '--set', 'rpm-extra-macros._var=%s' % | 976 | self._invoke_smart(['config', '--set', 'rpm-extra-macros._var=%s' % |
| 977 | self.d.getVar('localstatedir', True)]) | 977 | self.d.getVar('localstatedir')]) |
| 978 | cmd = ["config", "--set", "rpm-extra-macros._tmppath=/%s/tmp" % self.install_dir_name] | 978 | cmd = ["config", "--set", "rpm-extra-macros._tmppath=/%s/tmp" % self.install_dir_name] |
| 979 | 979 | ||
| 980 | prefer_color = self.d.getVar('RPM_PREFER_ELF_ARCH', True) | 980 | prefer_color = self.d.getVar('RPM_PREFER_ELF_ARCH') |
| 981 | if prefer_color: | 981 | if prefer_color: |
| 982 | if prefer_color not in ['0', '1', '2', '4']: | 982 | if prefer_color not in ['0', '1', '2', '4']: |
| 983 | bb.fatal("Invalid RPM_PREFER_ELF_ARCH: %s, it should be one of:\n" | 983 | bb.fatal("Invalid RPM_PREFER_ELF_ARCH: %s, it should be one of:\n" |
| @@ -985,7 +985,7 @@ class RpmPM(PackageManager): | |||
| 985 | "\t2: ELF64 wins\n" | 985 | "\t2: ELF64 wins\n" |
| 986 | "\t4: ELF64 N32 wins (mips64 or mips64el only)" % | 986 | "\t4: ELF64 N32 wins (mips64 or mips64el only)" % |
| 987 | prefer_color) | 987 | prefer_color) |
| 988 | if prefer_color == "4" and self.d.getVar("TUNE_ARCH", True) not in \ | 988 | if prefer_color == "4" and self.d.getVar("TUNE_ARCH") not in \ |
| 989 | ['mips64', 'mips64el']: | 989 | ['mips64', 'mips64el']: |
| 990 | bb.fatal("RPM_PREFER_ELF_ARCH = \"4\" is for mips64 or mips64el " | 990 | bb.fatal("RPM_PREFER_ELF_ARCH = \"4\" is for mips64 or mips64el " |
| 991 | "only.") | 991 | "only.") |
| @@ -998,17 +998,17 @@ class RpmPM(PackageManager): | |||
| 998 | # Write common configuration for host and target usage | 998 | # Write common configuration for host and target usage |
| 999 | self._invoke_smart(['config', '--set', 'rpm-nolinktos=1']) | 999 | self._invoke_smart(['config', '--set', 'rpm-nolinktos=1']) |
| 1000 | self._invoke_smart(['config', '--set', 'rpm-noparentdirs=1']) | 1000 | self._invoke_smart(['config', '--set', 'rpm-noparentdirs=1']) |
| 1001 | check_signature = self.d.getVar('RPM_CHECK_SIGNATURES', True) | 1001 | check_signature = self.d.getVar('RPM_CHECK_SIGNATURES') |
| 1002 | if check_signature and check_signature.strip() == "0": | 1002 | if check_signature and check_signature.strip() == "0": |
| 1003 | self._invoke_smart(['config', '--set rpm-check-signatures=false']) | 1003 | self._invoke_smart(['config', '--set rpm-check-signatures=false']) |
| 1004 | for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split(): | 1004 | for i in self.d.getVar('BAD_RECOMMENDATIONS').split(): |
| 1005 | self._invoke_smart(['flag', '--set', 'ignore-recommends', i]) | 1005 | self._invoke_smart(['flag', '--set', 'ignore-recommends', i]) |
| 1006 | 1006 | ||
| 1007 | # Do the following configurations here, to avoid them being | 1007 | # Do the following configurations here, to avoid them being |
| 1008 | # saved for field upgrade | 1008 | # saved for field upgrade |
| 1009 | if self.d.getVar('NO_RECOMMENDATIONS', True).strip() == "1": | 1009 | if self.d.getVar('NO_RECOMMENDATIONS').strip() == "1": |
| 1010 | self._invoke_smart(['config', '--set', 'ignore-all-recommends=1']) | 1010 | self._invoke_smart(['config', '--set', 'ignore-all-recommends=1']) |
| 1011 | pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or "" | 1011 | pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE') or "" |
| 1012 | for i in pkg_exclude.split(): | 1012 | for i in pkg_exclude.split(): |
| 1013 | self._invoke_smart(['flag', '--set', 'exclude-packages', i]) | 1013 | self._invoke_smart(['flag', '--set', 'exclude-packages', i]) |
| 1014 | 1014 | ||
| @@ -1019,13 +1019,13 @@ class RpmPM(PackageManager): | |||
| 1019 | ch_already_added = [] | 1019 | ch_already_added = [] |
| 1020 | for canonical_arch in platform_extra: | 1020 | for canonical_arch in platform_extra: |
| 1021 | arch = canonical_arch.split('-')[0] | 1021 | arch = canonical_arch.split('-')[0] |
| 1022 | arch_channel = os.path.join(self.d.getVar('WORKDIR', True), 'rpms', arch) | 1022 | arch_channel = os.path.join(self.d.getVar('WORKDIR'), 'rpms', arch) |
| 1023 | oe.path.remove(arch_channel) | 1023 | oe.path.remove(arch_channel) |
| 1024 | deploy_arch_dir = os.path.join(self.deploy_dir, arch) | 1024 | deploy_arch_dir = os.path.join(self.deploy_dir, arch) |
| 1025 | if not os.path.exists(deploy_arch_dir): | 1025 | if not os.path.exists(deploy_arch_dir): |
| 1026 | continue | 1026 | continue |
| 1027 | 1027 | ||
| 1028 | lockfilename = self.d.getVar('DEPLOY_DIR_RPM', True) + "/rpm.lock" | 1028 | lockfilename = self.d.getVar('DEPLOY_DIR_RPM') + "/rpm.lock" |
| 1029 | lf = bb.utils.lockfile(lockfilename, False) | 1029 | lf = bb.utils.lockfile(lockfilename, False) |
| 1030 | oe.path.copyhardlinktree(deploy_arch_dir, arch_channel) | 1030 | oe.path.copyhardlinktree(deploy_arch_dir, arch_channel) |
| 1031 | bb.utils.unlockfile(lf) | 1031 | bb.utils.unlockfile(lf) |
| @@ -1096,7 +1096,7 @@ class RpmPM(PackageManager): | |||
| 1096 | "fi\n" | 1096 | "fi\n" |
| 1097 | 1097 | ||
| 1098 | intercept_dir = self.d.expand('${WORKDIR}/intercept_scripts') | 1098 | intercept_dir = self.d.expand('${WORKDIR}/intercept_scripts') |
| 1099 | native_root = self.d.getVar('STAGING_DIR_NATIVE', True) | 1099 | native_root = self.d.getVar('STAGING_DIR_NATIVE') |
| 1100 | scriptlet_content = SCRIPTLET_FORMAT % (os.environ['PATH'], | 1100 | scriptlet_content = SCRIPTLET_FORMAT % (os.environ['PATH'], |
| 1101 | self.target_rootfs, | 1101 | self.target_rootfs, |
| 1102 | intercept_dir, | 1102 | intercept_dir, |
| @@ -1170,7 +1170,7 @@ class RpmPM(PackageManager): | |||
| 1170 | ml_pkgs = [] | 1170 | ml_pkgs = [] |
| 1171 | non_ml_pkgs = pkgs[:] | 1171 | non_ml_pkgs = pkgs[:] |
| 1172 | for pkg in pkgs: | 1172 | for pkg in pkgs: |
| 1173 | for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split(): | 1173 | for mlib in (self.d.getVar("MULTILIB_VARIANTS") or "").split(): |
| 1174 | if pkg.startswith(mlib + '-'): | 1174 | if pkg.startswith(mlib + '-'): |
| 1175 | ml_pkgs.append(pkg) | 1175 | ml_pkgs.append(pkg) |
| 1176 | non_ml_pkgs.remove(pkg) | 1176 | non_ml_pkgs.remove(pkg) |
| @@ -1184,7 +1184,7 @@ class RpmPM(PackageManager): | |||
| 1184 | # correctly. | 1184 | # correctly. |
| 1185 | pkgs_new = [] | 1185 | pkgs_new = [] |
| 1186 | for pkg in non_ml_pkgs: | 1186 | for pkg in non_ml_pkgs: |
| 1187 | for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split(): | 1187 | for mlib in (self.d.getVar("MULTILIB_VARIANTS") or "").split(): |
| 1188 | mlib_pkg = mlib + "-" + pkg | 1188 | mlib_pkg = mlib + "-" + pkg |
| 1189 | if mlib_pkg in ml_pkgs: | 1189 | if mlib_pkg in ml_pkgs: |
| 1190 | pkgs_new.append(pkg) | 1190 | pkgs_new.append(pkg) |
| @@ -1401,7 +1401,7 @@ class RpmPM(PackageManager): | |||
| 1401 | 1401 | ||
| 1402 | self._invoke_smart(['config', '--set', 'rpm-nolinktos=1']) | 1402 | self._invoke_smart(['config', '--set', 'rpm-nolinktos=1']) |
| 1403 | self._invoke_smart(['config', '--set', 'rpm-noparentdirs=1']) | 1403 | self._invoke_smart(['config', '--set', 'rpm-noparentdirs=1']) |
| 1404 | for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split(): | 1404 | for i in self.d.getVar('BAD_RECOMMENDATIONS').split(): |
| 1405 | self._invoke_smart(['flag', '--set', 'ignore-recommends', i]) | 1405 | self._invoke_smart(['flag', '--set', 'ignore-recommends', i]) |
| 1406 | self._invoke_smart(['channel', '--add', 'rpmsys', 'type=rpm-sys', '-y']) | 1406 | self._invoke_smart(['channel', '--add', 'rpmsys', 'type=rpm-sys', '-y']) |
| 1407 | 1407 | ||
| @@ -1575,13 +1575,13 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1575 | self.pkg_archs = archs | 1575 | self.pkg_archs = archs |
| 1576 | self.task_name = task_name | 1576 | self.task_name = task_name |
| 1577 | 1577 | ||
| 1578 | self.deploy_dir = self.d.getVar("DEPLOY_DIR_IPK", True) | 1578 | self.deploy_dir = self.d.getVar("DEPLOY_DIR_IPK") |
| 1579 | self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock") | 1579 | self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock") |
| 1580 | self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg") | 1580 | self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg") |
| 1581 | self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs) | 1581 | self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs) |
| 1582 | self.opkg_args += self.d.getVar("OPKG_ARGS", True) | 1582 | self.opkg_args += self.d.getVar("OPKG_ARGS") |
| 1583 | 1583 | ||
| 1584 | opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True) | 1584 | opkg_lib_dir = self.d.getVar('OPKGLIBDIR') |
| 1585 | if opkg_lib_dir[0] == "/": | 1585 | if opkg_lib_dir[0] == "/": |
| 1586 | opkg_lib_dir = opkg_lib_dir[1:] | 1586 | opkg_lib_dir = opkg_lib_dir[1:] |
| 1587 | 1587 | ||
| @@ -1593,7 +1593,7 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1593 | if not os.path.exists(self.d.expand('${T}/saved')): | 1593 | if not os.path.exists(self.d.expand('${T}/saved')): |
| 1594 | bb.utils.mkdirhier(self.d.expand('${T}/saved')) | 1594 | bb.utils.mkdirhier(self.d.expand('${T}/saved')) |
| 1595 | 1595 | ||
| 1596 | self.from_feeds = (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") == "1" | 1596 | self.from_feeds = (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") == "1" |
| 1597 | if self.from_feeds: | 1597 | if self.from_feeds: |
| 1598 | self._create_custom_config() | 1598 | self._create_custom_config() |
| 1599 | else: | 1599 | else: |
| @@ -1638,7 +1638,7 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1638 | config_file.write("arch %s %d\n" % (arch, priority)) | 1638 | config_file.write("arch %s %d\n" % (arch, priority)) |
| 1639 | priority += 5 | 1639 | priority += 5 |
| 1640 | 1640 | ||
| 1641 | for line in (self.d.getVar('IPK_FEED_URIS', True) or "").split(): | 1641 | for line in (self.d.getVar('IPK_FEED_URIS') or "").split(): |
| 1642 | feed_match = re.match("^[ \t]*(.*)##([^ \t]*)[ \t]*$", line) | 1642 | feed_match = re.match("^[ \t]*(.*)##([^ \t]*)[ \t]*$", line) |
| 1643 | 1643 | ||
| 1644 | if feed_match is not None: | 1644 | if feed_match is not None: |
| @@ -1655,17 +1655,17 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1655 | specified as compatible for the current machine. | 1655 | specified as compatible for the current machine. |
| 1656 | NOTE: Development-helper feature, NOT a full-fledged feed. | 1656 | NOTE: Development-helper feature, NOT a full-fledged feed. |
| 1657 | """ | 1657 | """ |
| 1658 | if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True) or "") != "": | 1658 | if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI') or "") != "": |
| 1659 | for arch in self.pkg_archs.split(): | 1659 | for arch in self.pkg_archs.split(): |
| 1660 | cfg_file_name = os.path.join(self.target_rootfs, | 1660 | cfg_file_name = os.path.join(self.target_rootfs, |
| 1661 | self.d.getVar("sysconfdir", True), | 1661 | self.d.getVar("sysconfdir"), |
| 1662 | "opkg", | 1662 | "opkg", |
| 1663 | "local-%s-feed.conf" % arch) | 1663 | "local-%s-feed.conf" % arch) |
| 1664 | 1664 | ||
| 1665 | with open(cfg_file_name, "w+") as cfg_file: | 1665 | with open(cfg_file_name, "w+") as cfg_file: |
| 1666 | cfg_file.write("src/gz local-%s %s/%s" % | 1666 | cfg_file.write("src/gz local-%s %s/%s" % |
| 1667 | (arch, | 1667 | (arch, |
| 1668 | self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True), | 1668 | self.d.getVar('FEED_DEPLOYDIR_BASE_URI'), |
| 1669 | arch)) | 1669 | arch)) |
| 1670 | 1670 | ||
| 1671 | if self.opkg_dir != '/var/lib/opkg': | 1671 | if self.opkg_dir != '/var/lib/opkg': |
| @@ -1674,8 +1674,8 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1674 | # the default value of "/var/lib" as defined in opkg: | 1674 | # the default value of "/var/lib" as defined in opkg: |
| 1675 | # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR "/var/lib/opkg/info" | 1675 | # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR "/var/lib/opkg/info" |
| 1676 | # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status" | 1676 | # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status" |
| 1677 | cfg_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info')) | 1677 | cfg_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info')) |
| 1678 | cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status')) | 1678 | cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status')) |
| 1679 | 1679 | ||
| 1680 | 1680 | ||
| 1681 | def _create_config(self): | 1681 | def _create_config(self): |
| @@ -1699,8 +1699,8 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1699 | # the default value of "/var/lib" as defined in opkg: | 1699 | # the default value of "/var/lib" as defined in opkg: |
| 1700 | # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR "/var/lib/opkg/info" | 1700 | # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR "/var/lib/opkg/info" |
| 1701 | # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status" | 1701 | # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status" |
| 1702 | config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info')) | 1702 | config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info')) |
| 1703 | config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status')) | 1703 | config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status')) |
| 1704 | 1704 | ||
| 1705 | def insert_feeds_uris(self): | 1705 | def insert_feeds_uris(self): |
| 1706 | if self.feed_uris == "": | 1706 | if self.feed_uris == "": |
| @@ -1755,9 +1755,9 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1755 | os.environ['OFFLINE_ROOT'] = self.target_rootfs | 1755 | os.environ['OFFLINE_ROOT'] = self.target_rootfs |
| 1756 | os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs | 1756 | os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs |
| 1757 | os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs | 1757 | os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs |
| 1758 | os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR', True), | 1758 | os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR'), |
| 1759 | "intercept_scripts") | 1759 | "intercept_scripts") |
| 1760 | os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True) | 1760 | os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE') |
| 1761 | 1761 | ||
| 1762 | try: | 1762 | try: |
| 1763 | bb.note("Installing the following packages: %s" % ' '.join(pkgs)) | 1763 | bb.note("Installing the following packages: %s" % ' '.join(pkgs)) |
| @@ -1808,7 +1808,7 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1808 | return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list_pkgs() | 1808 | return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list_pkgs() |
| 1809 | 1809 | ||
| 1810 | def handle_bad_recommendations(self): | 1810 | def handle_bad_recommendations(self): |
| 1811 | bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS", True) or "" | 1811 | bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS") or "" |
| 1812 | if bad_recommendations.strip() == "": | 1812 | if bad_recommendations.strip() == "": |
| 1813 | return | 1813 | return |
| 1814 | 1814 | ||
| @@ -1859,7 +1859,7 @@ class OpkgPM(OpkgDpkgPM): | |||
| 1859 | bb.utils.mkdirhier(temp_opkg_dir) | 1859 | bb.utils.mkdirhier(temp_opkg_dir) |
| 1860 | 1860 | ||
| 1861 | opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs) | 1861 | opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs) |
| 1862 | opkg_args += self.d.getVar("OPKG_ARGS", True) | 1862 | opkg_args += self.d.getVar("OPKG_ARGS") |
| 1863 | 1863 | ||
| 1864 | cmd = "%s %s update" % (self.opkg_cmd, opkg_args) | 1864 | cmd = "%s %s update" % (self.opkg_cmd, opkg_args) |
| 1865 | try: | 1865 | try: |
| @@ -1935,7 +1935,7 @@ class DpkgPM(OpkgDpkgPM): | |||
| 1935 | def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None): | 1935 | def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None): |
| 1936 | super(DpkgPM, self).__init__(d) | 1936 | super(DpkgPM, self).__init__(d) |
| 1937 | self.target_rootfs = target_rootfs | 1937 | self.target_rootfs = target_rootfs |
| 1938 | self.deploy_dir = self.d.getVar('DEPLOY_DIR_DEB', True) | 1938 | self.deploy_dir = self.d.getVar('DEPLOY_DIR_DEB') |
| 1939 | if apt_conf_dir is None: | 1939 | if apt_conf_dir is None: |
| 1940 | self.apt_conf_dir = self.d.expand("${APTCONF_TARGET}/apt") | 1940 | self.apt_conf_dir = self.d.expand("${APTCONF_TARGET}/apt") |
| 1941 | else: | 1941 | else: |
| @@ -1944,10 +1944,10 @@ class DpkgPM(OpkgDpkgPM): | |||
| 1944 | self.apt_get_cmd = bb.utils.which(os.getenv('PATH'), "apt-get") | 1944 | self.apt_get_cmd = bb.utils.which(os.getenv('PATH'), "apt-get") |
| 1945 | self.apt_cache_cmd = bb.utils.which(os.getenv('PATH'), "apt-cache") | 1945 | self.apt_cache_cmd = bb.utils.which(os.getenv('PATH'), "apt-cache") |
| 1946 | 1946 | ||
| 1947 | self.apt_args = d.getVar("APT_ARGS", True) | 1947 | self.apt_args = d.getVar("APT_ARGS") |
| 1948 | 1948 | ||
| 1949 | self.all_arch_list = archs.split() | 1949 | self.all_arch_list = archs.split() |
| 1950 | all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").split() | 1950 | all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or "").split() |
| 1951 | self.all_arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in self.all_arch_list) | 1951 | self.all_arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in self.all_arch_list) |
| 1952 | 1952 | ||
| 1953 | self._create_configs(archs, base_archs) | 1953 | self._create_configs(archs, base_archs) |
| @@ -2008,9 +2008,9 @@ class DpkgPM(OpkgDpkgPM): | |||
| 2008 | os.environ['OFFLINE_ROOT'] = self.target_rootfs | 2008 | os.environ['OFFLINE_ROOT'] = self.target_rootfs |
| 2009 | os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs | 2009 | os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs |
| 2010 | os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs | 2010 | os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs |
| 2011 | os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR', True), | 2011 | os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR'), |
| 2012 | "intercept_scripts") | 2012 | "intercept_scripts") |
| 2013 | os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True) | 2013 | os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE') |
| 2014 | 2014 | ||
| 2015 | failed_pkgs = [] | 2015 | failed_pkgs = [] |
| 2016 | for pkg_name in installed_pkgs: | 2016 | for pkg_name in installed_pkgs: |
| @@ -2161,7 +2161,7 @@ class DpkgPM(OpkgDpkgPM): | |||
| 2161 | 2161 | ||
| 2162 | priority += 5 | 2162 | priority += 5 |
| 2163 | 2163 | ||
| 2164 | pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or "" | 2164 | pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE') or "" |
| 2165 | for pkg in pkg_exclude.split(): | 2165 | for pkg in pkg_exclude.split(): |
| 2166 | prefs_file.write( | 2166 | prefs_file.write( |
| 2167 | "Package: %s\n" | 2167 | "Package: %s\n" |
| @@ -2176,14 +2176,14 @@ class DpkgPM(OpkgDpkgPM): | |||
| 2176 | os.path.join(self.deploy_dir, arch)) | 2176 | os.path.join(self.deploy_dir, arch)) |
| 2177 | 2177 | ||
| 2178 | base_arch_list = base_archs.split() | 2178 | base_arch_list = base_archs.split() |
| 2179 | multilib_variants = self.d.getVar("MULTILIB_VARIANTS", True); | 2179 | multilib_variants = self.d.getVar("MULTILIB_VARIANTS"); |
| 2180 | for variant in multilib_variants.split(): | 2180 | for variant in multilib_variants.split(): |
| 2181 | localdata = bb.data.createCopy(self.d) | 2181 | localdata = bb.data.createCopy(self.d) |
| 2182 | variant_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + variant, False) | 2182 | variant_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + variant, False) |
| 2183 | orig_arch = localdata.getVar("DPKG_ARCH", True) | 2183 | orig_arch = localdata.getVar("DPKG_ARCH") |
| 2184 | localdata.setVar("DEFAULTTUNE", variant_tune) | 2184 | localdata.setVar("DEFAULTTUNE", variant_tune) |
| 2185 | bb.data.update_data(localdata) | 2185 | bb.data.update_data(localdata) |
| 2186 | variant_arch = localdata.getVar("DPKG_ARCH", True) | 2186 | variant_arch = localdata.getVar("DPKG_ARCH") |
| 2187 | if variant_arch not in base_arch_list: | 2187 | if variant_arch not in base_arch_list: |
| 2188 | base_arch_list.append(variant_arch) | 2188 | base_arch_list.append(variant_arch) |
| 2189 | 2189 | ||
| @@ -2214,7 +2214,7 @@ class DpkgPM(OpkgDpkgPM): | |||
| 2214 | 2214 | ||
| 2215 | def remove_packaging_data(self): | 2215 | def remove_packaging_data(self): |
| 2216 | bb.utils.remove(os.path.join(self.target_rootfs, | 2216 | bb.utils.remove(os.path.join(self.target_rootfs, |
| 2217 | self.d.getVar('opkglibdir', True)), True) | 2217 | self.d.getVar('opkglibdir')), True) |
| 2218 | bb.utils.remove(self.target_rootfs + "/var/lib/dpkg/", True) | 2218 | bb.utils.remove(self.target_rootfs + "/var/lib/dpkg/", True) |
| 2219 | 2219 | ||
| 2220 | def fix_broken_dependencies(self): | 2220 | def fix_broken_dependencies(self): |
| @@ -2262,12 +2262,12 @@ class DpkgPM(OpkgDpkgPM): | |||
| 2262 | return tmp_dir | 2262 | return tmp_dir |
| 2263 | 2263 | ||
| 2264 | def generate_index_files(d): | 2264 | def generate_index_files(d): |
| 2265 | classes = d.getVar('PACKAGE_CLASSES', True).replace("package_", "").split() | 2265 | classes = d.getVar('PACKAGE_CLASSES').replace("package_", "").split() |
| 2266 | 2266 | ||
| 2267 | indexer_map = { | 2267 | indexer_map = { |
| 2268 | "rpm": (RpmIndexer, d.getVar('DEPLOY_DIR_RPM', True)), | 2268 | "rpm": (RpmIndexer, d.getVar('DEPLOY_DIR_RPM')), |
| 2269 | "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK', True)), | 2269 | "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK')), |
| 2270 | "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB', True)) | 2270 | "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB')) |
| 2271 | } | 2271 | } |
| 2272 | 2272 | ||
| 2273 | result = None | 2273 | result = None |
