[yocto] [PATCH 07/12] upgradehelper.py: always do upgrade when recipes are specified

Robert Yang liezhi.yang at windriver.com
Wed Dec 6 23:37:12 PST 2017


For example, first run:
$ upgradehelper.py less -d 5
It did the upgrade

Second run:
$ upgradehelper.py less -d 5
DEBUG: Skipping upgrade of less: is in history and not 30 days passed

Let it always do the upgrade makes it easier to use when do upgrade locally.
It will still do the check when the recipe is all.

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 upgradehelper.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/upgradehelper.py b/upgradehelper.py
index 70b9e8d..e38a281 100755
--- a/upgradehelper.py
+++ b/upgradehelper.py
@@ -879,7 +879,7 @@ class UniverseUpdater(Updater):
                 if not os.path.exists(last_checkpkg_file):
                     last_checkpkg_file = None
 
-        if last_master_commit != cur_master_commit or last_date_checked != current_date or \
+        if self.recipes or last_master_commit != cur_master_commit or last_date_checked != current_date or \
                 last_checkpkg_file is None:
             self._check_upstream_versions()
             last_checkpkg_file = os.path.realpath(get_build_dir() + "/tmp/log/checkpkg.csv")
@@ -889,7 +889,10 @@ class UniverseUpdater(Updater):
 
         pkgs_list = []
         for pkg in self._parse_checkpkg_file(last_checkpkg_file):
-            if self._pkg_upgradable(pkg[0], pkg[1], pkg[2]):
+            # Always do the upgrade if recipes are specified
+            if self.recipes and pkg[0] in self.recipes:
+                pkgs_list.append(pkg)
+            elif self._pkg_upgradable(pkg[0], pkg[1], pkg[2]):
                 pkgs_list.append(pkg)
 
         # Update last_checkpkg_run only after the version check has been completed
-- 
2.7.4




More information about the yocto mailing list