summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-07-19 13:47:18 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-26 13:16:40 +0100
commit869e501544960f638edfe17c9d7500b54d05837e (patch)
treef6967d2d1648f92fd2ec780b02971e0eb8f4c2e4 /scripts/lib/recipetool
parent53b50b5d11dfd6f299116edc7254ebc1f29f19e5 (diff)
downloadpoky-869e501544960f638edfe17c9d7500b54d05837e.tar.gz
logging: use warning instead warn
The warn method is deprecated. We should use the documented warning instead. Quoting from the python's official doc: """ Note: There is an obsolete method warn which is functionally identical to warning. As warn is deprecated, please do not use it - use warning instead. """ (From OE-Core rev: f467fd277eb77336097cfc0f5f329bdc8d0f70cb) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool')
-rw-r--r--scripts/lib/recipetool/append.py14
-rw-r--r--scripts/lib/recipetool/create.py4
-rw-r--r--scripts/lib/recipetool/create_kmod.py2
-rw-r--r--scripts/lib/recipetool/create_npm.py6
-rw-r--r--scripts/lib/recipetool/newappend.py4
5 files changed, 15 insertions, 15 deletions
diff --git a/scripts/lib/recipetool/append.py b/scripts/lib/recipetool/append.py
index 69c8bb77a0..3f2c134ad5 100644
--- a/scripts/lib/recipetool/append.py
+++ b/scripts/lib/recipetool/append.py
@@ -238,7 +238,7 @@ def appendfile(args):
238 if stdout: 238 if stdout:
239 logger.debug('file command output: %s' % stdout.rstrip()) 239 logger.debug('file command output: %s' % stdout.rstrip())
240 if ('executable' in stdout and not 'shell script' in stdout) or 'shared object' in stdout: 240 if ('executable' in stdout and not 'shell script' in stdout) or 'shared object' in stdout:
241 logger.warn('This file looks like it is a binary or otherwise the output of compilation. If it is, you should consider building it properly instead of substituting a binary file directly.') 241 logger.warning('This file looks like it is a binary or otherwise the output of compilation. If it is, you should consider building it properly instead of substituting a binary file directly.')
242 242
243 if args.recipe: 243 if args.recipe:
244 recipes = {args.targetpath: [args.recipe],} 244 recipes = {args.targetpath: [args.recipe],}
@@ -275,7 +275,7 @@ def appendfile(args):
275 if selectpn: 275 if selectpn:
276 logger.debug('Selecting recipe %s for file %s' % (selectpn, args.targetpath)) 276 logger.debug('Selecting recipe %s for file %s' % (selectpn, args.targetpath))
277 if postinst_pns: 277 if postinst_pns:
278 logger.warn('%s be modified by postinstall scripts for the following recipes:\n %s\nThis may or may not be an issue depending on what modifications these postinstall scripts make.' % (args.targetpath, '\n '.join(postinst_pns))) 278 logger.warning('%s be modified by postinstall scripts for the following recipes:\n %s\nThis may or may not be an issue depending on what modifications these postinstall scripts make.' % (args.targetpath, '\n '.join(postinst_pns)))
279 rd = _parse_recipe(selectpn, tinfoil) 279 rd = _parse_recipe(selectpn, tinfoil)
280 if not rd: 280 if not rd:
281 # Error message already shown 281 # Error message already shown
@@ -286,12 +286,12 @@ def appendfile(args):
286 sourcetype, sourcepath = sourcefile.split('://', 1) 286 sourcetype, sourcepath = sourcefile.split('://', 1)
287 logger.debug('Original source file is %s (%s)' % (sourcepath, sourcetype)) 287 logger.debug('Original source file is %s (%s)' % (sourcepath, sourcetype))
288 if sourcetype == 'patch': 288 if sourcetype == 'patch':
289 logger.warn('File %s is added by the patch %s - you may need to remove or replace this patch in order to replace the file.' % (args.targetpath, sourcepath)) 289 logger.warning('File %s is added by the patch %s - you may need to remove or replace this patch in order to replace the file.' % (args.targetpath, sourcepath))
290 sourcepath = None 290 sourcepath = None
291 else: 291 else:
292 logger.debug('Unable to determine source file, proceeding anyway') 292 logger.debug('Unable to determine source file, proceeding anyway')
293 if modpatches: 293 if modpatches:
294 logger.warn('File %s is modified by the following patches:\n %s' % (args.targetpath, '\n '.join(modpatches))) 294 logger.warning('File %s is modified by the following patches:\n %s' % (args.targetpath, '\n '.join(modpatches)))
295 295
296 if instelements and sourcepath: 296 if instelements and sourcepath:
297 install = None 297 install = None
@@ -343,7 +343,7 @@ def appendsrc(args, files, rd, extralines=None):
343 if rd.getVar('S') == rd.getVar('STAGING_KERNEL_DIR'): 343 if rd.getVar('S') == rd.getVar('STAGING_KERNEL_DIR'):
344 srcdir = os.path.join(workdir, 'git') 344 srcdir = os.path.join(workdir, 'git')
345 if not bb.data.inherits_class('kernel-yocto', rd): 345 if not bb.data.inherits_class('kernel-yocto', rd):
346 logger.warn('S == STAGING_KERNEL_DIR and non-kernel-yocto, unable to determine path to srcdir, defaulting to ${WORKDIR}/git') 346 logger.warning('S == STAGING_KERNEL_DIR and non-kernel-yocto, unable to determine path to srcdir, defaulting to ${WORKDIR}/git')
347 src_destdir = os.path.join(os.path.relpath(srcdir, workdir), src_destdir) 347 src_destdir = os.path.join(os.path.relpath(srcdir, workdir), src_destdir)
348 src_destdir = os.path.normpath(src_destdir) 348 src_destdir = os.path.normpath(src_destdir)
349 349
@@ -357,9 +357,9 @@ def appendsrc(args, files, rd, extralines=None):
357 if simple_str in simplified: 357 if simple_str in simplified:
358 existing = simplified[simple_str] 358 existing = simplified[simple_str]
359 if source_uri != existing: 359 if source_uri != existing:
360 logger.warn('{0!r} is already in SRC_URI, with different parameters: {1!r}, not adding'.format(source_uri, existing)) 360 logger.warning('{0!r} is already in SRC_URI, with different parameters: {1!r}, not adding'.format(source_uri, existing))
361 else: 361 else:
362 logger.warn('{0!r} is already in SRC_URI, not adding'.format(source_uri)) 362 logger.warning('{0!r} is already in SRC_URI, not adding'.format(source_uri))
363 else: 363 else:
364 extralines.append('SRC_URI += {0}'.format(source_uri)) 364 extralines.append('SRC_URI += {0}'.format(source_uri))
365 copyfiles[newfile] = srcfile 365 copyfiles[newfile] = srcfile
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index a3710285bb..1810c70ae2 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -98,7 +98,7 @@ class RecipeHandler(object):
98 break 98 break
99 except IOError as ioe: 99 except IOError as ioe:
100 if ioe.errno == 2: 100 if ioe.errno == 2:
101 logger.warn('unable to find a pkgdata file for package %s' % pkg) 101 logger.warning('unable to find a pkgdata file for package %s' % pkg)
102 else: 102 else:
103 raise 103 raise
104 104
@@ -437,7 +437,7 @@ def create_recipe(args):
437 if scriptutils.is_src_url(source): 437 if scriptutils.is_src_url(source):
438 # Warn about github archive URLs 438 # Warn about github archive URLs
439 if re.match('https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source): 439 if re.match('https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source):
440 logger.warn('github archive files are not guaranteed to be stable and may be re-generated over time. If the latter occurs, the checksums will likely change and the recipe will fail at do_fetch. It is recommended that you point to an actual commit or tag in the repository instead (using the repository URL in conjunction with the -S/--srcrev option).') 440 logger.warning('github archive files are not guaranteed to be stable and may be re-generated over time. If the latter occurs, the checksums will likely change and the recipe will fail at do_fetch. It is recommended that you point to an actual commit or tag in the repository instead (using the repository URL in conjunction with the -S/--srcrev option).')
441 # Fetch a URL 441 # Fetch a URL
442 fetchuri = reformat_git_uri(urldefrag(source)[0]) 442 fetchuri = reformat_git_uri(urldefrag(source)[0])
443 if args.binary: 443 if args.binary:
diff --git a/scripts/lib/recipetool/create_kmod.py b/scripts/lib/recipetool/create_kmod.py
index 4569b53c80..3982537a4e 100644
--- a/scripts/lib/recipetool/create_kmod.py
+++ b/scripts/lib/recipetool/create_kmod.py
@@ -141,7 +141,7 @@ class KernelModuleRecipeHandler(RecipeHandler):
141 warnmsg = 'Unable to find means of passing kernel path into install makefile - if kernel path is hardcoded you will need to patch the makefile' 141 warnmsg = 'Unable to find means of passing kernel path into install makefile - if kernel path is hardcoded you will need to patch the makefile'
142 if warnmsg: 142 if warnmsg:
143 warnmsg += '. Note that the variable KERNEL_SRC will be passed in as the kernel source path.' 143 warnmsg += '. Note that the variable KERNEL_SRC will be passed in as the kernel source path.'
144 logger.warn(warnmsg) 144 logger.warning(warnmsg)
145 lines_after.append('# %s' % warnmsg) 145 lines_after.append('# %s' % warnmsg)
146 146
147 return True 147 return True
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py
index bb42a5ca5c..03667887fc 100644
--- a/scripts/lib/recipetool/create_npm.py
+++ b/scripts/lib/recipetool/create_npm.py
@@ -90,7 +90,7 @@ class NpmRecipeHandler(RecipeHandler):
90 runenv = dict(os.environ, PATH=d.getVar('PATH')) 90 runenv = dict(os.environ, PATH=d.getVar('PATH'))
91 bb.process.run('npm shrinkwrap', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True) 91 bb.process.run('npm shrinkwrap', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
92 except bb.process.ExecutionError as e: 92 except bb.process.ExecutionError as e:
93 logger.warn('npm shrinkwrap failed:\n%s' % e.stdout) 93 logger.warning('npm shrinkwrap failed:\n%s' % e.stdout)
94 return 94 return
95 95
96 tmpfile = os.path.join(localfilesdir, 'npm-shrinkwrap.json') 96 tmpfile = os.path.join(localfilesdir, 'npm-shrinkwrap.json')
@@ -107,12 +107,12 @@ class NpmRecipeHandler(RecipeHandler):
107 cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True) 107 cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
108 relockbin = os.path.join(NpmRecipeHandler.lockdownpath, 'node_modules', 'lockdown', 'relock.js') 108 relockbin = os.path.join(NpmRecipeHandler.lockdownpath, 'node_modules', 'lockdown', 'relock.js')
109 if not os.path.exists(relockbin): 109 if not os.path.exists(relockbin):
110 logger.warn('Could not find relock.js within lockdown directory; skipping lockdown') 110 logger.warning('Could not find relock.js within lockdown directory; skipping lockdown')
111 return 111 return
112 try: 112 try:
113 bb.process.run('node %s' % relockbin, cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True) 113 bb.process.run('node %s' % relockbin, cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
114 except bb.process.ExecutionError as e: 114 except bb.process.ExecutionError as e:
115 logger.warn('lockdown-relock failed:\n%s' % e.stdout) 115 logger.warning('lockdown-relock failed:\n%s' % e.stdout)
116 return 116 return
117 117
118 tmpfile = os.path.join(localfilesdir, 'lockdown.json') 118 tmpfile = os.path.join(localfilesdir, 'lockdown.json')
diff --git a/scripts/lib/recipetool/newappend.py b/scripts/lib/recipetool/newappend.py
index decce83fac..76707b4c91 100644
--- a/scripts/lib/recipetool/newappend.py
+++ b/scripts/lib/recipetool/newappend.py
@@ -58,11 +58,11 @@ def newappend(args):
58 return 1 58 return 1
59 59
60 if not path_ok: 60 if not path_ok:
61 logger.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path)) 61 logger.warning('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path))
62 62
63 layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()] 63 layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
64 if not os.path.abspath(args.destlayer) in layerdirs: 64 if not os.path.abspath(args.destlayer) in layerdirs:
65 logger.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active') 65 logger.warning('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')
66 66
67 if not os.path.exists(append_path): 67 if not os.path.exists(append_path):
68 bb.utils.mkdirhier(os.path.dirname(append_path)) 68 bb.utils.mkdirhier(os.path.dirname(append_path))