mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-15 01:56:17 +01:00
- use existing methods to check if a dir is a project or package dir
- fixed exception code (there was no Exception() instance "e")
This commit is contained in:
parent
1a5bb12218
commit
580510c97a
15
osc/core.py
15
osc/core.py
@ -2719,23 +2719,22 @@ def make_dir(apiurl, project, package, pathname=None, prj_dir=None):
|
|||||||
# and give user a warning message, to discourage such clashes
|
# and give user a warning message, to discourage such clashes
|
||||||
|
|
||||||
pathname = pathname or getTransActPath(os.path.join(prj_dir, package))
|
pathname = pathname or getTransActPath(os.path.join(prj_dir, package))
|
||||||
if os.path.exists(os.path.join(prj_dir,store,'_files')):
|
if is_package_dir(prj_dir):
|
||||||
# we want this to become a project directory,
|
# we want this to become a project directory,
|
||||||
# but it already is a package directory.
|
# but it already is a package directory.
|
||||||
e.osc_msg = 'checkout_package: package/project clash. Moving myself away not implemented'
|
raise oscerr.OscIOError(None, 'checkout_package: package/project clash. Moving myself away not implemented')
|
||||||
raise
|
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(prj_dir,store,'_packages')):
|
if not is_project_dir(prj_dir):
|
||||||
# this directory could exist as a parent direory for one of our earlier
|
# this directory could exist as a parent direory for one of our earlier
|
||||||
# checked out sub-projects. in this case, we still need to initialize it.
|
# checked out sub-projects. in this case, we still need to initialize it.
|
||||||
print statfrmt('A', prj_dir)
|
print statfrmt('A', prj_dir)
|
||||||
init_project_dir(apiurl, prj_dir, project)
|
init_project_dir(apiurl, prj_dir, project)
|
||||||
if os.path.exists(os.path.join(prj_dir, package, store, '_packages')):
|
|
||||||
|
if is_project_dir(os.path.join(prj_dir, package)):
|
||||||
# the thing exists, but is a project directory and not a package directory
|
# the thing exists, but is a project directory and not a package directory
|
||||||
# FIXME: this should be a warning message to discourage package/project clashes
|
# FIXME: this should be a warning message to discourage package/project clashes
|
||||||
e.osc_msg = 'checkout_package: package/project clash. Moving project away not implemented'
|
raise oscerr.OscIOError(None, 'checkout_package: package/project clash. Moving project away not implemented')
|
||||||
raise
|
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(prj_dir, package)):
|
if not os.path.exists(os.path.join(prj_dir, package)):
|
||||||
print statfrmt('A', pathname)
|
print statfrmt('A', pathname)
|
||||||
os.mkdir(os.path.join(prj_dir, package))
|
os.mkdir(os.path.join(prj_dir, package))
|
||||||
|
Loading…
Reference in New Issue
Block a user