mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- copied init_project_dir() method from the osc-package-tracking branch (just removed the do_package_tracking stuff)
- checkout an empty project instead of doing nothing
This commit is contained in:
parent
7b9f85f97f
commit
d4bfd42bb4
@ -665,6 +665,12 @@ class Osc(cmdln.Cmdln):
|
||||
checkout_package(conf.config['apiurl'], project, package, rev)
|
||||
|
||||
elif project:
|
||||
if not os.path.exists(project):
|
||||
init_project_dir(conf.config['apiurl'], project, project)
|
||||
print statfrmt('A', project)
|
||||
else:
|
||||
print >>sys.stderr, 'osc: project \'%s\' already exists' % project
|
||||
sys.exit(1)
|
||||
# all packages
|
||||
for package in meta_get_packagelist(conf.config['apiurl'], project):
|
||||
checkout_package(conf.config['apiurl'], project, package)
|
||||
|
13
osc/core.py
13
osc/core.py
@ -829,6 +829,13 @@ def urlopen(url, data=None):
|
||||
|
||||
return fd
|
||||
|
||||
def init_project_dir(apiurl, dir, project):
|
||||
if not os.path.exists(dir):
|
||||
os.mkdir(dir)
|
||||
os.mkdir(os.path.join(dir, store))
|
||||
|
||||
store_write_project(dir, project)
|
||||
store_write_apiurl(dir, apiurl)
|
||||
|
||||
def init_package_dir(apiurl, project, package, dir, revision=None):
|
||||
if not os.path.isdir(store):
|
||||
@ -1437,11 +1444,7 @@ def make_dir(apiurl, project, package):
|
||||
#print "creating directory '%s'" % project
|
||||
if not os.path.exists(project):
|
||||
print statfrmt('A', project)
|
||||
os.mkdir(project)
|
||||
os.mkdir(os.path.join(project, store))
|
||||
|
||||
store_write_project(project, project)
|
||||
store_write_apiurl(project, apiurl)
|
||||
init_project_dir(apiurl, project, project)
|
||||
|
||||
#print "creating directory '%s/%s'" % (project, package)
|
||||
if not os.path.exists(os.path.join(project, package)):
|
||||
|
Loading…
Reference in New Issue
Block a user