[oe-commits] [openembedded-core] 31/41: devtool: add a 'latest-version' command

git at git.openembedded.org git at git.openembedded.org
Mon Dec 18 18:05:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

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

commit e8f5b5cc25ce7a9882f21473cefc47edcebf77d4
Author: Alexander Kanavin <alexander.kanavin at linux.intel.com>
AuthorDate: Thu Nov 23 17:11:40 2017 +0200

    devtool: add a 'latest-version' command
    
    This command queries the upstream server for what the latest release is and prints
    the output; it is a much neater way to find out these things than fumbling with distrodata,
    'bitbake -c checkpkg' and awkward to read csv output in a file.
    
    Examples:
    
    python3 (tarballs):
    NOTE: Current version: 3.5.3
    NOTE: Latest version: 3.6.3
    
    rpm (git):
    NOTE: Current version: 4.13.90
    NOTE: Latest version: 4.14.0
    NOTE: Latest version's commit: da3720f62e57648fb1dc2a632744d38866139971
    
    puzzles (git without version tags):
    NOTE: Latest commit: ee8ea9b9785964694cb2b3ad77c3fb2460f49510
    
    Signed-off-by: Alexander Kanavin <alexander.kanavin at linux.intel.com>
---
 scripts/lib/devtool/upgrade.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index f6141bf..445e064 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -498,6 +498,26 @@ def upgrade(args, config, basepath, workspace):
         tinfoil.shutdown()
     return 0
 
+def latest_version(args, config, basepath, workspace):
+    """Entry point for the devtool 'latest_version' subcommand"""
+    tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+    try:
+        rd = parse_recipe(config, tinfoil, args.recipename, True)
+        if not rd:
+            return 1
+        version_info = oe.recipeutils.get_recipe_upstream_version(rd)
+        # "new-commits-available" is an indication that upstream never issues version tags
+        if not version_info['version'].endswith("new-commits-available"):
+            logger.info("Current version: {}".format(version_info['current_version']))
+            logger.info("Latest version: {}".format(version_info['version']))
+            if version_info['revision']:
+                logger.info("Latest version's commit: {}".format(version_info['revision']))
+        else:
+            logger.info("Latest commit: {}".format(version_info['revision']))
+    finally:
+        tinfoil.shutdown()
+    return 0
+
 def register_commands(subparsers, context):
     """Register devtool subcommands from this plugin"""
 
@@ -519,3 +539,9 @@ def register_commands(subparsers, context):
     group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
     parser_upgrade.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
     parser_upgrade.set_defaults(func=upgrade, fixed_setup=context.fixed_setup)
+
+    parser_latest_version = subparsers.add_parser('latest-version', help='Report the latest version of an existing recipe',
+                                                  description='Queries the upstream server for what the latest upstream release is (for git, tags are checked, for tarballs, a list of them is obtained, and one with the highest version number is reported)',
+                                                  group='info')
+    parser_latest_version.add_argument('recipename', help='Name of recipe to query (just name - no version, path or extension)')
+    parser_latest_version.set_defaults(func=latest_version)

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


More information about the Openembedded-commits mailing list