Skip to content

Commit

Permalink
Revert "Windows extract: always chmod files (JuliaIO#85)"
Browse files Browse the repository at this point in the history
This reverts commit 3ff3375.
  • Loading branch information
KristofferC committed Dec 5, 2020
1 parent 3ff3375 commit 19293c2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/extract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,15 @@ function extract_tarball(
elseif hdr.type == :file
read_data(tar, sys_path, size=hdr.size, buf=buf)
# change executable bit if necessary
tar_exec = !iszero(0o100 & hdr.mode)
sys_exec = Sys.isexecutable(sys_path)
if tar_exec != sys_exec
if Sys.iswindows() !iszero(0o100 & hdr.mode)
mode = filemode(sys_path)
if tar_exec
if Sys.iswindows()
# turn off all execute bits
mode &= 0o666
else
# copy read bits to execute bits with
# at least the user execute bit on
mode |= 0o100 | (mode & 0o444) >> 2
else
# turn off all execute bits
mode &= 0o666
end
chmod(sys_path, mode)
end
Expand Down

0 comments on commit 19293c2

Please sign in to comment.