[OE-core] [PATCH] Record PE value for shlib dependencies

Böszörményi Zoltán zboszor at pr.hu
Thu Jan 11 15:33:50 UTC 2018


When downgrading a package or using a substitute with lower version,
the way to do it is adding or increasing PE. But it didn't help
dependant packages because the shlib records didn't contain PE, only PV.

Let's add the PE value into these records for packages where it's set.

The in-memory variables storing the versions use the PE:PV notation
but the on-disk files must use something else because the : character
is already used as field delimiter in the package.list files storing
these shlib records. Use # instead in the files, so the file format
doesn't change. Conversion occurs on reading/writing the package.list
files.

Signed-off-by: Zoltán Böszörményi <zboszor at pr.hu>
---
 meta/classes/package.bbclass | 6 +++++-
 meta/lib/oe/package.py       | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 7dc759699f..966c059851 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1686,6 +1686,10 @@ python package_do_shlibs() {
         if not pkgver:
             pkgver = ver
 
+        pkgpe = d.getVar('PE')
+        if pkgpe:
+            pkgver = pkgpe + ':' + pkgver
+
         needed[pkg] = []
         sonames = list()
         renames = list()
@@ -1714,7 +1718,7 @@ python package_do_shlibs() {
                     if old_pkg != pkg:
                         bb.warn('%s-%s was registered as shlib provider for %s, changing it to %s-%s because it was built later' % (old_pkg, old_pkgver, s[0], pkg, pkgver))
                 bb.debug(1, 'registering %s-%s as shlib provider for %s' % (pkg, pkgver, s[0]))
-                fd.write(s[0] + ':' + s[1] + ':' + s[2] + '\n')
+                fd.write(s[0] + ':' + s[1] + ':' + s[2].replace(':', '#', 1) + '\n')
                 if s[0] not in shlib_provider:
                     shlib_provider[s[0]] = {}
                 shlib_provider[s[0]][s[1]] = (pkg, pkgver)
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 1e5c3aa8e1..d19fe7312d 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -258,7 +258,7 @@ def read_shlib_providers(d):
                     s = l.strip().split(":")
                     if s[0] not in shlib_provider:
                         shlib_provider[s[0]] = {}
-                    shlib_provider[s[0]][s[1]] = (dep_pkg, s[2])
+                    shlib_provider[s[0]][s[1]] = (dep_pkg, s[2].replace('#', ':', 1))
     return shlib_provider
 
 
-- 
2.14.3




More information about the Openembedded-core mailing list