diff options
author | Deepti B. Kalakeri <deepti.kalakeri@linaro.org> | 2012-05-01 15:38:32 +0530 |
---|---|---|
committer | Deepti B. Kalakeri <deepti.kalakeri@linaro.org> | 2012-05-01 15:38:32 +0530 |
commit | 6bfdac29731253694fdf4a9d2f70ecdeccf5a80f (patch) | |
tree | e390ea293157e21a22f742a39411e4855aa14366 /scripts | |
parent | 31afa323d19ecc4c954aa1331ad484682952e608 (diff) | |
parent | bdd46dc5b23fa0929bb65fe9fc164791167a8baf (diff) |
Create latest and HEADER.html symlinks for Ubuntu images.
Added lines to remove header symlink if it already exists.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/publish_to_snapshots.py | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/scripts/publish_to_snapshots.py b/scripts/publish_to_snapshots.py index 354ca67..79c86d3 100755 --- a/scripts/publish_to_snapshots.py +++ b/scripts/publish_to_snapshots.py @@ -74,8 +74,8 @@ class SnapshotsPublisher(object): build_dir_path = os.path.join(uploads_path, build_path) user_name = ret_val[0] job_name = '_'.join(ret_val[1:]) - target_dir = '/'.join([args.job_type, "~%s" % user_name, job_name, - str(args.build_num)]) + target_dir = '/'.join([args.job_type, "~%s" % user_name, + job_name, str(args.build_num)]) target_dir_path = os.path.join(target_path, target_dir) elif args.job_type == "kernel-hwpack": kernel_tree = ret_val @@ -129,15 +129,25 @@ class SnapshotsPublisher(object): return build_dir_path, target_dir_path - def create_symlink(self, target_dir_path): - target_parent_dir = os.path.dirname(target_dir_path) - symlink_path = os.path.join(target_parent_dir, "lastSuccessful") + def create_symlink(self, args, target_dir_path): + symlink_path = os.path.dirname(target_dir_path) + if args.job_type == "android": + symlink_path = os.path.join(symlink_path, "lastSuccessful") + else: + symlink_path = os.path.join(symlink_path, "latest") + + header_path = os.path.join(target_path, "HEADER.html") + header_symlink_path = os.path.join(target_dir_path, "HEADER.html") try: if os.path.islink(symlink_path): os.unlink(symlink_path) + if os.path.islink(header_symlink_path): + os.unlink(header_symlink_path) + + os.symlink(header_path, header_symlink_path) os.symlink(target_dir_path, symlink_path) - print "The lastSuccessful build is now linked to ", target_dir_path + print "The latest build is now linked to ", target_dir_path return PASS except Exception, details: print "Failed to create symlink", symlink_path, ":", details @@ -157,7 +167,7 @@ class SnapshotsPublisher(object): if len(lines) != 0: fd = open(fn, "w+") for line in lines: - if not "MANIFEST" in line: + if not "MANIFEST" or not "HEADER.html" in line: fd.write(line) fd.close() else: @@ -205,8 +215,11 @@ class SnapshotsPublisher(object): self.move_dir_content(build_dir_path, target_dir_path) - if args.job_type == "android": - ret = self.create_symlink(target_dir_path) + if args.job_type == "android" or\ + args.job_type == "ubuntu-hwpacks" or\ + args.job_type == "ubuntu-images" or\ + args.job_type == "ubuntu-sysroots": + ret = self.create_symlink(args, target_dir_path) if ret != PASS: return ret |