|
1 | 1 | import argparse |
2 | 2 | import os |
3 | | -from os.path import dirname |
4 | 3 | import shutil |
5 | 4 | import stat |
6 | 5 | import sys |
7 | 6 | import zipfile |
| 7 | +from os.path import dirname |
8 | 8 |
|
9 | 9 | # Unix permission bit for symlink (S_IFLNK) |
10 | 10 | # S_IFLNK is usually 0o120000 |
@@ -113,10 +113,12 @@ def convert_symlink_target(path, platform_pathsep): |
113 | 113 | # Convert Unix to Windows |
114 | 114 | return path.replace("/", "\\") |
115 | 115 |
|
| 116 | + |
116 | 117 | # Zip files use forward slash for the entries, even on Windows |
117 | 118 | def normalize_zip_path(path): |
118 | 119 | return path.replace("\\", "/") |
119 | 120 |
|
| 121 | + |
120 | 122 | def _write_entry(zf, entry, compress_type, seen, platform_pathsep): |
121 | 123 | type_, is_symlink_str, zip_path, content_path = entry |
122 | 124 | # Normalize slashes, otherwise the `seen` logic doesn't |
@@ -262,8 +264,7 @@ def main(): |
262 | 264 | "--runfiles-dir", default="runfiles", help="Name of the runfiles directory" |
263 | 265 | ) |
264 | 266 | parser.add_argument( |
265 | | - "--target-platform-pathsep", |
266 | | - help = "The path separator for the target platform" |
| 267 | + "--target-platform-pathsep", help="The path separator for the target platform" |
267 | 268 | ) |
268 | 269 | args = parser.parse_args() |
269 | 270 |
|
|
0 commit comments