diff options
author | Jan Luebbe <jlu@pengutronix.de> | 2020-04-01 16:58:03 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-04-02 15:24:58 +0100 |
commit | 28642102360776c80909fbe5d6d979db541a60de (patch) | |
tree | 6e5f599f5da02f1db5479d86bbc9a2abdbbd17d0 /meta/lib | |
parent | e1aabb2cae79b10ff552b60099d78de0031af698 (diff) | |
download | poky-28642102360776c80909fbe5d6d979db541a60de.tar.gz |
lib/oe/package_manager: collect provided package names when using debs
This is needed for a later change to avoid installing packages which are
already provided by an installed package.
(From OE-Core rev: ad72dfaaa2caf2c39d033dc1682f0bbbbe45dbbd)
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/package_manager.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 0723728927..e862915b1b 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -40,6 +40,7 @@ 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() |
@@ -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,12 +77,13 @@ 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 | return output | 89 | return output |
@@ -355,7 +361,7 @@ class DpkgPkgsList(PkgsList): | |||
355 | "--admindir=%s/var/lib/dpkg" % self.rootfs_dir, | 361 | "--admindir=%s/var/lib/dpkg" % self.rootfs_dir, |
356 | "-W"] | 362 | "-W"] |
357 | 363 | ||
358 | cmd.append("-f=Package: ${Package}\nArchitecture: ${PackageArch}\nVersion: ${Version}\nFile: ${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n") | 364 | cmd.append("-f=Package: ${Package}\nArchitecture: ${PackageArch}\nVersion: ${Version}\nFile: ${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: ${Recommends}\nProvides: ${Provides}\n\n") |
359 | 365 | ||
360 | try: | 366 | try: |
361 | cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8") | 367 | cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8") |