1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-14 01:26:23 +01:00

fix init_package_dir (broken by commit b3c5204b59)

This commit is contained in:
Ludwig Nussel 2010-08-04 11:20:01 +02:00
parent d3a4119bc8
commit ed2b8e111c

View File

@ -2144,30 +2144,27 @@ def init_project_dir(apiurl, dir, project):
def init_package_dir(apiurl, project, package, dir, revision=None, files=True, limit_size=None, meta=False):
if not os.path.isdir(dir):
os.mkdir(dir)
os.chdir(dir)
f = open('_project', 'w')
f.write(project + '\n')
f.close()
f = open('_package', 'w')
f.write(package + '\n')
f.close()
if not os.path.exists(os.path.join(dir, store)):
os.mkdir(os.path.join(dir, store))
store_write_string(dir, '_project', project)
store_write_string(dir, '_package', package)
if meta:
store_write_string(os.pardir, '_meta_mode', '')
store_write_string(dir, '_meta_mode', '')
if limit_size:
store_write_string(os.pardir, '_size_limit', str(limit_size))
store_write_string(dir, '_size_limit', str(limit_size))
if files:
fmeta = ''.join(show_files_meta(apiurl, project, package, revision=revision, limit_size=limit_size, meta=meta))
store_write_string(os.pardir, '_files', fmeta)
store_write_string(dir, '_files', fmeta)
else:
# create dummy
ET.ElementTree(element=ET.Element('directory')).write('_files')
store_write_string(os.pardir, '_osclib_version', __store_version__ + '\n')
store_write_apiurl(os.path.pardir, apiurl)
os.chdir(os.pardir)
store_write_string(dir, '_osclib_version', __store_version__ + '\n')
store_write_apiurl(dir, apiurl)
def check_store_version(dir):