summaryrefslogtreecommitdiffstats
path: root/meta/classes/compress_doc.bbclass
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-12-14 21:13:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-16 10:23:23 +0000
commitc4e2c59088765d1f1de7ec57cde91980f887c2ff (patch)
treea2fda8ac5916fb59a711e9220c2177008cca9347 /meta/classes/compress_doc.bbclass
parentd5e67725ac11e3296cad104470931ffa16824b90 (diff)
downloadpoky-c4e2c59088765d1f1de7ec57cde91980f887c2ff.tar.gz
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>
Diffstat (limited to 'meta/classes/compress_doc.bbclass')
-rw-r--r--meta/classes/compress_doc.bbclass26
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/classes/compress_doc.bbclass b/meta/classes/compress_doc.bbclass
index 8073c173e5..069db1997b 100644
--- a/meta/classes/compress_doc.bbclass
+++ b/meta/classes/compress_doc.bbclass
@@ -31,25 +31,25 @@ DOC_DECOMPRESS_CMD[xz] ?= "unxz -v"
31 31
32PACKAGE_PREPROCESS_FUNCS += "package_do_compress_doc compress_doc_updatealternatives" 32PACKAGE_PREPROCESS_FUNCS += "package_do_compress_doc compress_doc_updatealternatives"
33python package_do_compress_doc() { 33python package_do_compress_doc() {
34 compress_mode = d.getVar('DOC_COMPRESS', True) 34 compress_mode = d.getVar('DOC_COMPRESS')
35 compress_list = (d.getVar('DOC_COMPRESS_LIST', True) or '').split() 35 compress_list = (d.getVar('DOC_COMPRESS_LIST') or '').split()
36 if compress_mode not in compress_list: 36 if compress_mode not in compress_list:
37 bb.fatal('Compression policy %s not supported (not listed in %s)\n' % (compress_mode, compress_list)) 37 bb.fatal('Compression policy %s not supported (not listed in %s)\n' % (compress_mode, compress_list))
38 38
39 dvar = d.getVar('PKGD', True) 39 dvar = d.getVar('PKGD')
40 compress_cmds = {} 40 compress_cmds = {}
41 decompress_cmds = {} 41 decompress_cmds = {}
42 for mode in compress_list: 42 for mode in compress_list:
43 compress_cmds[mode] = d.getVarFlag('DOC_COMPRESS_CMD', mode, True) 43 compress_cmds[mode] = d.getVarFlag('DOC_COMPRESS_CMD', mode, True)
44 decompress_cmds[mode] = d.getVarFlag('DOC_DECOMPRESS_CMD', mode, True) 44 decompress_cmds[mode] = d.getVarFlag('DOC_DECOMPRESS_CMD', mode, True)
45 45
46 mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir", True)) 46 mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir"))
47 if os.path.exists(mandir): 47 if os.path.exists(mandir):
48 # Decompress doc files which format is not compress_mode 48 # Decompress doc files which format is not compress_mode
49 decompress_doc(mandir, compress_mode, decompress_cmds) 49 decompress_doc(mandir, compress_mode, decompress_cmds)
50 compress_doc(mandir, compress_mode, compress_cmds) 50 compress_doc(mandir, compress_mode, compress_cmds)
51 51
52 infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir", True)) 52 infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir"))
53 if os.path.exists(infodir): 53 if os.path.exists(infodir):
54 # Decompress doc files which format is not compress_mode 54 # Decompress doc files which format is not compress_mode
55 decompress_doc(infodir, compress_mode, decompress_cmds) 55 decompress_doc(infodir, compress_mode, decompress_cmds)
@@ -218,18 +218,18 @@ python compress_doc_updatealternatives () {
218 if not bb.data.inherits_class('update-alternatives', d): 218 if not bb.data.inherits_class('update-alternatives', d):
219 return 219 return
220 220
221 mandir = d.getVar("mandir", True) 221 mandir = d.getVar("mandir")
222 infodir = d.getVar("infodir", True) 222 infodir = d.getVar("infodir")
223 compress_mode = d.getVar('DOC_COMPRESS', True) 223 compress_mode = d.getVar('DOC_COMPRESS')
224 for pkg in (d.getVar('PACKAGES', True) or "").split(): 224 for pkg in (d.getVar('PACKAGES') or "").split():
225 old_names = (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split() 225 old_names = (d.getVar('ALTERNATIVE_%s' % pkg) or "").split()
226 new_names = [] 226 new_names = []
227 for old_name in old_names: 227 for old_name in old_names:
228 old_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', old_name, True) 228 old_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', old_name, True)
229 old_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name, True) or \ 229 old_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name, True) or \
230 d.getVarFlag('ALTERNATIVE_TARGET', old_name, True) or \ 230 d.getVarFlag('ALTERNATIVE_TARGET', old_name, True) or \
231 d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or \ 231 d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or \
232 d.getVar('ALTERNATIVE_TARGET', True) or \ 232 d.getVar('ALTERNATIVE_TARGET') or \
233 old_link 233 old_link
234 # Sometimes old_target is specified as relative to the link name. 234 # Sometimes old_target is specified as relative to the link name.
235 old_target = os.path.join(os.path.dirname(old_link), old_target) 235 old_target = os.path.join(os.path.dirname(old_link), old_target)
@@ -247,7 +247,7 @@ python compress_doc_updatealternatives () {
247 elif d.getVarFlag('ALTERNATIVE_TARGET', old_name, True): 247 elif d.getVarFlag('ALTERNATIVE_TARGET', old_name, True):
248 d.delVarFlag('ALTERNATIVE_TARGET', old_name) 248 d.delVarFlag('ALTERNATIVE_TARGET', old_name)
249 d.setVarFlag('ALTERNATIVE_TARGET', new_name, new_target) 249 d.setVarFlag('ALTERNATIVE_TARGET', new_name, new_target)
250 elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True): 250 elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg):
251 d.setVar('ALTERNATIVE_TARGET_%s' % pkg, new_target) 251 d.setVar('ALTERNATIVE_TARGET_%s' % pkg, new_target)
252 elif d.getVar('ALTERNATIVE_TARGET', old_name, True): 252 elif d.getVar('ALTERNATIVE_TARGET', old_name, True):
253 d.setVar('ALTERNATIVE_TARGET', new_target) 253 d.setVar('ALTERNATIVE_TARGET', new_target)