зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ae2fbf70fd
Коммит
77e925dc67
|
@ -470,7 +470,9 @@ class VendorManifest(MozbuildObject):
|
||||||
# GitLab puts everything down a directory; move it up.
|
# GitLab puts everything down a directory; move it up.
|
||||||
if has_prefix:
|
if has_prefix:
|
||||||
tardir = mozpath.join(tmpextractdir.name, one_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)
|
mozfile.remove(tardir)
|
||||||
|
|
||||||
if self.should_perform_step("include"):
|
if self.should_perform_step("include"):
|
||||||
|
|
|
@ -305,7 +305,7 @@ def remove(path):
|
||||||
_call_with_windows_retry(shutil.rmtree, (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
|
Copy the contents of the srcdir into the dstdir, preserving
|
||||||
subdirectories.
|
subdirectories.
|
||||||
|
@ -346,7 +346,12 @@ def copy_contents(srcdir, dstdir):
|
||||||
if errors:
|
if errors:
|
||||||
raise Exception(errors)
|
raise Exception(errors)
|
||||||
else:
|
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):
|
def move(src, dst):
|
||||||
|
|
Загрузка…
Ссылка в новой задаче