1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02: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:
Marcus Hüwe 2007-11-29 12:54:07 +00:00
parent 7b9f85f97f
commit d4bfd42bb4
2 changed files with 14 additions and 5 deletions

View File

@ -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)

View File

@ -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)):