1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-27 12:42:12 +01:00

import "osc aggregate --nosources" feature, implemented by brook.hong@nokia.com

This commit is contained in:
Adrian Schröter 2010-07-20 14:48:27 +02:00
parent fd6b59cf38
commit ad28c0552e
3 changed files with 15 additions and 3 deletions

4
NEWS
View File

@ -1,4 +1,8 @@
0.129 0.129
#
# Feature which requires OBS 2.1
#
- add "osc aggregate --nosources" option
0.128 0.128
- better default commands selection for editor/pager - better default commands selection for editor/pager

View File

@ -1881,6 +1881,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
link_pac(src_project, src_package, dst_project, dst_package, opts.force, rev, opts.cicount, opts.disable_publish) link_pac(src_project, src_package, dst_project, dst_package, opts.force, rev, opts.cicount, opts.disable_publish)
@cmdln.option('--nosources', action='store_true',
help='ignore source packages when copying build results to destination project')
@cmdln.option('-m', '--map-repo', metavar='SRC=TARGET[,SRC=TARGET]', @cmdln.option('-m', '--map-repo', metavar='SRC=TARGET[,SRC=TARGET]',
help='Allows repository mapping(s) to be given as SRC=TARGET[,SRC=TARGET]') help='Allows repository mapping(s) to be given as SRC=TARGET[,SRC=TARGET]')
@cmdln.option('-d', '--disable-publish', action='store_true', @cmdln.option('-d', '--disable-publish', action='store_true',
@ -1929,7 +1931,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
raise oscerr.WrongOptions('map "%s" must be SRC=TARGET[,SRC=TARGET]' % opts.map_repo) raise oscerr.WrongOptions('map "%s" must be SRC=TARGET[,SRC=TARGET]' % opts.map_repo)
repo_map[src_tgt[0]] = src_tgt[1] repo_map[src_tgt[0]] = src_tgt[1]
aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map, opts.disable_publish) aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map, opts.disable_publish, opts.nosources)
@cmdln.option('-c', '--client-side-copy', action='store_true', @cmdln.option('-c', '--client-side-copy', action='store_true',

View File

@ -3414,7 +3414,7 @@ def link_pac(src_project, src_package, dst_project, dst_package, force, rev='',
http_PUT(u, data=link_template) http_PUT(u, data=link_template)
print 'Done.' print 'Done.'
def aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map = {}, disable_publish = False): def aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map = {}, disable_publish = False, nosources = False):
""" """
aggregate package aggregate package
- "src" is the original package - "src" is the original package
@ -3466,9 +3466,15 @@ def aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map =
aggregate_template += """\ aggregate_template += """\
<package>%s</package> <package>%s</package>
""" % ( src_package)
if nosources:
aggregate_template += """\
<nosources />
"""
aggregate_template += """\
</aggregate> </aggregate>
</aggregatelist> </aggregatelist>
""" % ( src_package) """
u = makeurl(conf.config['apiurl'], ['source', dst_project, dst_package, '_aggregate']) u = makeurl(conf.config['apiurl'], ['source', dst_project, dst_package, '_aggregate'])
http_PUT(u, data=aggregate_template) http_PUT(u, data=aggregate_template)