vis_dir, dep_graph_dir, template_filename,
packages_to_be_built)
- sync_dest = os.path.join(sync_dest_base,
+ sync_latest = os.path.join(sync_dest_base,
".dep_graph",
- obs_project,
+ obs_project)
+ sync_dest = os.path.join(sync_latest,
content.get("build_project_id"),
repo)
print "sync_dest = %s" % sync_dest
- # sync to donwload server
- if os.path.exists(sync_dest):
- shutil.rmtree(sync_dest)
- os.makedirs(sync_dest)
+ # sync to download server
+ if not os.path.exists(sync_dest):
+ os.makedirs(sync_dest)
+
+ sync_final_dir = os.path.join(sync_dest, os.path.basename(graph_root_dir))
+ print "sync_dir = %s" % sync_final_dir
+ if( os.path.exists(sync_final_dir) ):
+ shutil.rmtree(sync_final_dir)
+
sync(graph_root_dir, sync_dest)
# make latest link
- latest = os.path.join(sync_dest, "latest")
- if os.path.exists(latest):
+ latest = os.path.join(sync_latest, "latest")
+ if os.path.exists(latest) or os.path.islink(latest):
os.unlink(latest)
os.symlink(content.get("build_project_id"), latest)