diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-07 17:33:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-10 08:31:17 +0100 |
commit | 21f0318abc5c0405d134ac4bbb8ed9b9294fc17d (patch) | |
tree | fba898730a7b4db7d9dd3cbab5e85bf62bfecb8d | |
parent | 3d4e5a0b7fdf1d17d308bc1fa7752f934b5b91e5 (diff) | |
download | poky-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>
-rw-r--r-- | meta/classes/package_deb.bbclass | 7 | ||||
-rw-r--r-- | 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 2e75e222bc..a9b8ba0118 100644 --- a/meta/classes/package_deb.bbclass +++ b/meta/classes/package_deb.bbclass | |||
@@ -182,7 +182,8 @@ def deb_write_pkg(pkg, d): | |||
182 | # '<' = less or equal | 182 | # '<' = less or equal |
183 | # '>' = greater or equal | 183 | # '>' = greater or equal |
184 | # adjust these to the '<<' and '>>' equivalents | 184 | # adjust these to the '<<' and '>>' equivalents |
185 | # | 185 | # Also, "=" specifiers only work if they have the PR in, so 1.2.3 != 1.2.3-r0 |
186 | # so to avoid issues, map this to ">= 1.2.3 << 1.2.3.0" | ||
186 | for dep in list(var.keys()): | 187 | for dep in list(var.keys()): |
187 | if '(' in dep or '/' in dep: | 188 | if '(' in dep or '/' in dep: |
188 | newdep = re.sub(r'[(:)/]', '__', dep) | 189 | newdep = re.sub(r'[(:)/]', '__', dep) |
@@ -197,6 +198,10 @@ def deb_write_pkg(pkg, d): | |||
197 | var[dep][i] = var[dep][i].replace("< ", "<< ") | 198 | var[dep][i] = var[dep][i].replace("< ", "<< ") |
198 | elif (v or "").startswith("> "): | 199 | elif (v or "").startswith("> "): |
199 | var[dep][i] = var[dep][i].replace("> ", ">> ") | 200 | var[dep][i] = var[dep][i].replace("> ", ">> ") |
201 | elif (v or "").startswith("= ") and "-r" not in v: | ||
202 | ver = var[dep][i].replace("= ", "") | ||
203 | var[dep][i] = var[dep][i].replace("= ", ">= ") | ||
204 | var[dep].append("<< " + ver + ".0") | ||
200 | 205 | ||
201 | rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "") | 206 | rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "") |
202 | debian_cmp_remap(rdepends) | 207 | debian_cmp_remap(rdepends) |
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) |