mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
b8f0acf70d
commit
bfcf8770d0
+12
-18
@@ -1002,30 +1002,24 @@ def package_qa_check_deps(pkg, pkgdest, skip, d):
|
|||||||
check_valid_deps('RREPLACES')
|
check_valid_deps('RREPLACES')
|
||||||
check_valid_deps('RCONFLICTS')
|
check_valid_deps('RCONFLICTS')
|
||||||
|
|
||||||
QAPATHTEST[expanded-d] = "package_qa_check_expanded_d"
|
QAPKGTEST[expanded-d] = "package_qa_check_expanded_d"
|
||||||
def package_qa_check_expanded_d(path,name,d,elf,messages):
|
def package_qa_check_expanded_d(package, d, messages):
|
||||||
"""
|
"""
|
||||||
Check for the expanded D (${D}) value in pkg_* and FILES
|
Check for the expanded D (${D}) value in pkg_* and FILES
|
||||||
variables, warn the user to use it correctly.
|
variables, warn the user to use it correctly.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
sane = True
|
sane = True
|
||||||
expanded_d = d.getVar('D',True)
|
expanded_d = d.getVar('D', True)
|
||||||
|
|
||||||
# Get packages for current recipe and iterate
|
for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm':
|
||||||
packages = d.getVar('PACKAGES', True).split(" ")
|
bbvar = d.getVar(var + "_" + package, True) or ""
|
||||||
for pak in packages:
|
if expanded_d in bbvar:
|
||||||
# Go through all variables and check if expanded D is found, warn the user accordingly
|
if var == 'FILES':
|
||||||
for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm':
|
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)
|
||||||
bbvar = d.getVar(var + "_" + pak, True)
|
sane = False
|
||||||
if bbvar:
|
else:
|
||||||
if expanded_d in bbvar:
|
package_qa_add_message(messages, "expanded-d", "%s in %s recipe contains ${D}, it should be replaced by $D instead" % (var, package))
|
||||||
if var == 'FILES':
|
sane = False
|
||||||
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)
|
|
||||||
sane = False
|
|
||||||
else:
|
|
||||||
package_qa_add_message(messages, "expanded-d", "%s in %s recipe contains ${D}, it should be replaced by $D instead" % (var, pak))
|
|
||||||
sane = False
|
|
||||||
return sane
|
return sane
|
||||||
|
|
||||||
def package_qa_check_encoding(keys, encode, d):
|
def package_qa_check_encoding(keys, encode, d):
|
||||||
|
|||||||
Reference in New Issue
Block a user