mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-25 23:58:57 +02:00
Add project_separator to config file
This allows for arbitrary string to be used as a project separator instead of restricting oneself to : or directory structure. Fixes: #1024
This commit is contained in:
@@ -4704,6 +4704,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
prj_dir = opts.output_dir if opts.output_dir else project
|
prj_dir = opts.output_dir if opts.output_dir else project
|
||||||
if not opts.output_dir and conf.config['checkout_no_colon']:
|
if not opts.output_dir and conf.config['checkout_no_colon']:
|
||||||
prj_dir = prj_dir.replace(':', '/')
|
prj_dir = prj_dir.replace(':', '/')
|
||||||
|
else:
|
||||||
|
prj_dir = prj_dir.replace(':', conf.config['project_separator'])
|
||||||
if os.path.exists(prj_dir):
|
if os.path.exists(prj_dir):
|
||||||
sys.exit('osc: project directory \'%s\' already exists' % prj_dir)
|
sys.exit('osc: project directory \'%s\' already exists' % prj_dir)
|
||||||
|
|
||||||
|
@@ -168,6 +168,8 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org',
|
|||||||
'getpac_default_project': 'openSUSE:Factory',
|
'getpac_default_project': 'openSUSE:Factory',
|
||||||
# alternate filesystem layout: have multiple subdirs, where colons were.
|
# alternate filesystem layout: have multiple subdirs, where colons were.
|
||||||
'checkout_no_colon': '0',
|
'checkout_no_colon': '0',
|
||||||
|
# project separator
|
||||||
|
'project_separator': ':',
|
||||||
# change filesystem layout: avoid checkout from within a proj or package dir.
|
# change filesystem layout: avoid checkout from within a proj or package dir.
|
||||||
'checkout_rooted': '0',
|
'checkout_rooted': '0',
|
||||||
# local files to ignore with status, addremove, ....
|
# local files to ignore with status, addremove, ....
|
||||||
@@ -338,6 +340,9 @@ apiurl = %(apiurl)s
|
|||||||
# alternate filesystem layout: have multiple subdirs, where colons were.
|
# alternate filesystem layout: have multiple subdirs, where colons were.
|
||||||
#checkout_no_colon = %(checkout_no_colon)s
|
#checkout_no_colon = %(checkout_no_colon)s
|
||||||
|
|
||||||
|
# instead of colons, use the specified as separator
|
||||||
|
#project_separator = %(project_separator)s
|
||||||
|
|
||||||
# change filesystem layout: avoid checkout within a project or package dir.
|
# change filesystem layout: avoid checkout within a project or package dir.
|
||||||
#checkout_rooted = %(checkout_rooted)s
|
#checkout_rooted = %(checkout_rooted)s
|
||||||
|
|
||||||
|
@@ -5136,6 +5136,8 @@ def checkout_package(apiurl, project, package,
|
|||||||
prj_dir = olddir
|
prj_dir = olddir
|
||||||
elif conf.config['checkout_no_colon']:
|
elif conf.config['checkout_no_colon']:
|
||||||
prj_dir = prj_dir.replace(':', '/')
|
prj_dir = prj_dir.replace(':', '/')
|
||||||
|
else:
|
||||||
|
prj_dir = prj_dir.replace(':', conf.config['project_separator'])
|
||||||
|
|
||||||
root_dots = '.'
|
root_dots = '.'
|
||||||
if conf.config['checkout_rooted']:
|
if conf.config['checkout_rooted']:
|
||||||
|
Reference in New Issue
Block a user