latest link location fixed. 50/130550/1 release-20170522
authorJunghyun Kim <jh0822.kim@samsung.com>
Tue, 23 May 2017 01:53:30 +0000 (10:53 +0900)
committerJunghyun Kim <jh0822.kim@samsung.com>
Tue, 23 May 2017 01:53:30 +0000 (10:53 +0900)
Change-Id: I4e51252e311a9bd94cf096462f2169a7702b07c0
Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
job_make_dep_graph.py

index 9a5ecb4..52b0c92 100644 (file)
@@ -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)