summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool
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/devtool
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/devtool')
-rw-r--r--scripts/lib/devtool/export.py2
-rw-r--r--scripts/lib/devtool/import.py8
-rw-r--r--scripts/lib/devtool/standard.py16
-rw-r--r--scripts/lib/devtool/upgrade.py6
4 files changed, 16 insertions, 16 deletions
diff --git a/scripts/lib/devtool/export.py b/scripts/lib/devtool/export.py
index 13ee258e7a..35349e2cda 100644
--- a/scripts/lib/devtool/export.py
+++ b/scripts/lib/devtool/export.py
@@ -84,7 +84,7 @@ def export(args, config, basepath, workspace):
84 84
85 # if all workspace is excluded, quit 85 # if all workspace is excluded, quit
86 if not len(set(workspace.keys()).difference(set(args.exclude))): 86 if not len(set(workspace.keys()).difference(set(args.exclude))):
87 logger.warn('All recipes in workspace excluded, nothing to export') 87 logger.warning('All recipes in workspace excluded, nothing to export')
88 return 0 88 return 0
89 89
90 exported = [] 90 exported = []
diff --git a/scripts/lib/devtool/import.py b/scripts/lib/devtool/import.py
index c13a180d14..4264b7d820 100644
--- a/scripts/lib/devtool/import.py
+++ b/scripts/lib/devtool/import.py
@@ -81,7 +81,7 @@ def devimport(args, config, basepath, workspace):
81 break 81 break
82 else: 82 else:
83 non_importables.append(fn) 83 non_importables.append(fn)
84 logger.warn('No recipe to append %s.bbapppend, skipping' % fn) 84 logger.warning('No recipe to append %s.bbapppend, skipping' % fn)
85 85
86 # Extract 86 # Extract
87 imported = [] 87 imported = []
@@ -104,9 +104,9 @@ def devimport(args, config, basepath, workspace):
104 try: 104 try:
105 tar.extract(member, path=config.workspace_path) 105 tar.extract(member, path=config.workspace_path)
106 except PermissionError as pe: 106 except PermissionError as pe:
107 logger.warn(pe) 107 logger.warning(pe)
108 else: 108 else:
109 logger.warn('File already present. Use --overwrite/-o to overwrite it: %s' % member.name) 109 logger.warning('File already present. Use --overwrite/-o to overwrite it: %s' % member.name)
110 continue 110 continue
111 else: 111 else:
112 tar.extract(member, path=config.workspace_path) 112 tar.extract(member, path=config.workspace_path)
@@ -129,7 +129,7 @@ def devimport(args, config, basepath, workspace):
129 if imported: 129 if imported:
130 logger.info('Imported recipes into workspace %s: %s' % (config.workspace_path, ', '.join(imported))) 130 logger.info('Imported recipes into workspace %s: %s' % (config.workspace_path, ', '.join(imported)))
131 else: 131 else:
132 logger.warn('No recipes imported into the workspace') 132 logger.warning('No recipes imported into the workspace')
133 133
134 return 0 134 return 0
135 135
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index a1e8e1d322..d14b7a6543 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -66,7 +66,7 @@ def add(args, config, basepath, workspace):
66 args.srctree = args.recipename 66 args.srctree = args.recipename
67 args.recipename = None 67 args.recipename = None
68 elif os.path.isdir(args.recipename): 68 elif os.path.isdir(args.recipename):
69 logger.warn('Ambiguous argument "%s" - assuming you mean it to be the recipe name' % args.recipename) 69 logger.warning('Ambiguous argument "%s" - assuming you mean it to be the recipe name' % args.recipename)
70 70
71 if not args.fetchuri: 71 if not args.fetchuri:
72 if args.srcrev: 72 if args.srcrev:
@@ -82,7 +82,7 @@ def add(args, config, basepath, workspace):
82 if args.fetchuri: 82 if args.fetchuri:
83 raise DevtoolError('URI specified as positional argument as well as -f/--fetch') 83 raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
84 else: 84 else:
85 logger.warn('-f/--fetch option is deprecated - you can now simply specify the URL to fetch as a positional argument instead') 85 logger.warning('-f/--fetch option is deprecated - you can now simply specify the URL to fetch as a positional argument instead')
86 args.fetchuri = args.fetch 86 args.fetchuri = args.fetch
87 87
88 if args.recipename: 88 if args.recipename:
@@ -217,7 +217,7 @@ def add(args, config, basepath, workspace):
217 raise DevtoolError('Command \'%s\' did not create any recipe file:\n%s' % (e.command, e.stdout)) 217 raise DevtoolError('Command \'%s\' did not create any recipe file:\n%s' % (e.command, e.stdout))
218 attic_recipe = os.path.join(config.workspace_path, 'attic', recipename, os.path.basename(recipefile)) 218 attic_recipe = os.path.join(config.workspace_path, 'attic', recipename, os.path.basename(recipefile))
219 if os.path.exists(attic_recipe): 219 if os.path.exists(attic_recipe):
220 logger.warn('A modified recipe from a previous invocation exists in %s - you may wish to move this over the top of the new recipe if you had changes in it that you want to continue with' % attic_recipe) 220 logger.warning('A modified recipe from a previous invocation exists in %s - you may wish to move this over the top of the new recipe if you had changes in it that you want to continue with' % attic_recipe)
221 finally: 221 finally:
222 if tmpsrcdir and os.path.exists(tmpsrcdir): 222 if tmpsrcdir and os.path.exists(tmpsrcdir):
223 shutil.rmtree(tmpsrcdir) 223 shutil.rmtree(tmpsrcdir)
@@ -295,7 +295,7 @@ def add(args, config, basepath, workspace):
295 with open(layerconf_file, 'a') as f: 295 with open(layerconf_file, 'a') as f:
296 f.write('%s = "%s"\n' % (preferred_provider, recipe_name)) 296 f.write('%s = "%s"\n' % (preferred_provider, recipe_name))
297 else: 297 else:
298 logger.warn('Set \'%s\' in order to use the recipe' % preferred_provider) 298 logger.warning('Set \'%s\' in order to use the recipe' % preferred_provider)
299 break 299 break
300 300
301 _add_md5(config, recipename, appendfile) 301 _add_md5(config, recipename, appendfile)
@@ -704,7 +704,7 @@ def _check_preserve(config, recipename):
704 if splitline[2] != md5: 704 if splitline[2] != md5:
705 bb.utils.mkdirhier(preservepath) 705 bb.utils.mkdirhier(preservepath)
706 preservefile = os.path.basename(removefile) 706 preservefile = os.path.basename(removefile)
707 logger.warn('File %s modified since it was written, preserving in %s' % (preservefile, preservepath)) 707 logger.warning('File %s modified since it was written, preserving in %s' % (preservefile, preservepath))
708 shutil.move(removefile, os.path.join(preservepath, preservefile)) 708 shutil.move(removefile, os.path.join(preservepath, preservefile))
709 else: 709 else:
710 os.remove(removefile) 710 os.remove(removefile)
@@ -795,7 +795,7 @@ def modify(args, config, basepath, workspace):
795 if branchname.startswith(override_branch_prefix): 795 if branchname.startswith(override_branch_prefix):
796 branches.append(branchname) 796 branches.append(branchname)
797 if branches: 797 if branches:
798 logger.warn('SRC_URI is conditionally overridden in this recipe, thus several %s* branches have been created, one for each override that makes changes to SRC_URI. It is recommended that you make changes to the %s branch first, then checkout and rebase each %s* branch and update any unique patches there (duplicates on those branches will be ignored by devtool finish/update-recipe)' % (override_branch_prefix, args.branch, override_branch_prefix)) 798 logger.warning('SRC_URI is conditionally overridden in this recipe, thus several %s* branches have been created, one for each override that makes changes to SRC_URI. It is recommended that you make changes to the %s branch first, then checkout and rebase each %s* branch and update any unique patches there (duplicates on those branches will be ignored by devtool finish/update-recipe)' % (override_branch_prefix, args.branch, override_branch_prefix))
799 branches.insert(0, args.branch) 799 branches.insert(0, args.branch)
800 seen_patches = [] 800 seen_patches = []
801 for branch in branches: 801 for branch in branches:
@@ -1720,7 +1720,7 @@ def update_recipe(args, config, basepath, workspace):
1720 if updated: 1720 if updated:
1721 rf = rd.getVar('FILE') 1721 rf = rd.getVar('FILE')
1722 if rf.startswith(config.workspace_path): 1722 if rf.startswith(config.workspace_path):
1723 logger.warn('Recipe file %s has been updated but is inside the workspace - you will need to move it (and any associated files next to it) out to the desired layer before using "devtool reset" in order to keep any changes' % rf) 1723 logger.warning('Recipe file %s has been updated but is inside the workspace - you will need to move it (and any associated files next to it) out to the desired layer before using "devtool reset" in order to keep any changes' % rf)
1724 finally: 1724 finally:
1725 tinfoil.shutdown() 1725 tinfoil.shutdown()
1726 1726
@@ -1803,7 +1803,7 @@ def _reset(recipes, no_clean, config, basepath, workspace):
1803 if os.path.exists(origdir): 1803 if os.path.exists(origdir):
1804 for root, dirs, files in os.walk(origdir): 1804 for root, dirs, files in os.walk(origdir):
1805 for fn in files: 1805 for fn in files:
1806 logger.warn('Preserving %s in %s' % (fn, preservepath)) 1806 logger.warning('Preserving %s in %s' % (fn, preservepath))
1807 _move_file(os.path.join(origdir, fn), 1807 _move_file(os.path.join(origdir, fn),
1808 os.path.join(preservepath, fn)) 1808 os.path.join(preservepath, fn))
1809 for dn in dirs: 1809 for dn in dirs:
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 1dde16641b..202007793b 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -264,7 +264,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
264 if no_patch: 264 if no_patch:
265 patches = oe.recipeutils.get_recipe_patches(crd) 265 patches = oe.recipeutils.get_recipe_patches(crd)
266 if patches: 266 if patches:
267 logger.warn('By user choice, the following patches will NOT be applied to the new source tree:\n %s' % '\n '.join([os.path.basename(patch) for patch in patches])) 267 logger.warning('By user choice, the following patches will NOT be applied to the new source tree:\n %s' % '\n '.join([os.path.basename(patch) for patch in patches]))
268 else: 268 else:
269 __run('git checkout devtool-patched -b %s' % branch) 269 __run('git checkout devtool-patched -b %s' % branch)
270 skiptag = False 270 skiptag = False
@@ -273,9 +273,9 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
273 except bb.process.ExecutionError as e: 273 except bb.process.ExecutionError as e:
274 skiptag = True 274 skiptag = True
275 if 'conflict' in e.stdout: 275 if 'conflict' in e.stdout:
276 logger.warn('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip())) 276 logger.warning('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip()))
277 else: 277 else:
278 logger.warn('Command \'%s\' failed:\n%s' % (e.command, e.stdout)) 278 logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
279 if not skiptag: 279 if not skiptag:
280 if uri.startswith('git://'): 280 if uri.startswith('git://'):
281 suffix = 'new' 281 suffix = 'new'