We recently added a "xxx (= 1.2.3)" style dependency to a recipe and have
been having trouble with the opkg and debian backends with it.

The issues is that for debian, "=" really does mean equals and includes the
PR field. One bitbake recipe does not know the PR of another, nor shoud it.
In other words 1.2.3 != 1.2.3-r0. Debian defaults to a PR of "0", not our
"r0".

The only way I can think of to make this work is to change "=" dependencies
without revision information (no "-r" in the version) into things like:
"xxx (>= 1.2.3), xxx (<< 1.2.3.0)". This appears to work even if it is a
pretty horrible workaround.

Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
---
 meta/classes/package_deb.bbclass | 7 ++++++-
 meta/classes/package_ipk.bbclass | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 2e75e222bcb..a9b8ba01184 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -182,7 +182,8 @@ def deb_write_pkg(pkg, d):
             #   '<' = less or equal
             #   '>' = greater or equal
             # adjust these to the '<<' and '>>' equivalents
-            #
+            # Also, "=" specifiers only work if they have the PR in, so 1.2.3 
!= 1.2.3-r0
+            # so to avoid issues, map this to ">= 1.2.3 << 1.2.3.0"
             for dep in list(var.keys()):
                 if '(' in dep or '/' in dep:
                     newdep = re.sub(r'[(:)/]', '__', dep)
@@ -197,6 +198,10 @@ def deb_write_pkg(pkg, d):
                         var[dep][i] = var[dep][i].replace("< ", "<< ")
                     elif (v or "").startswith("> "):
                         var[dep][i] = var[dep][i].replace("> ", ">> ")
+                    elif (v or "").startswith("= ") and "-r" not in v:
+                        ver = var[dep][i].replace("= ", "")
+                        var[dep][i] = var[dep][i].replace("= ", ">= ")
+                        var[dep].append("<< " + ver + ".0")
 
         rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") 
or "")
         debian_cmp_remap(rdepends)
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index f67cb0e5c90..9fe3c52fae3 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -168,13 +168,18 @@ def ipk_write_pkg(pkg, d):
             #   '<' = less or equal
             #   '>' = greater or equal
             # adjust these to the '<<' and '>>' equivalents
-            #
+            # Also, "=" specifiers only work if they have the PR in, so 1.2.3 
!= 1.2.3-r0
+            # so to avoid issues, map this to ">= 1.2.3 << 1.2.3.0"
             for dep in var:
                 for i, v in enumerate(var[dep]):
                     if (v or "").startswith("< "):
                         var[dep][i] = var[dep][i].replace("< ", "<< ")
                     elif (v or "").startswith("> "):
                         var[dep][i] = var[dep][i].replace("> ", ">> ")
+                    elif (v or "").startswith("= ") and "-r" not in v:
+                        ver = var[dep][i].replace("= ", "")
+                        var[dep][i] = var[dep][i].replace("= ", ">= ")
+                        var[dep].append("<< " + ver + ".0")
 
         rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") 
or "")
         debian_cmp_remap(rdepends)
-- 
2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164116): 
https://lists.openembedded.org/g/openembedded-core/message/164116
Mute This Topic: https://lists.openembedded.org/mt/90317542/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to