1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 18:26:15 +01:00

- check if a project exists before initializing the project dir

This commit is contained in:
Marcus Hüwe 2008-01-18 10:35:57 +00:00
parent 2e263514f8
commit f8b5963c7a

View File

@ -699,8 +699,12 @@ class Osc(cmdln.Cmdln):
elif project:
if not os.path.exists(project):
init_project_dir(conf.config['apiurl'], project, project)
print statfrmt('A', project)
if meta_exists(metatype='prj', path_args=quote_plus(project), create_new=False):
init_project_dir(conf.config['apiurl'], project, project)
print statfrmt('A', project)
else:
print >>sys.stderr, 'osc: project \'%s\' does not exist on the server' % project
sys.exit(1)
else:
print >>sys.stderr, 'osc: project \'%s\' already exists' % project
sys.exit(1)