mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1856347: Allow copy_contents to take an optional parameter ignore_dangling_symlinks r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D189855
This commit is contained in:
parent
ae2fbf70fd
commit
77e925dc67
@ -470,7 +470,9 @@ class VendorManifest(MozbuildObject):
|
||||
# GitLab puts everything down a directory; move it up.
|
||||
if has_prefix:
|
||||
tardir = mozpath.join(tmpextractdir.name, one_prefix)
|
||||
mozfile.copy_contents(tardir, tmpextractdir.name)
|
||||
mozfile.copy_contents(
|
||||
tardir, tmpextractdir.name, ignore_dangling_symlinks=True
|
||||
)
|
||||
mozfile.remove(tardir)
|
||||
|
||||
if self.should_perform_step("include"):
|
||||
|
@ -305,7 +305,7 @@ def remove(path):
|
||||
_call_with_windows_retry(shutil.rmtree, (path,))
|
||||
|
||||
|
||||
def copy_contents(srcdir, dstdir):
|
||||
def copy_contents(srcdir, dstdir, ignore_dangling_symlinks=False):
|
||||
"""
|
||||
Copy the contents of the srcdir into the dstdir, preserving
|
||||
subdirectories.
|
||||
@ -346,7 +346,12 @@ def copy_contents(srcdir, dstdir):
|
||||
if errors:
|
||||
raise Exception(errors)
|
||||
else:
|
||||
shutil.copytree(srcdir, dstdir, dirs_exist_ok=True)
|
||||
shutil.copytree(
|
||||
srcdir,
|
||||
dstdir,
|
||||
dirs_exist_ok=True,
|
||||
ignore_dangling_symlinks=ignore_dangling_symlinks,
|
||||
)
|
||||
|
||||
|
||||
def move(src, dst):
|
||||
|
Loading…
x
Reference in New Issue
Block a user