mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 22:56:15 +01:00
linkpac: Fix linking a locked package by not copying the lock to the target package
This commit is contained in:
parent
c5352c4d3e
commit
ba32ff57cb
13
behave/features/linkpac.feature
Normal file
13
behave/features/linkpac.feature
Normal 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
|
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user