[oe-commits] [openembedded-core] 32/103: devtool: upgrade: fix version argument checking

git at git.openembedded.org git at git.openembedded.org
Sun Feb 28 11:35:32 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 1d0f821371d1cb93e30fad86f0c20e38cb93b54b
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Mon Feb 22 12:04:53 2016 +1300

    devtool: upgrade: fix version argument checking
    
    For recipes that specify SRCREV, the code here wasn't quite doing the
    right thing. If the recipe has a SRCREV then that needs changing on
    upgrade, so ensure that the user specifies it. If it doesn't, then it'll
    be "INVALID" not None since the former is the actual default, so handle
    that properly as well. Additionally an unset variable was being
    erroneously passed when raising the error about the version being the
    same leading to a traceback, so fix that as well.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/lib/devtool/upgrade.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 279a65f..77b48f4 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -314,8 +314,13 @@ def upgrade(args, config, basepath, workspace):
         srctree = standard.get_default_srctree(config, pn)
 
     standard._check_compatible_recipe(pn, rd)
-    if rd.getVar('PV', True) == args.version and rd.getVar('SRCREV', True) == args.srcrev:
-        raise DevtoolError("Current and upgrade versions are the same version" % version)
+    old_srcrev = rd.getVar('SRCREV', True)
+    if old_srcrev == 'INVALID':
+        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', True) == args.version and old_srcrev == args.srcrev:
+        raise DevtoolError("Current and upgrade versions are the same version")
 
     rf = None
     try:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list