summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-27 21:48:54 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-29 21:21:53 +0000
commitb033409243932a1d4e565d87154a436fa8531f1f (patch)
tree41fe51b2ffce66e2394c41b328f68ede1a987d28 /meta/classes/package_rpm.bbclass
parentf9d0bc709fa34382a0079e9bb83bbb614a00629a (diff)
downloadpoky-b033409243932a1d4e565d87154a436fa8531f1f.tar.gz
package_rpm: Clean up unset runtime package variable handling
If the R* runtime package variables are unset it could cause trackbacks. There were some fallbacks already, clean this up to handle consistently. The code was expecting strings but setting defaults of empty lists which silently were converted to strings by the "or" statements which was a nightmare to understand or alter. (From OE-Core rev: 06bf68012302330c2b14f59541f78f48c7389c37) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass40
1 files changed, 20 insertions, 20 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 53b4700cdd..43a825ad42 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -300,13 +300,13 @@ python write_specfile () {
300 srccustomtagschunk = get_package_additional_metadata("rpm", localdata) 300 srccustomtagschunk = get_package_additional_metadata("rpm", localdata)
301 301
302 srcdepends = d.getVar('DEPENDS') 302 srcdepends = d.getVar('DEPENDS')
303 srcrdepends = [] 303 srcrdepends = ""
304 srcrrecommends = [] 304 srcrrecommends = ""
305 srcrsuggests = [] 305 srcrsuggests = ""
306 srcrprovides = [] 306 srcrprovides = ""
307 srcrreplaces = [] 307 srcrreplaces = ""
308 srcrconflicts = [] 308 srcrconflicts = ""
309 srcrobsoletes = [] 309 srcrobsoletes = ""
310 310
311 srcrpreinst = [] 311 srcrpreinst = []
312 srcrpostinst = [] 312 srcrpostinst = []
@@ -365,13 +365,13 @@ python write_specfile () {
365 # Map the dependencies into their final form 365 # Map the dependencies into their final form
366 mapping_rename_hook(localdata) 366 mapping_rename_hook(localdata)
367 367
368 splitrdepends = localdata.getVar('RDEPENDS') 368 splitrdepends = localdata.getVar('RDEPENDS') or ""
369 splitrrecommends = localdata.getVar('RRECOMMENDS') 369 splitrrecommends = localdata.getVar('RRECOMMENDS') or ""
370 splitrsuggests = localdata.getVar('RSUGGESTS') 370 splitrsuggests = localdata.getVar('RSUGGESTS') or ""
371 splitrprovides = localdata.getVar('RPROVIDES') 371 splitrprovides = localdata.getVar('RPROVIDES') or ""
372 splitrreplaces = localdata.getVar('RREPLACES') 372 splitrreplaces = localdata.getVar('RREPLACES') or ""
373 splitrconflicts = localdata.getVar('RCONFLICTS') 373 splitrconflicts = localdata.getVar('RCONFLICTS') or ""
374 splitrobsoletes = [] 374 splitrobsoletes = ""
375 375
376 splitrpreinst = localdata.getVar('pkg_preinst') 376 splitrpreinst = localdata.getVar('pkg_preinst')
377 splitrpostinst = localdata.getVar('pkg_postinst') 377 splitrpostinst = localdata.getVar('pkg_postinst')
@@ -439,9 +439,9 @@ python write_specfile () {
439 spec_preamble_bottom.append(splitcustomtagschunk) 439 spec_preamble_bottom.append(splitcustomtagschunk)
440 440
441 # Replaces == Obsoletes && Provides 441 # Replaces == Obsoletes && Provides
442 robsoletes = bb.utils.explode_dep_versions2(splitrobsoletes or "") 442 robsoletes = bb.utils.explode_dep_versions2(splitrobsoletes)
443 rprovides = bb.utils.explode_dep_versions2(splitrprovides or "") 443 rprovides = bb.utils.explode_dep_versions2(splitrprovides)
444 rreplaces = bb.utils.explode_dep_versions2(splitrreplaces or "") 444 rreplaces = bb.utils.explode_dep_versions2(splitrreplaces)
445 for dep in rreplaces: 445 for dep in rreplaces:
446 if not dep in robsoletes: 446 if not dep in robsoletes:
447 robsoletes[dep] = rreplaces[dep] 447 robsoletes[dep] = rreplaces[dep]
@@ -533,9 +533,9 @@ python write_specfile () {
533 tail_source(d) 533 tail_source(d)
534 534
535 # Replaces == Obsoletes && Provides 535 # Replaces == Obsoletes && Provides
536 robsoletes = bb.utils.explode_dep_versions2(srcrobsoletes or "") 536 robsoletes = bb.utils.explode_dep_versions2(srcrobsoletes)
537 rprovides = bb.utils.explode_dep_versions2(srcrprovides or "") 537 rprovides = bb.utils.explode_dep_versions2(srcrprovides)
538 rreplaces = bb.utils.explode_dep_versions2(srcrreplaces or "") 538 rreplaces = bb.utils.explode_dep_versions2(srcrreplaces)
539 for dep in rreplaces: 539 for dep in rreplaces:
540 if not dep in robsoletes: 540 if not dep in robsoletes:
541 robsoletes[dep] = rreplaces[dep] 541 robsoletes[dep] = rreplaces[dep]