aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Luebbe <jlu@pengutronix.de>2020-04-01 16:58:03 +0200
committerAnuj Mittal <anuj.mittal@intel.com>2020-04-06 15:17:05 +0800
commit1bedfdf58d3ebd06126aa45c7bdc84e66c750725 (patch)
tree174e3ff7e480eb3687ed8d126724cb49ab72292c
parent7dba11373af742d4e4924e14e8fd386d53ffddbd (diff)
downloadopenembedded-core-contrib-1bedfdf58d3ebd06126aa45c7bdc84e66c750725.tar.gz
openembedded-core-contrib-1bedfdf58d3ebd06126aa45c7bdc84e66c750725.tar.bz2
openembedded-core-contrib-1bedfdf58d3ebd06126aa45c7bdc84e66c750725.zip
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. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ad72dfaaa2caf2c39d033dc1682f0bbbbe45dbbd) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--meta/lib/oe/package_manager.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 27b2f17f956..e6319dc3b82 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -40,6 +40,7 @@ def opkg_query(cmd_output):
ver = ""
filename = ""
dep = []
+ prov = []
pkgarch = ""
for line in cmd_output.splitlines()+['']:
line = line.rstrip()
@@ -64,6 +65,10 @@ def opkg_query(cmd_output):
dep.append("%s [REC]" % recommend)
elif line.startswith("PackageArch: "):
pkgarch = line.split(": ")[1]
+ elif line.startswith("Provides: "):
+ provides = verregex.sub('', line.split(": ")[1])
+ for provide in provides.split(", "):
+ prov.append(provide)
# When there is a blank line save the package information
elif not line:
@@ -72,12 +77,13 @@ def opkg_query(cmd_output):
filename = "%s_%s_%s.ipk" % (pkg, ver, arch)
if pkg:
output[pkg] = {"arch":arch, "ver":ver,
- "filename":filename, "deps": dep, "pkgarch":pkgarch }
+ "filename":filename, "deps": dep, "pkgarch":pkgarch, "provs": prov}
pkg = ""
arch = ""
ver = ""
filename = ""
dep = []
+ prov = []
pkgarch = ""
return output
@@ -354,7 +360,7 @@ class DpkgPkgsList(PkgsList):
"--admindir=%s/var/lib/dpkg" % self.rootfs_dir,
"-W"]
- cmd.append("-f=Package: ${Package}\nArchitecture: ${PackageArch}\nVersion: ${Version}\nFile: ${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n")
+ cmd.append("-f=Package: ${Package}\nArchitecture: ${PackageArch}\nVersion: ${Version}\nFile: ${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: ${Recommends}\nProvides: ${Provides}\n\n")
try:
cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8")