summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-11-24 20:37:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-11 17:21:43 +0000
commit468b78967a44c0438c55be2d73bc159658f57c41 (patch)
tree026b356ca0ec244a423505a85c4de98c934b4ef4
parent93b13d9995ccfc478f5733463c9a394a60b5e309 (diff)
downloadpoky-468b78967a44c0438c55be2d73bc159658f57c41.tar.gz
insane: rewrite the expanded-d test as a QAPKGTEST
Instead of being executed for every file in every package, this is now just called for each package. It is also now correctly called for packages which don't have any content but do have postinst scripts. [ YOCTO #10711 ] (From OE-Core rev: afda72b2424528eaff9054327530bdf5654bec66) (From OE-Core rev: b653bfb800a470894ec93c8bb4acd12a143716a6) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/insane.bbclass32
1 files changed, 13 insertions, 19 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 407ccee739..5ddb87b3f7 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -1002,30 +1002,24 @@ def package_qa_check_deps(pkg, pkgdest, skip, d):
1002 check_valid_deps('RREPLACES') 1002 check_valid_deps('RREPLACES')
1003 check_valid_deps('RCONFLICTS') 1003 check_valid_deps('RCONFLICTS')
1004 1004
1005QAPATHTEST[expanded-d] = "package_qa_check_expanded_d" 1005QAPKGTEST[expanded-d] = "package_qa_check_expanded_d"
1006def package_qa_check_expanded_d(path,name,d,elf,messages): 1006def package_qa_check_expanded_d(package, d, messages):
1007 """ 1007 """
1008 Check for the expanded D (${D}) value in pkg_* and FILES 1008 Check for the expanded D (${D}) value in pkg_* and FILES
1009 variables, warn the user to use it correctly. 1009 variables, warn the user to use it correctly.
1010 """ 1010 """
1011
1012 sane = True 1011 sane = True
1013 expanded_d = d.getVar('D',True) 1012 expanded_d = d.getVar('D', True)
1014 1013
1015 # Get packages for current recipe and iterate 1014 for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm':
1016 packages = d.getVar('PACKAGES', True).split(" ") 1015 bbvar = d.getVar(var + "_" + package, True) or ""
1017 for pak in packages: 1016 if expanded_d in bbvar:
1018 # Go through all variables and check if expanded D is found, warn the user accordingly 1017 if var == 'FILES':
1019 for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm': 1018 package_qa_add_message(messages, "expanded-d", "FILES in %s recipe should not contain the ${D} variable as it references the local build directory not the target filesystem, best solution is to remove the ${D} reference" % package)
1020 bbvar = d.getVar(var + "_" + pak, True) 1019 sane = False
1021 if bbvar: 1020 else:
1022 if expanded_d in bbvar: 1021 package_qa_add_message(messages, "expanded-d", "%s in %s recipe contains ${D}, it should be replaced by $D instead" % (var, package))
1023 if var == 'FILES': 1022 sane = False
1024 package_qa_add_message(messages, "expanded-d", "FILES in %s recipe should not contain the ${D} variable as it references the local build directory not the target filesystem, best solution is to remove the ${D} reference" % pak)
1025 sane = False
1026 else:
1027 package_qa_add_message(messages, "expanded-d", "%s in %s recipe contains ${D}, it should be replaced by $D instead" % (var, pak))
1028 sane = False
1029 return sane 1023 return sane
1030 1024
1031def package_qa_check_encoding(keys, encode, d): 1025def package_qa_check_encoding(keys, encode, d):