build.py: fix symlinks

This commit is contained in:
rolux 2012-06-17 13:24:41 +02:00
parent 123f81183e
commit be5cecfe4c

View file

@ -203,11 +203,11 @@ def build_oxjs(downloads=False, geo=False):
# source
source_file = download_path + 'OxJS.%s.source.tar.gz' % version
data['size']['source'] = write_tarfile(source_file, root_path, 'OxJS', filter_source)
write_link(source_file, source_file.replace(version, 'latest'))
write_link(source_file.replace(download_path, ''), source_file.replace(version, 'latest'))
# build
build_file = download_path + 'OxJS.%s.build.tar.gz' % version
data['size']['build'] = write_tarfile(build_file, root_path, 'OxJS', filter_build)
write_link(build_file, build_file.replace(version, 'latest'))
write_link(build_file.replace(download_path, ''), build_file.replace(version, 'latest'))
# json
write_file(download_path + 'downloads.json', json.dumps(data, indent=4, sort_keys=True))
@ -253,7 +253,7 @@ def write_file(file, data):
def write_link(source, target):
print 'linking', source, 'to', target
write_path(target)
if os.path.exists(target):
if os.path.lexists(target):
os.unlink(target)
os.symlink(source, target)