1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Marko Lemmetty <marko.lemmetty@jollamobile.com>
Date: Fri, 15 May 2020 14:47:19 +0300
Subject: [PATCH] Add -p to copyprj to enable copying of prjconf
---
osc/commandline.py | 3 +++
osc/core.py | 5 +++++
2 files changed, 8 insertions(+)
diff --git a/osc/commandline.py b/osc/commandline.py
index 907655474ef8497eb4a8291e49e90b856398bd6e..b362398abae94d124629bcb280256ebbef371894 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -1969,6 +1969,8 @@ class Osc(cmdln.Cmdln):
help='replicate the history of each package.')
@cmdln.option('-o', '--make-older', action='store_true',
help='No idea')
+ @cmdln.option('-p', '--prjconf', action='store_true',
+ help='copy the prjconf also')
@cmdln.option('-r', '--re-sign', action='store_true',
help='re-sign the binaries')
@cmdln.option('-m', '--message', metavar='TEXT',
@@ -2011,6 +2013,7 @@ class Osc(cmdln.Cmdln):
r = copy_prj(src_apiurl, src_project, dst_project,
withbinaries = opts.with_binaries,
withhistory = opts.with_history,
+ withprjconf = opts.prjconf,
makeolder = opts.make_older,
resign = opts.re_sign,
now = opts.now,
diff --git a/osc/core.py b/osc/core.py
index 97e2035cb799d08dd7406e01c5ca4fc93d8a3f39..d86439abdddde00c0deab02d1832abb7b06c54af 100644
--- a/osc/core.py
+++ b/osc/core.py
@@ -3821,8 +3821,10 @@ def copy_pac(
def copy_prj(src_apiurl, src_project, dst_project,
withbinaries = False,
withhistory = False,
+ withprjconf = False,
makeolder = False,
resign = False,
+ now = False,
comment = None):
"""
Create a copy of a project.
@@ -3836,6 +3838,8 @@ def copy_prj(src_apiurl, src_project, dst_project,
query['withbinaries'] = '1'
if withhistory:
query['withhistory'] = '1'
+ if withprjconf:
+ query['withprjconf'] = '1'
if makeolder:
query['makeolder'] = '1'
if resign:
@@ -3844,6 +3848,7 @@ def copy_prj(src_apiurl, src_project, dst_project,
query['comment'] = comment
if now:
query['nodelay'] = '1'
+
u = makeurl(src_apiurl, ['source', dst_project], query=query)
print("copyprj ", u, file=sys.stderr)
f = http_POST(u)
|