mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 01:40:07 +00:00
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: 1bedfdf58d3ebd06126aa45c7bdc84e66c750725) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
54eec13b6e
commit
1eb584a335
@@ -40,6 +40,7 @@ def opkg_query(cmd_output):
|
|||||||
ver = ""
|
ver = ""
|
||||||
filename = ""
|
filename = ""
|
||||||
dep = []
|
dep = []
|
||||||
|
prov = []
|
||||||
pkgarch = ""
|
pkgarch = ""
|
||||||
for line in cmd_output.splitlines()+['']:
|
for line in cmd_output.splitlines()+['']:
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
@@ -64,6 +65,10 @@ def opkg_query(cmd_output):
|
|||||||
dep.append("%s [REC]" % recommend)
|
dep.append("%s [REC]" % recommend)
|
||||||
elif line.startswith("PackageArch: "):
|
elif line.startswith("PackageArch: "):
|
||||||
pkgarch = line.split(": ")[1]
|
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
|
# When there is a blank line save the package information
|
||||||
elif not line:
|
elif not line:
|
||||||
@@ -72,12 +77,13 @@ def opkg_query(cmd_output):
|
|||||||
filename = "%s_%s_%s.ipk" % (pkg, ver, arch)
|
filename = "%s_%s_%s.ipk" % (pkg, ver, arch)
|
||||||
if pkg:
|
if pkg:
|
||||||
output[pkg] = {"arch":arch, "ver":ver,
|
output[pkg] = {"arch":arch, "ver":ver,
|
||||||
"filename":filename, "deps": dep, "pkgarch":pkgarch }
|
"filename":filename, "deps": dep, "pkgarch":pkgarch, "provs": prov}
|
||||||
pkg = ""
|
pkg = ""
|
||||||
arch = ""
|
arch = ""
|
||||||
ver = ""
|
ver = ""
|
||||||
filename = ""
|
filename = ""
|
||||||
dep = []
|
dep = []
|
||||||
|
prov = []
|
||||||
pkgarch = ""
|
pkgarch = ""
|
||||||
|
|
||||||
return output
|
return output
|
||||||
@@ -354,7 +360,7 @@ class DpkgPkgsList(PkgsList):
|
|||||||
"--admindir=%s/var/lib/dpkg" % self.rootfs_dir,
|
"--admindir=%s/var/lib/dpkg" % self.rootfs_dir,
|
||||||
"-W"]
|
"-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:
|
try:
|
||||||
cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8")
|
cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8")
|
||||||
|
|||||||
Reference in New Issue
Block a user