1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-21 09:46:19 +02:00

linkpac: Fix linking a locked package by not copying the lock to the target package

This commit is contained in:
Daniel Mach 2022-12-20 14:42:19 +01:00
parent c5352c4d3e
commit ba32ff57cb
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,13 @@
Feature: `osc linkpac` command
# common steps for all scenarios
Background:
Given I set working directory to "{context.osc.temp}"
@destructive
Scenario: Run `osc linkpac on a locked package`
Given I execute osc with args "lock test:factory/test-pkgA"
When I execute osc with args "linkpac test:factory/test-pkgA home:Admin/test-pkgA"
Then the exit code is 0

View File

@ -5451,7 +5451,8 @@ def checkout_package(
def replace_pkg_meta(
pkgmeta, new_name: str, new_prj: str, keep_maintainers=False, dst_userid=None, keep_develproject=False
pkgmeta, new_name: str, new_prj: str, keep_maintainers=False, dst_userid=None, keep_develproject=False,
keep_lock: bool = False,
):
"""
update pkgmeta with new new_name and new_prj and set calling user as the
@ -5472,6 +5473,9 @@ def replace_pkg_meta(
if not keep_develproject:
for dp in root.findall('devel'):
root.remove(dp)
if not keep_lock:
for node in root.findall("lock"):
root.remove(node)
return ET.tostring(root, encoding=ET_ENCODING)