1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 07:06:13 +01:00

new osc linkpac -f to allow to override existing _link files, patch by

Michael Meeks
This commit is contained in:
Adrian Schröter 2009-06-15 15:19:16 +00:00
parent b611ddb00b
commit 60ecca1dc1
3 changed files with 11 additions and 5 deletions

1
NEWS
View File

@ -38,6 +38,7 @@
- osc build has a smarter default platform selection - it checks the
availibility config value, 'standard' and 'opensuse_Factory' in platforms list and in case
of fail it uses the last entry from that list
- new osc linkpac -f to allow to override existing _link files
0.117:
- support checkout of single package via "osc co PACKAGE" when local dir is project

View File

@ -874,6 +874,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
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.')
@cmdln.option('-f', '--force', action='store_true',
help='overwrite an existing link file if it is there.')
def do_linkpac(self, subcmd, opts, *args):
"""${cmd_name}: "Link" a package to another package
@ -922,7 +924,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, opts.cicount)
link_pac(src_project, src_package, dst_project, dst_package, opts.force, rev, opts.cicount)
def do_aggregatepac(self, subcmd, opts, *args):
"""${cmd_name}: "Aggregate" a package to another package

View File

@ -2622,7 +2622,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='', cicount=''):
def link_pac(src_project, src_package, dst_project, dst_package, force, rev='', cicount=''):
"""
create a linked package
- "src" is the original package
@ -2639,9 +2639,12 @@ def link_pac(src_project, src_package, dst_project, dst_package, rev='', cicount
# create the _link file
# but first, make sure not to overwrite an existing one
if '_link' in meta_get_filelist(conf.config['apiurl'], dst_project, dst_package):
print >>sys.stderr
print >>sys.stderr, '_link file already exists...! Aborting'
sys.exit(1)
if force:
print >>sys.stderr, 'forced overwrite of existing _link file'
else:
print >>sys.stderr
print >>sys.stderr, '_link file already exists...! Aborting'
sys.exit(1)
if rev:
rev = 'rev="%s"' % rev