From 50d77ad221717ac06ee0dc3781c97dea334cb7c0 Mon Sep 17 00:00:00 2001 From: Junghyun Kim Date: Tue, 23 May 2017 10:53:30 +0900 Subject: [PATCH] latest link location fixed. Change-Id: I4e51252e311a9bd94cf096462f2169a7702b07c0 Signed-off-by: Junghyun Kim --- job_make_dep_graph.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/job_make_dep_graph.py b/job_make_dep_graph.py index 9a5ecb4..52b0c92 100644 --- a/job_make_dep_graph.py +++ b/job_make_dep_graph.py @@ -88,23 +88,29 @@ def create_build_progress_dep_graph(build, obs_project, content): 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) -- 2.7.4