All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 09/24] devtool: show some warnings for upgrade versions
Date: Thu,  9 Nov 2017 14:55:10 +1300	[thread overview]
Message-ID: <18de4c3e2011d97316586d2bf0c37a972b8bf6e1.1510192329.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1510192329.git.paul.eggleton@linux.intel.com>

* 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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/__init__.py | 13 +++++++++++++
 scripts/lib/devtool/standard.py |  4 +++-
 scripts/lib/devtool/upgrade.py  |  9 +++++++--
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 94e3d7d..20ab83f 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):
             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))
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 8e4c7f7..b6e532b 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -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:
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 441dd35..ab7acd1 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -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:
-- 
2.9.5



  parent reply	other threads:[~2017-11-09  1:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09  1:55 [PATCH 00/24] devtool / recipetool improvements Paul Eggleton
2017-11-09  1:55 ` [PATCH 01/24] recipetool: pass absolute source tree path to plugins Paul Eggleton
2017-11-09  1:55 ` [PATCH 02/24] recipetool: ignore incidental kernel module source Paul Eggleton
2017-11-09  1:55 ` [PATCH 03/24] lib/oe/recipeutils: fix find_layerdir() to return absolute paths Paul Eggleton
2017-11-09  1:55 ` [PATCH 04/24] lib/oe/recipeutils: fix line splitting in patch_recipe_* Paul Eggleton
2017-11-09  1:55 ` [PATCH 05/24] devtool: upgrade: fix accidentally swapped parameters Paul Eggleton
2017-11-09  1:55 ` [PATCH 06/24] devtool: upgrade: fix not committing deleted files with older git versions Paul Eggleton
2017-11-09  1:55 ` [PATCH 07/24] devtool: upgrade: improve performance and show progress when adding files Paul Eggleton
2017-11-09  1:55 ` [PATCH 08/24] devtool: fix handling of oe-local-files when source is in a subdirectory Paul Eggleton
2017-11-09  1:55 ` Paul Eggleton [this message]
2017-11-09  1:55 ` [PATCH 10/24] devtool: make find-recipe and edit-recipe always work with any recipe Paul Eggleton
2017-11-09  1:55 ` [PATCH 11/24] devtool: reset: print source tree base path Paul Eggleton
2017-11-09  1:55 ` [PATCH 12/24] devtool: finish: ensure repository is clean before proceeding Paul Eggleton
2017-11-09  1:55 ` [PATCH 13/24] devtool: finish: fix "layer not in bblayers.conf" warning when path specified Paul Eggleton
2017-11-09  1:55 ` [PATCH 14/24] devtool: upgrade: handle recipes that use named SRC_URI checksums Paul Eggleton
2017-11-09  1:55 ` [PATCH 15/24] recipetool: create: drop debug print Paul Eggleton
2017-11-09  1:55 ` [PATCH 16/24] devtool: stop always moving workspace to end of BBLAYERS Paul Eggleton
2017-11-09  1:55 ` [PATCH 17/24] recipetool: create: show a warning for github archive URLs Paul Eggleton
2017-11-09  1:55 ` [PATCH 18/24] devtool: upgrade: show messages before source extraction steps Paul Eggleton
2017-11-09  1:55 ` [PATCH 19/24] devtool: upgrade: automatically handle changes to source subdirectory Paul Eggleton
2017-11-09  1:55 ` [PATCH 20/24] devtool: upgrade: reformat --no-patch warning message Paul Eggleton
2017-11-09  1:55 ` [PATCH 21/24] devtool: show a better error message if meta-files aren't found Paul Eggleton
2017-11-09  1:55 ` [PATCH 22/24] devtool: finish: improve reporting for removed files Paul Eggleton
2017-11-09  1:55 ` [PATCH 23/24] devtool: finish: add dry-run option Paul Eggleton
2017-11-09  1:55 ` [PATCH 24/24] devtool: implement conditional patch handling Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18de4c3e2011d97316586d2bf0c37a972b8bf6e1.1510192329.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.