mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 09:32:14 +02:00
meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> 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
d5e67725ac
commit
c4e2c59088
@@ -31,25 +31,25 @@ DOC_DECOMPRESS_CMD[xz] ?= "unxz -v"
|
||||
|
||||
PACKAGE_PREPROCESS_FUNCS += "package_do_compress_doc compress_doc_updatealternatives"
|
||||
python package_do_compress_doc() {
|
||||
compress_mode = d.getVar('DOC_COMPRESS', True)
|
||||
compress_list = (d.getVar('DOC_COMPRESS_LIST', True) or '').split()
|
||||
compress_mode = d.getVar('DOC_COMPRESS')
|
||||
compress_list = (d.getVar('DOC_COMPRESS_LIST') or '').split()
|
||||
if compress_mode not in compress_list:
|
||||
bb.fatal('Compression policy %s not supported (not listed in %s)\n' % (compress_mode, compress_list))
|
||||
|
||||
dvar = d.getVar('PKGD', True)
|
||||
dvar = d.getVar('PKGD')
|
||||
compress_cmds = {}
|
||||
decompress_cmds = {}
|
||||
for mode in compress_list:
|
||||
compress_cmds[mode] = d.getVarFlag('DOC_COMPRESS_CMD', mode, True)
|
||||
decompress_cmds[mode] = d.getVarFlag('DOC_DECOMPRESS_CMD', mode, True)
|
||||
|
||||
mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir", True))
|
||||
mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir"))
|
||||
if os.path.exists(mandir):
|
||||
# Decompress doc files which format is not compress_mode
|
||||
decompress_doc(mandir, compress_mode, decompress_cmds)
|
||||
compress_doc(mandir, compress_mode, compress_cmds)
|
||||
|
||||
infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir", True))
|
||||
infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir"))
|
||||
if os.path.exists(infodir):
|
||||
# Decompress doc files which format is not compress_mode
|
||||
decompress_doc(infodir, compress_mode, decompress_cmds)
|
||||
@@ -218,18 +218,18 @@ python compress_doc_updatealternatives () {
|
||||
if not bb.data.inherits_class('update-alternatives', d):
|
||||
return
|
||||
|
||||
mandir = d.getVar("mandir", True)
|
||||
infodir = d.getVar("infodir", True)
|
||||
compress_mode = d.getVar('DOC_COMPRESS', True)
|
||||
for pkg in (d.getVar('PACKAGES', True) or "").split():
|
||||
old_names = (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split()
|
||||
mandir = d.getVar("mandir")
|
||||
infodir = d.getVar("infodir")
|
||||
compress_mode = d.getVar('DOC_COMPRESS')
|
||||
for pkg in (d.getVar('PACKAGES') or "").split():
|
||||
old_names = (d.getVar('ALTERNATIVE_%s' % pkg) or "").split()
|
||||
new_names = []
|
||||
for old_name in old_names:
|
||||
old_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', old_name, True)
|
||||
old_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name, True) or \
|
||||
d.getVarFlag('ALTERNATIVE_TARGET', old_name, True) or \
|
||||
d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or \
|
||||
d.getVar('ALTERNATIVE_TARGET', True) or \
|
||||
d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or \
|
||||
d.getVar('ALTERNATIVE_TARGET') or \
|
||||
old_link
|
||||
# Sometimes old_target is specified as relative to the link name.
|
||||
old_target = os.path.join(os.path.dirname(old_link), old_target)
|
||||
@@ -247,7 +247,7 @@ python compress_doc_updatealternatives () {
|
||||
elif d.getVarFlag('ALTERNATIVE_TARGET', old_name, True):
|
||||
d.delVarFlag('ALTERNATIVE_TARGET', old_name)
|
||||
d.setVarFlag('ALTERNATIVE_TARGET', new_name, new_target)
|
||||
elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True):
|
||||
elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg):
|
||||
d.setVar('ALTERNATIVE_TARGET_%s' % pkg, new_target)
|
||||
elif d.getVar('ALTERNATIVE_TARGET', old_name, True):
|
||||
d.setVar('ALTERNATIVE_TARGET', new_target)
|
||||
|
||||
Reference in New Issue
Block a user