diff options
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/package_manager.py | 37 | ||||
-rw-r--r-- | meta/lib/oe/prservice.py | 4 | ||||
-rw-r--r-- | meta/lib/oe/sstatesig.py | 13 | ||||
-rw-r--r-- | meta/lib/oe/utils.py | 2 |
4 files changed, 39 insertions, 17 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 7c373715ad..e0b15dc9b4 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -40,8 +40,9 @@ def opkg_query(cmd_output): | |||
40 | ver = "" | 40 | ver = "" |
41 | filename = "" | 41 | filename = "" |
42 | dep = [] | 42 | dep = [] |
43 | prov = [] | ||
43 | pkgarch = "" | 44 | pkgarch = "" |
44 | for line in cmd_output.splitlines(): | 45 | for line in cmd_output.splitlines()+['']: |
45 | line = line.rstrip() | 46 | line = line.rstrip() |
46 | if ':' in line: | 47 | if ':' in line: |
47 | if line.startswith("Package: "): | 48 | if line.startswith("Package: "): |
@@ -64,6 +65,10 @@ def opkg_query(cmd_output): | |||
64 | dep.append("%s [REC]" % recommend) | 65 | dep.append("%s [REC]" % recommend) |
65 | elif line.startswith("PackageArch: "): | 66 | elif line.startswith("PackageArch: "): |
66 | pkgarch = line.split(": ")[1] | 67 | pkgarch = line.split(": ")[1] |
68 | elif line.startswith("Provides: "): | ||
69 | provides = verregex.sub('', line.split(": ")[1]) | ||
70 | for provide in provides.split(", "): | ||
71 | prov.append(provide) | ||
67 | 72 | ||
68 | # When there is a blank line save the package information | 73 | # When there is a blank line save the package information |
69 | elif not line: | 74 | elif not line: |
@@ -72,20 +77,15 @@ def opkg_query(cmd_output): | |||
72 | filename = "%s_%s_%s.ipk" % (pkg, ver, arch) | 77 | filename = "%s_%s_%s.ipk" % (pkg, ver, arch) |
73 | if pkg: | 78 | if pkg: |
74 | output[pkg] = {"arch":arch, "ver":ver, | 79 | output[pkg] = {"arch":arch, "ver":ver, |
75 | "filename":filename, "deps": dep, "pkgarch":pkgarch } | 80 | "filename":filename, "deps": dep, "pkgarch":pkgarch, "provs": prov} |
76 | pkg = "" | 81 | pkg = "" |
77 | arch = "" | 82 | arch = "" |
78 | ver = "" | 83 | ver = "" |
79 | filename = "" | 84 | filename = "" |
80 | dep = [] | 85 | dep = [] |
86 | prov = [] | ||
81 | pkgarch = "" | 87 | pkgarch = "" |
82 | 88 | ||
83 | if pkg: | ||
84 | if not filename: | ||
85 | filename = "%s_%s_%s.ipk" % (pkg, ver, arch) | ||
86 | output[pkg] = {"arch":arch, "ver":ver, | ||
87 | "filename":filename, "deps": dep } | ||
88 | |||
89 | return output | 89 | return output |
90 | 90 | ||
91 | def failed_postinsts_abort(pkgs, log_path): | 91 | def failed_postinsts_abort(pkgs, log_path): |
@@ -360,7 +360,7 @@ class DpkgPkgsList(PkgsList): | |||
360 | "--admindir=%s/var/lib/dpkg" % self.rootfs_dir, | 360 | "--admindir=%s/var/lib/dpkg" % self.rootfs_dir, |
361 | "-W"] | 361 | "-W"] |
362 | 362 | ||
363 | cmd.append("-f=Package: ${Package}\nArchitecture: ${PackageArch}\nVersion: ${Version}\nFile: ${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n") | 363 | cmd.append("-f=Package: ${Package}\nArchitecture: ${PackageArch}\nVersion: ${Version}\nFile: ${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: ${Recommends}\nProvides: ${Provides}\n\n") |
364 | 364 | ||
365 | try: | 365 | try: |
366 | cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8") | 366 | cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8") |
@@ -578,6 +578,11 @@ class PackageManager(object, metaclass=ABCMeta): | |||
578 | # oe-pkgdata-util reads it from a file | 578 | # oe-pkgdata-util reads it from a file |
579 | with tempfile.NamedTemporaryFile(mode="w+", prefix="installed-pkgs") as installed_pkgs: | 579 | with tempfile.NamedTemporaryFile(mode="w+", prefix="installed-pkgs") as installed_pkgs: |
580 | pkgs = self.list_installed() | 580 | pkgs = self.list_installed() |
581 | |||
582 | provided_pkgs = set() | ||
583 | for pkg in pkgs.values(): | ||
584 | provided_pkgs |= set(pkg.get('provs', [])) | ||
585 | |||
581 | output = oe.utils.format_pkg_list(pkgs, "arch") | 586 | output = oe.utils.format_pkg_list(pkgs, "arch") |
582 | installed_pkgs.write(output) | 587 | installed_pkgs.write(output) |
583 | installed_pkgs.flush() | 588 | installed_pkgs.flush() |
@@ -589,10 +594,15 @@ class PackageManager(object, metaclass=ABCMeta): | |||
589 | if exclude: | 594 | if exclude: |
590 | cmd.extend(['--exclude=' + '|'.join(exclude.split())]) | 595 | cmd.extend(['--exclude=' + '|'.join(exclude.split())]) |
591 | try: | 596 | try: |
592 | bb.note("Installing complementary packages ...") | ||
593 | bb.note('Running %s' % cmd) | 597 | bb.note('Running %s' % cmd) |
594 | complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") | 598 | complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") |
595 | self.install(complementary_pkgs.split(), attempt_only=True) | 599 | complementary_pkgs = set(complementary_pkgs.split()) |
600 | skip_pkgs = sorted(complementary_pkgs & provided_pkgs) | ||
601 | install_pkgs = sorted(complementary_pkgs - provided_pkgs) | ||
602 | bb.note("Installing complementary packages ... %s (skipped already provided packages %s)" % ( | ||
603 | ' '.join(install_pkgs), | ||
604 | ' '.join(skip_pkgs))) | ||
605 | self.install(install_pkgs, attempt_only=True) | ||
596 | except subprocess.CalledProcessError as e: | 606 | except subprocess.CalledProcessError as e: |
597 | bb.fatal("Could not compute complementary packages list. Command " | 607 | bb.fatal("Could not compute complementary packages list. Command " |
598 | "'%s' returned %d:\n%s" % | 608 | "'%s' returned %d:\n%s" % |
@@ -1619,7 +1629,7 @@ class DpkgPM(OpkgDpkgPM): | |||
1619 | 1629 | ||
1620 | os.environ['APT_CONFIG'] = self.apt_conf_file | 1630 | os.environ['APT_CONFIG'] = self.apt_conf_file |
1621 | 1631 | ||
1622 | cmd = "%s %s install --force-yes --allow-unauthenticated %s" % \ | 1632 | cmd = "%s %s install --force-yes --allow-unauthenticated --no-remove %s" % \ |
1623 | (self.apt_get_cmd, self.apt_args, ' '.join(pkgs)) | 1633 | (self.apt_get_cmd, self.apt_args, ' '.join(pkgs)) |
1624 | 1634 | ||
1625 | try: | 1635 | try: |
@@ -1781,8 +1791,7 @@ class DpkgPM(OpkgDpkgPM): | |||
1781 | open(os.path.join(target_dpkg_dir, "available"), "w+").close() | 1791 | open(os.path.join(target_dpkg_dir, "available"), "w+").close() |
1782 | 1792 | ||
1783 | def remove_packaging_data(self): | 1793 | def remove_packaging_data(self): |
1784 | bb.utils.remove(os.path.join(self.target_rootfs, | 1794 | bb.utils.remove(self.target_rootfs + self.d.getVar('opkglibdir'), True) |
1785 | self.d.getVar('opkglibdir')), True) | ||
1786 | bb.utils.remove(self.target_rootfs + "/var/lib/dpkg/", True) | 1795 | bb.utils.remove(self.target_rootfs + "/var/lib/dpkg/", True) |
1787 | 1796 | ||
1788 | def fix_broken_dependencies(self): | 1797 | def fix_broken_dependencies(self): |
diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py index b1132ccb11..3a5ef8d921 100644 --- a/meta/lib/oe/prservice.py +++ b/meta/lib/oe/prservice.py | |||
@@ -3,6 +3,10 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | def prserv_make_conn(d, check = False): | 5 | def prserv_make_conn(d, check = False): |
6 | # Otherwise this fails when called from recipes which e.g. inherit python3native (which sets _PYTHON_SYSCONFIGDATA_NAME) with: | ||
7 | # No module named '_sysconfigdata' | ||
8 | if '_PYTHON_SYSCONFIGDATA_NAME' in os.environ: | ||
9 | del os.environ['_PYTHON_SYSCONFIGDATA_NAME'] | ||
6 | import prserv.serv | 10 | import prserv.serv |
7 | host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f]) | 11 | host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f]) |
8 | try: | 12 | try: |
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index b2316b12b8..f1abff0c45 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py | |||
@@ -151,6 +151,13 @@ class SignatureGeneratorOEBasicHashMixIn(object): | |||
151 | 151 | ||
152 | def get_taskhash(self, tid, deps, dataCache): | 152 | def get_taskhash(self, tid, deps, dataCache): |
153 | h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache) | 153 | h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache) |
154 | if tid in self.lockedhashes: | ||
155 | if self.lockedhashes[tid]: | ||
156 | return self.lockedhashes[tid] | ||
157 | else: | ||
158 | return h | ||
159 | |||
160 | h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache) | ||
154 | 161 | ||
155 | (mc, _, task, fn) = bb.runqueue.split_tid_mcfn(tid) | 162 | (mc, _, task, fn) = bb.runqueue.split_tid_mcfn(tid) |
156 | 163 | ||
@@ -187,17 +194,19 @@ class SignatureGeneratorOEBasicHashMixIn(object): | |||
187 | % (recipename, task, h, h_locked, var)) | 194 | % (recipename, task, h, h_locked, var)) |
188 | 195 | ||
189 | return h_locked | 196 | return h_locked |
197 | |||
198 | self.lockedhashes[tid] = False | ||
190 | #bb.warn("%s %s %s" % (recipename, task, h)) | 199 | #bb.warn("%s %s %s" % (recipename, task, h)) |
191 | return h | 200 | return h |
192 | 201 | ||
193 | def get_unihash(self, tid): | 202 | def get_unihash(self, tid): |
194 | if tid in self.lockedhashes: | 203 | if tid in self.lockedhashes and self.lockedhashes[tid]: |
195 | return self.lockedhashes[tid] | 204 | return self.lockedhashes[tid] |
196 | return super().get_unihash(tid) | 205 | return super().get_unihash(tid) |
197 | 206 | ||
198 | def dump_sigtask(self, fn, task, stampbase, runtime): | 207 | def dump_sigtask(self, fn, task, stampbase, runtime): |
199 | tid = fn + ":" + task | 208 | tid = fn + ":" + task |
200 | if tid in self.lockedhashes: | 209 | if tid in self.lockedhashes and self.lockedhashes[tid]: |
201 | return | 210 | return |
202 | super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime) | 211 | super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime) |
203 | 212 | ||
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 652b2be145..144c123a0e 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
@@ -387,7 +387,7 @@ def host_gcc_version(d, taskcontextonly=False): | |||
387 | except subprocess.CalledProcessError as e: | 387 | except subprocess.CalledProcessError as e: |
388 | bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8"))) | 388 | bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8"))) |
389 | 389 | ||
390 | match = re.match(r".* (\d\.\d)\.\d.*", output.split('\n')[0]) | 390 | match = re.match(r".* (\d+\.\d+)\.\d+.*", output.split('\n')[0]) |
391 | if not match: | 391 | if not match: |
392 | bb.fatal("Can't get compiler version from %s --version output" % compiler) | 392 | bb.fatal("Can't get compiler version from %s --version output" % compiler) |
393 | 393 | ||