summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-11-24 20:37:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-30 15:48:07 +0000
commitbfcf8770d060b25411f4444cd06f5c8858ba265a (patch)
treed828545ab63e9c33f8a75f3d9b40a851ad873831 /meta/classes/insane.bbclass
parentb8f0acf70d68357a1917719d42aa21a4bf6234fb (diff)
downloadpoky-bfcf8770d060b25411f4444cd06f5c8858ba265a.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) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-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):