diff mbox series

[auh,V2,12/12] upgrade-helper.py: respect recipe parameter from command line in case of layer mode

Message ID 20260311064813.619683-12-Qi.Chen@windriver.com
State New
Headers show
Series [auh,V2,01/12] upgrade-helper.py: remove unused self.poky_git settings | expand

Commit Message

ChenQi March 11, 2026, 6:48 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

The recipe parameter in command line is not respected. For example,
upgrade-helper.py --config-file upgrade-helper/upgrade-helper.meta-python.conf python3-sqlparse
This command still tries to upgrade all recipes from meta-python instead
of just python3-sqlparse.

This is a regression introduced by the following commit:
ff1c2aa0d2 upgrade-helper.py: Add layer command line option

Fix this regression by adding a filtering mechanism.

Note that 'all' is handled specially and it means upgrading all recipes
in the specific layer.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 upgrade-helper.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Alexander Kanavin March 11, 2026, 7:17 p.m. UTC | #1
On Wed, 11 Mar 2026 at 07:48, <Qi.Chen@windriver.com> wrote:
\> The recipe parameter in command line is not respected. For example,
> upgrade-helper.py --config-file upgrade-helper/upgrade-helper.meta-python.conf python3-sqlparse
> This command still tries to upgrade all recipes from meta-python instead
> of just python3-sqlparse.
>
> This is a regression introduced by the following commit:
> ff1c2aa0d2 upgrade-helper.py: Add layer command line option
>
> Fix this regression by adding a filtering mechanism.

Thanks, the patchset otherwise looks okay, so if you can do the tweak
for patches 4/6 and resend, I'll take it.

Alex
diff mbox series

Patch

diff --git a/upgrade-helper.py b/upgrade-helper.py
index 7edb6da..40f31c4 100755
--- a/upgrade-helper.py
+++ b/upgrade-helper.py
@@ -595,12 +595,15 @@  class UniverseUpdater(Updater):
         if len(args.recipe) == 1 and args.recipe[0] == "all" and self.opts['layer_mode'] != 'yes':
             self.recipes = [('', [])]
         elif self.opts['layer_mode'] == 'yes':
-            # when layer mode is enabled and no recipes are specified
+            # layer mode is enabled
             # we need to figure out what recipes are provided by the
-            # layer to try upgrade
+            # layer and filter it recipes provided
             self.recipes = []
             for layer in self.opts['layer_name'].split(' '):
-                recipes_for_layer = self._get_recipes_by_layer(layer)
+                if args.recipe[0] != "all":
+                    recipes_for_layer = args.recipe
+                else:
+                    recipes_for_layer = self._get_recipes_by_layer(layer)
                 I("layer %s => Recipes %s", layer, recipes_for_layer)
                 self.recipes.append((layer, recipes_for_layer))
         else: