summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
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):