summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/devtool/__init__.py13
-rw-r--r--scripts/lib/devtool/standard.py4
-rw-r--r--scripts/lib/devtool/upgrade.py9
3 files changed, 23 insertions, 3 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 94e3d7d4b3..20ab83f83d 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -337,3 +337,16 @@ def update_unlockedsigs(basepath, workspace, fixed_setup, extra=None):
337 for pn in newunlocked: 337 for pn in newunlocked:
338 f.write(' ' + pn) 338 f.write(' ' + pn)
339 f.write('"') 339 f.write('"')
340
341def check_prerelease_version(ver, operation):
342 if 'pre' in ver or 'rc' in ver:
343 logger.warning('Version "%s" looks like a pre-release version. '
344 'If that is the case, in order to ensure that the '
345 'version doesn\'t appear to go backwards when you '
346 'later upgrade to the final release version, it is '
347 'recommmended that instead you use '
348 '<current version>+<pre-release version> e.g. if '
349 'upgrading from 1.9 to 2.0-rc2 use "1.9+2.0-rc2". '
350 'If you prefer not to reset and re-try, you can change '
351 'the version after %s succeeds using "devtool rename" '
352 'with -V/--version.' % (ver, operation))
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 8e4c7f7b13..b6e532bcd3 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -30,7 +30,7 @@ import errno
30import glob 30import glob
31import filecmp 31import filecmp
32from collections import OrderedDict 32from collections import OrderedDict
33from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, recipe_to_append, get_bbclassextend_targets, update_unlockedsigs, DevtoolError 33from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, recipe_to_append, get_bbclassextend_targets, update_unlockedsigs, check_prerelease_version, DevtoolError
34from devtool import parse_recipe 34from devtool import parse_recipe
35 35
36logger = logging.getLogger('devtool') 36logger = logging.getLogger('devtool')
@@ -298,6 +298,8 @@ def add(args, config, basepath, workspace):
298 298
299 _add_md5(config, recipename, appendfile) 299 _add_md5(config, recipename, appendfile)
300 300
301 check_prerelease_version(rd.getVar('PV'), 'devtool add')
302
301 logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile) 303 logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)
302 304
303 finally: 305 finally:
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 441dd35bbd..ab7acd16c6 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -33,7 +33,7 @@ sys.path = sys.path + [devtool_path]
33 33
34import oe.recipeutils 34import oe.recipeutils
35from devtool import standard 35from devtool import standard
36from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs 36from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs, check_prerelease_version
37 37
38logger = logging.getLogger('devtool') 38logger = logging.getLogger('devtool')
39 39
@@ -420,8 +420,13 @@ def upgrade(args, config, basepath, workspace):
420 old_srcrev = None 420 old_srcrev = None
421 if old_srcrev and not args.srcrev: 421 if old_srcrev and not args.srcrev:
422 raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading") 422 raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading")
423 if rd.getVar('PV') == args.version and old_srcrev == args.srcrev: 423 old_ver = rd.getVar('PV')
424 if old_ver == args.version and old_srcrev == args.srcrev:
424 raise DevtoolError("Current and upgrade versions are the same version") 425 raise DevtoolError("Current and upgrade versions are the same version")
426 if args.version:
427 if bb.utils.vercmp_string(args.version, old_ver) < 0:
428 logger.warning('Upgrade version %s compares as less than the current version %s. If you are using a package feed for on-target upgrades or providing this recipe for general consumption, then you should increment PE in the recipe (or if there is no current PE value set, set it to "1")' % (args.version, old_ver))
429 check_prerelease_version(args.version, 'devtool upgrade')
425 430
426 rf = None 431 rf = None
427 try: 432 try: