Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: client/cipd.py

Issue 2066913002: swarming-cipd: fix for Windows (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cipd.py
diff --git a/client/cipd.py b/client/cipd.py
index 6d8eb3e3d5f32643e07cda7b5100c6e5a220da00..1362b7aa2d9a0c7c7de19d22e85dea548d2f3fe6 100644
--- a/client/cipd.py
+++ b/client/cipd.py
@@ -395,6 +395,10 @@ def get_client(
# binary.
binary_path = unicode(os.path.join(cache_dir, 'cipd' + EXECUTABLE_SUFFIX))
if fs.isfile(binary_path):
+ # Ensure file is writable to delete the hardlink. This is important on
+ # Windows. Note that mode is stored on file node, not the hardlink, so
+ # keep it executable.
+ fs.chmod(0711, binary_path)
M-A Ruel 2016/06/14 18:17:46 file_path.try_remove() does it automatically.
nodir 2016/06/14 22:16:05 Done.
fs.unlink(binary_path)
instance_cache.hardlink(instance_id, binary_path, 0511) # -r-x--x--x
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698