diff --git a/NEWS b/NEWS
index 7ae2cb0a..bfef3392 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@
- plugins now should be placed in /usr/lib/osc-plugins to match FHS (the /var path is still supported though)
- osc now includes automatically generated man page
- osc can now store credentials in Gnome keyring if it is available
+- osc linkpac can not specify cicount attribute
0.117:
- support checkout of single package via "osc co PACKAGE" when local dir is project
diff --git a/osc/commandline.py b/osc/commandline.py
index 7154ce96..8248c9f5 100755
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -773,6 +773,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('-c', '--current', action='store_true',
help='link fixed against current revision.')
+ @cmdln.option('-C', '--cicount', choices=['add', 'copy', 'local'],
+ help='cicount attribute in the link, known values are add, copy, and local, default in buildservice is currently add.')
@cmdln.option('-r', '--revision', metavar='rev',
help='link the specified revision.')
def do_linkpac(self, subcmd, opts, *args):
@@ -823,7 +825,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print >>sys.stderr, 'Revision \'%s\' does not exist' % rev
sys.exit(1)
- link_pac(src_project, src_package, dst_project, dst_package, rev)
+ link_pac(src_project, src_package, dst_project, dst_package, rev, opts.cicount)
def do_aggregatepac(self, subcmd, opts, *args):
"""${cmd_name}: "Aggregate" a package to another package
diff --git a/osc/core.py b/osc/core.py
index b9d59131..0dd26657 100755
--- a/osc/core.py
+++ b/osc/core.py
@@ -2486,7 +2486,7 @@ def replace_pkg_meta(pkgmeta, new_name, new_prj, keep_maintainers = False,
root.remove(dp)
return ET.tostring(root)
-def link_pac(src_project, src_package, dst_project, dst_package, rev=''):
+def link_pac(src_project, src_package, dst_project, dst_package, rev='', cicount=''):
"""
create a linked package
- "src" is the original package
@@ -2512,9 +2512,14 @@ def link_pac(src_project, src_package, dst_project, dst_package, rev=''):
else:
rev = ''
+ if cicount:
+ cicount = 'cicount="%s"' % cicount
+ else:
+ cicount = ''
+
print 'Creating _link...',
link_template = """\
-
+
@@ -2522,7 +2527,7 @@ def link_pac(src_project, src_package, dst_project, dst_package, rev=''):
-""" % (src_project, src_package, rev)
+""" % (src_project, src_package, rev, cicount)
u = makeurl(conf.config['apiurl'], ['source', dst_project, dst_package, '_link'])
http_PUT(u, data=link_template)