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

Unified Diff: build/android/gyp/util/build_utils.py

Issue 1875663002: support adding symlinks to zip files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check that src_path is not None Created 4 years, 8 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: build/android/gyp/util/build_utils.py
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
index 5e088b70ed3cbf8c4aa8de3af25d610fb35050da..d2602893805bc500837d14c6c779a72d64e5cb65 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -267,6 +267,12 @@ def AddToZipHermetic(zip_file, zip_path, src_path=None, data=None,
zipinfo = zipfile.ZipInfo(filename=zip_path, date_time=_HERMETIC_TIMESTAMP)
zipinfo.external_attr = _HERMETIC_FILE_ATTR
+ if src_path and os.path.islink(src_path):
+ zipinfo.filename = zip_path
+ zipinfo.external_attr |= stat.S_IFLNK << 16L # mark as a symlink
+ zip_file.writestr(zipinfo, os.readlink(src_path))
+ return
+
if src_path:
with file(src_path) as f:
data = f.read()
« 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