1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-24 22:06:14 +01: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:
Adam Majer 2022-04-08 17:38:51 +02:00
parent 515db3dea0
commit c4c2d2a933
3 changed files with 9 additions and 0 deletions

View File

@ -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
if not opts.output_dir and conf.config['checkout_no_colon']:
prj_dir = prj_dir.replace(':', '/')
else:
prj_dir = prj_dir.replace(':', conf.config['project_separator'])
if os.path.exists(prj_dir):
sys.exit('osc: project directory \'%s\' already exists' % prj_dir)

View File

@ -168,6 +168,8 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org',
'getpac_default_project': 'openSUSE:Factory',
# alternate filesystem layout: have multiple subdirs, where colons were.
'checkout_no_colon': '0',
# project separator
'project_separator': ':',
# change filesystem layout: avoid checkout from within a proj or package dir.
'checkout_rooted': '0',
# local files to ignore with status, addremove, ....
@ -338,6 +340,9 @@ apiurl = %(apiurl)s
# alternate filesystem layout: have multiple subdirs, where colons were.
#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.
#checkout_rooted = %(checkout_rooted)s

View File

@ -5136,6 +5136,8 @@ def checkout_package(apiurl, project, package,
prj_dir = olddir
elif conf.config['checkout_no_colon']:
prj_dir = prj_dir.replace(':', '/')
else:
prj_dir = prj_dir.replace(':', conf.config['project_separator'])
root_dots = '.'
if conf.config['checkout_rooted']: