Commit 235d842a authored by Mark Mentovai's avatar Mark Mentovai Committed by Commit Bot

Revert "[Mac] Preserve symbolic link in the copy_bundle_data tool."

This reverts commit 6a008993.

Reason for revert: https://crbug.com/966766, more information at https://crbug.com/955936 beginning at comment 13

Original change's description:
> [Mac] Preserve symbolic link in the copy_bundle_data tool.
> 
> The copy_bundle_data tool is implemented in terms of pax for directories
> and ln hard links for files. The pax command does preserve symbolic
> links within the tree that is being copied. But with the way that pax is
> invoked by the tool, cd-ing into the source, if the source is itself
> a symbolic link to a directory, the tree will be logically copied rather
> than just as a symbolic link.
> 
> A similar issue exists with the non-directory symbolic link source case,
> where a hard link will be produced instead of a symbolic link.
> 
> Fix both of these cases by specifically testing if the source is a
> symbolic link and then re-creating it if so.
> 
> Bug: 955936
> Change-Id: I69cf96878e59b0b7b121ae46cba5bc1e81f261ae
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626269
> Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Commit-Queue: Robert Sesek <rsesek@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#662575}

TBR=sdefresne@chromium.org,rsesek@chromium.org,mark@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 955936
Change-Id: Ia1489278b62d0cdb33ed8980bbd6a6bcab0bb199
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628045Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663076}
parent 11a4c9a8
...@@ -432,21 +432,10 @@ template("mac_toolchain") { ...@@ -432,21 +432,10 @@ template("mac_toolchain") {
# constructed using shell variable $OLDPWD (automatically set when # constructed using shell variable $OLDPWD (automatically set when
# cd is used) as computing the relative path is a bit complex and # cd is used) as computing the relative path is a bit complex and
# using pwd would requires a sub-shell to be created. # using pwd would requires a sub-shell to be created.
#
# A special case exists for copying symbolic links. The pax command,
# as noted above, preserves symbolic links but only if they are a child
# node of source. But if the source itself is a symbolic link to a
# directory, the cd into it will copy it as a logical tree rather than
# a symbolic link. Similarly, if source is a symbolic link to a file,
# then the copy_command hard link will not produce a symbolic link, it
# would hard link the file pointed to by the symbolic link.
_copydir = "mkdir -p {{output}} && cd {{source}} && " + _copydir = "mkdir -p {{output}} && cd {{source}} && " +
"pax -rwl . \"\$OLDPWD\"/{{output}}" "pax -rwl . \"\$OLDPWD\"/{{output}}"
_copylink = "ln -s \$(readlink {{source}}) {{output}}" command = "rm -rf {{output}} && if [[ -d {{source}} ]]; then " +
command = "rm -rf {{output}} && " + _copydir + "; else " + copy_command + "; fi"
"if [[ -L {{source}} ]]; then $_copylink; " +
"elif [[ -d {{source}} ]]; then $_copydir; " +
"else $copy_command; fi"
description = "COPY_BUNDLE_DATA {{source}} {{output}}" description = "COPY_BUNDLE_DATA {{source}} {{output}}"
pool = ":bundle_pool($default_toolchain)" pool = ":bundle_pool($default_toolchain)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment