1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

osc: add -c flag to checkout PACKAGE dir in cwd instead of PROJECT/PACKAGE

A simple solution to the colons in project names messing up LD_LIBRARY_PATH:
http://lists.opensuse.org/archive/opensuse-buildservice/2008-12/msg00166.html

Example use:

$ osc co -c openSUSE:Factory osc
A    $PWD/osc/debian.changelog
A    $PWD/osc/debian.tar.gz
A    $PWD/osc/osc-0.113.tar.gz
A    $PWD/osc/osc.changes
A    $PWD/osc/osc.dsc
A    $PWD/osc/osc.spec
A    $PWD/osc/ready

Versus without -c

$ osc co openSUSE:Factory osc
A    $PWD/openSUSE:Factory/osc/debian.changelog
A    $PWD/openSUSE:Factory/osc/debian.tar.gz
A    $PWD/openSUSE:Factory/osc/osc-0.113.tar.gz
A    $PWD/openSUSE:Factory/osc/osc.changes
A    $PWD/openSUSE:Factory/osc/osc.dsc
A    $PWD/openSUSE:Factory/osc/osc.spec
A    $PWD/openSUSE:Factory/osc/ready


Signed-off-by: Brandon Philips <bphilips@suse.de>
This commit is contained in:
Brandon Philips 2009-04-16 17:41:47 +00:00
parent 41eb9614f0
commit 6f99610590

View File

@ -1107,6 +1107,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('-u', '--unexpand-link', action='store_true',
help='if a package is a link, check out the _link file ' \
'instead of the expanded sources')
@cmdln.option('-c', '--current-dir', action='store_true',
help='place PACKAGE folder in the current directory' \
'instead of a PROJECT/PACKAGE directory')
@cmdln.alias('co')
def do_checkout(self, subcmd, opts, *args):
"""${cmd_name}: Check out content from the repository
@ -1155,8 +1159,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
get_source_file(conf.config['apiurl'], project, package, filename, revision=rev)
elif package:
if opts.current_dir: prj_dir = None
else: prj_dir = project
checkout_package(conf.config['apiurl'], project, package,
rev, expand_link=expand_link, prj_dir=project)
rev, expand_link=expand_link, prj_dir=prj_dir)
elif project:
if os.path.exists(project):