diff --git a/behave/features/addchannels-pkgcheckout.feature b/behave/features/addchannels-pkgcheckout.feature index 54013d22..4e4c908a 100644 --- a/behave/features/addchannels-pkgcheckout.feature +++ b/behave/features/addchannels-pkgcheckout.feature @@ -12,7 +12,7 @@ Scenario: Run `osc addchannels` When I execute osc with args "addchannels" Then stdout is """ - Adding channels to project: 'test:factory' package: 'test-pkgA' + Adding channels to package 'test:factory/test-pkgA' """ @@ -20,7 +20,7 @@ Scenario: Run `osc addchannels --enable-all` When I execute osc with args "addchannels --enable-all" Then stdout is """ - Adding channels to project: 'test:factory' package: 'test-pkgA' options: enable-all + Adding channels to package 'test:factory/test-pkgA' options: enable-all """ @@ -28,5 +28,5 @@ Scenario: Run `osc addchannels --skip-disabled` When I execute osc with args "addchannels --skip-disabled" Then stdout is """ - Adding channels to project: 'test:factory' package: 'test-pkgA' options: skip-disabled + Adding channels to package 'test:factory/test-pkgA' options: skip-disabled """ diff --git a/behave/features/addchannels-prjcheckout.feature b/behave/features/addchannels-prjcheckout.feature index a968e7fb..44ecf1fd 100644 --- a/behave/features/addchannels-prjcheckout.feature +++ b/behave/features/addchannels-prjcheckout.feature @@ -12,7 +12,7 @@ Scenario: Run `osc addchannels` When I execute osc with args "addchannels" Then stdout is """ - Adding channels to project: 'test:factory' + Adding channels to project 'test:factory' """ @@ -20,7 +20,7 @@ Scenario: Run `osc addchannels --enable-all` When I execute osc with args "addchannels --enable-all" Then stdout is """ - Adding channels to project: 'test:factory' options: enable-all + Adding channels to project 'test:factory' options: enable-all """ @@ -28,5 +28,5 @@ Scenario: Run `osc addchannels --skip-disabled` When I execute osc with args "addchannels --skip-disabled" Then stdout is """ - Adding channels to project: 'test:factory' options: skip-disabled + Adding channels to project 'test:factory' options: skip-disabled """ diff --git a/behave/features/addchannels-project-package.feature b/behave/features/addchannels-project-package.feature index 34c13786..ccb74008 100644 --- a/behave/features/addchannels-project-package.feature +++ b/behave/features/addchannels-project-package.feature @@ -10,7 +10,7 @@ Scenario: Run `osc addchannels ` When I execute osc with args "addchannels test:factory test-pkgA" Then stdout is """ - Adding channels to project: 'test:factory' package: 'test-pkgA' + Adding channels to package 'test:factory/test-pkgA' """ @@ -18,7 +18,7 @@ Scenario: Run `osc addchannels /` When I execute osc with args "addchannels test:factory/test-pkgA" Then stdout is """ - Adding channels to project: 'test:factory' package: 'test-pkgA' + Adding channels to package 'test:factory/test-pkgA' """ @@ -26,7 +26,7 @@ Scenario: Run `osc addchannels --enable-all` When I execute osc with args "addchannels test:factory test-pkgA --enable-all" Then stdout is """ - Adding channels to project: 'test:factory' package: 'test-pkgA' options: enable-all + Adding channels to package 'test:factory/test-pkgA' options: enable-all """ @@ -34,5 +34,5 @@ Scenario: Run `osc addchannels --skip-disabled` When I execute osc with args "addchannels test:factory test-pkgA --skip-disabled" Then stdout is """ - Adding channels to project: 'test:factory' package: 'test-pkgA' options: skip-disabled + Adding channels to package 'test:factory/test-pkgA' options: skip-disabled """ diff --git a/behave/features/addchannels-project.feature b/behave/features/addchannels-project.feature index 2c1a6cf7..2e9bc83b 100644 --- a/behave/features/addchannels-project.feature +++ b/behave/features/addchannels-project.feature @@ -10,7 +10,7 @@ Scenario: Run `osc addchannels ` When I execute osc with args "addchannels test:factory" Then stdout is """ - Adding channels to project: 'test:factory' + Adding channels to project 'test:factory' """ @@ -18,7 +18,7 @@ Scenario: Run `osc addchannels --enable-all` When I execute osc with args "addchannels test:factory --enable-all" Then stdout is """ - Adding channels to project: 'test:factory' options: enable-all + Adding channels to project 'test:factory' options: enable-all """ @@ -26,6 +26,6 @@ Scenario: Run `osc addchannels --skip-disabled` When I execute osc with args "addchannels test:factory --skip-disabled" Then stdout is """ - Adding channels to project: 'test:factory' options: skip-disabled + Adding channels to project 'test:factory' options: skip-disabled """ diff --git a/behave/features/enablechannels-pkgcheckout.feature b/behave/features/enablechannels-pkgcheckout.feature index 53bbc0f9..d11916b5 100644 --- a/behave/features/enablechannels-pkgcheckout.feature +++ b/behave/features/enablechannels-pkgcheckout.feature @@ -12,5 +12,5 @@ Scenario: Run `osc enablechannels` When I execute osc with args "enablechannels" Then stdout is """ - Enabling channels in project: 'test:factory' package: 'test-pkgA' + Enabling channels in package 'test:factory/test-pkgA' """ diff --git a/behave/features/enablechannels-prjcheckout.feature b/behave/features/enablechannels-prjcheckout.feature index df80b6e9..457b42a6 100644 --- a/behave/features/enablechannels-prjcheckout.feature +++ b/behave/features/enablechannels-prjcheckout.feature @@ -12,5 +12,5 @@ Scenario: Run `osc enablechannels` When I execute osc with args "enablechannels" Then stdout is """ - Enabling channels in project: 'test:factory' + Enabling channels in project 'test:factory' """ diff --git a/behave/features/enablechannels-project-package.feature b/behave/features/enablechannels-project-package.feature index ac089cf8..142b9555 100644 --- a/behave/features/enablechannels-project-package.feature +++ b/behave/features/enablechannels-project-package.feature @@ -10,7 +10,7 @@ Scenario: Run `osc enablechannels ` When I execute osc with args "enablechannels test:factory test-pkgA" Then stdout is """ - Enabling channels in project: 'test:factory' package: 'test-pkgA' + Enabling channels in package 'test:factory/test-pkgA' """ @@ -18,5 +18,5 @@ Scenario: Run `osc enablechannels /` When I execute osc with args "enablechannels test:factory/test-pkgA" Then stdout is """ - Enabling channels in project: 'test:factory' package: 'test-pkgA' + Enabling channels in package 'test:factory/test-pkgA' """ diff --git a/behave/features/enablechannels-project.feature b/behave/features/enablechannels-project.feature index 33c85e28..2df78504 100644 --- a/behave/features/enablechannels-project.feature +++ b/behave/features/enablechannels-project.feature @@ -10,5 +10,5 @@ Scenario: Run `osc enablechannels ` When I execute osc with args "enablechannels test:factory" Then stdout is """ - Enabling channels in project: 'test:factory' + Enabling channels in project 'test:factory' """ diff --git a/osc/_private/common.py b/osc/_private/common.py index 30cbe5c4..80e83d66 100644 --- a/osc/_private/common.py +++ b/osc/_private/common.py @@ -15,16 +15,20 @@ def print_msg(msg, print_to="debug"): raise ValueError(f"Invalid value of the 'output' option: {output}") -def format_msg_project_package_options(msg, project=None, package=None, **options): +def format_msg_project_package_options(msg, project=None, package=None, dest_project=None, dest_package=None, **options): """ - Format msg, project, package and options into a meaningful message + Format msg, project, package, dest_project, dest_package and options into a meaningful message that can be printed out directly or as a debug message. """ - if project: - msg += f" project: '{project}'" + if project and not package: + msg += f" project '{project}'" + else: + msg += f" package '{project}/{package}'" - if package: - msg += f" package: '{package}'" + if dest_project and not dest_package: + msg += f" to project '{dest_project}'" + elif dest_project and dest_package: + msg += f" to package '{dest_project}/{dest_package}'" msg_options = [key.replace("_", "-") for key, value in options.items() if value] if msg_options: