mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
devtool: show some warnings for upgrade versions
* Show a warning in devtool upgrade if the version is less than the current version suggesting that the user may need to bump PE in the recipe * Show a warning in devtool add and devtool upgrade if the version looks like a pre-release version suggesting using a version number that won't mess up the progression when you come to upgrade to the final release version. (From OE-Core rev: 92c4d9be9ed365c449ea1ac5a18ddb15e4a36b2d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.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:
parent
1d31cee42d
commit
624a07a766
|
@ -337,3 +337,16 @@ def update_unlockedsigs(basepath, workspace, fixed_setup, extra=None):
|
|||
for pn in newunlocked:
|
||||
f.write(' ' + pn)
|
||||
f.write('"')
|
||||
|
||||
def check_prerelease_version(ver, operation):
|
||||
if 'pre' in ver or 'rc' in ver:
|
||||
logger.warning('Version "%s" looks like a pre-release version. '
|
||||
'If that is the case, in order to ensure that the '
|
||||
'version doesn\'t appear to go backwards when you '
|
||||
'later upgrade to the final release version, it is '
|
||||
'recommmended that instead you use '
|
||||
'<current version>+<pre-release version> e.g. if '
|
||||
'upgrading from 1.9 to 2.0-rc2 use "1.9+2.0-rc2". '
|
||||
'If you prefer not to reset and re-try, you can change '
|
||||
'the version after %s succeeds using "devtool rename" '
|
||||
'with -V/--version.' % (ver, operation))
|
||||
|
|
|
@ -30,7 +30,7 @@ import errno
|
|||
import glob
|
||||
import filecmp
|
||||
from collections import OrderedDict
|
||||
from 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
|
||||
from 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
|
||||
from devtool import parse_recipe
|
||||
|
||||
logger = logging.getLogger('devtool')
|
||||
|
@ -298,6 +298,8 @@ def add(args, config, basepath, workspace):
|
|||
|
||||
_add_md5(config, recipename, appendfile)
|
||||
|
||||
check_prerelease_version(rd.getVar('PV'), 'devtool add')
|
||||
|
||||
logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)
|
||||
|
||||
finally:
|
||||
|
|
|
@ -33,7 +33,7 @@ sys.path = sys.path + [devtool_path]
|
|||
|
||||
import oe.recipeutils
|
||||
from devtool import standard
|
||||
from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs
|
||||
from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs, check_prerelease_version
|
||||
|
||||
logger = logging.getLogger('devtool')
|
||||
|
||||
|
@ -420,8 +420,13 @@ def upgrade(args, config, basepath, workspace):
|
|||
old_srcrev = None
|
||||
if old_srcrev and not args.srcrev:
|
||||
raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading")
|
||||
if rd.getVar('PV') == args.version and old_srcrev == args.srcrev:
|
||||
old_ver = rd.getVar('PV')
|
||||
if old_ver == args.version and old_srcrev == args.srcrev:
|
||||
raise DevtoolError("Current and upgrade versions are the same version")
|
||||
if args.version:
|
||||
if bb.utils.vercmp_string(args.version, old_ver) < 0:
|
||||
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))
|
||||
check_prerelease_version(args.version, 'devtool upgrade')
|
||||
|
||||
rf = None
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue
Block a user