summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_ipk.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-07 17:33:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-10 08:31:17 +0100
commit21f0318abc5c0405d134ac4bbb8ed9b9294fc17d (patch)
treefba898730a7b4db7d9dd3cbab5e85bf62bfecb8d /meta/classes/package_ipk.bbclass
parent3d4e5a0b7fdf1d17d308bc1fa7752f934b5b91e5 (diff)
downloadpoky-21f0318abc5c0405d134ac4bbb8ed9b9294fc17d.tar.gz
package_ipk/deb: Fix specific version handling
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. (From OE-Core rev: 3ba177a1b8e553716f45606aa65b0a74e55d94c1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_ipk.bbclass')
-rw-r--r--meta/classes/package_ipk.bbclass7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index f67cb0e5c9..9fe3c52fae 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -168,13 +168,18 @@ def ipk_write_pkg(pkg, d):
168 # '<' = less or equal 168 # '<' = less or equal
169 # '>' = greater or equal 169 # '>' = greater or equal
170 # adjust these to the '<<' and '>>' equivalents 170 # adjust these to the '<<' and '>>' equivalents
171 # 171 # Also, "=" specifiers only work if they have the PR in, so 1.2.3 != 1.2.3-r0
172 # so to avoid issues, map this to ">= 1.2.3 << 1.2.3.0"
172 for dep in var: 173 for dep in var:
173 for i, v in enumerate(var[dep]): 174 for i, v in enumerate(var[dep]):
174 if (v or "").startswith("< "): 175 if (v or "").startswith("< "):
175 var[dep][i] = var[dep][i].replace("< ", "<< ") 176 var[dep][i] = var[dep][i].replace("< ", "<< ")
176 elif (v or "").startswith("> "): 177 elif (v or "").startswith("> "):
177 var[dep][i] = var[dep][i].replace("> ", ">> ") 178 var[dep][i] = var[dep][i].replace("> ", ">> ")
179 elif (v or "").startswith("= ") and "-r" not in v:
180 ver = var[dep][i].replace("= ", "")
181 var[dep][i] = var[dep][i].replace("= ", ">= ")
182 var[dep].append("<< " + ver + ".0")
178 183
179 rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "") 184 rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "")
180 debian_cmp_remap(rdepends) 185 debian_cmp_remap(rdepends)