1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-11 16:36:14 +01:00

Fix 'linkpac' command crash when used with '--disable-build' or '--disable-publish' option

This commit is contained in:
Daniel Mach 2024-07-01 09:31:14 +02:00
parent 8f634225c9
commit 7cd9635537
2 changed files with 29 additions and 1 deletions

View File

@ -6,6 +6,34 @@ Background:
Given I set working directory to "{context.osc.temp}"
@destructive
Scenario: Run `osc linkpac`
When I execute osc with args "linkpac test:factory/test-pkgA home:Admin"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin/test-pkgA/_link"
And stdout contains "<link project=\"test:factory\" package=\"test-pkgA\">"
@destructive
Scenario: Run `osc linkpac --disable-build`
When I execute osc with args "linkpac test:factory/test-pkgA home:Admin --disable-build"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin/test-pkgA/_link"
And stdout contains "<link project=\"test:factory\" package=\"test-pkgA\">"
And I execute osc with args "api /source/home:Admin/test-pkgA/_meta"
And stdout contains "<build>\s*<disable/>\s*</build>"
@destructive
Scenario: Run `osc linkpac --disable-publish`
When I execute osc with args "linkpac test:factory/test-pkgA home:Admin --disable-publish"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin/test-pkgA/_link"
And stdout contains "<link project=\"test:factory\" package=\"test-pkgA\">"
And I execute osc with args "api /source/home:Admin/test-pkgA/_meta"
And stdout contains "<publish>\s*<disable/>\s*</publish>"
@destructive
Scenario: Run `osc linkpac on a locked package`
Given I execute osc with args "lock test:factory/test-pkgA"

View File

@ -3294,7 +3294,7 @@ def link_pac(
if disable_build or disable_publish:
meta_change = True
root = ET.fromstring(b"".join(dst_meta))
root = ET.fromstring("".join(dst_meta))
if disable_build:
elm = root.find('build')