зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1904776 - Allow dangling symlinks when unpacking upstream tarball with mach vendor r=glandium
As a side effect, also propagate dangling symlink option when called recursively. Differential Revision: https://phabricator.services.mozilla.com/D214924
This commit is contained in:
Родитель
f1136726b1
Коммит
69bac7b60d
|
@ -604,7 +604,9 @@ class VendorManifest(MozbuildObject):
|
|||
# Then copy over the directories
|
||||
if self.should_perform_step("move-contents"):
|
||||
self.logInfo({"d": vendor_dir}, "Copying to {d}.")
|
||||
mozfile.copy_contents(tmpextractdir.name, vendor_dir)
|
||||
mozfile.copy_contents(
|
||||
tmpextractdir.name, vendor_dir, ignore_dangling_symlinks=True
|
||||
)
|
||||
else:
|
||||
self.logInfo({}, "Skipping copying contents into tree.")
|
||||
self._extract_directory = lambda: tmpextractdir.name
|
||||
|
|
|
@ -332,7 +332,11 @@ def copy_contents(srcdir, dstdir, ignore_dangling_symlinks=False):
|
|||
linkto = os.readlink(srcname)
|
||||
os.symlink(linkto, dstname)
|
||||
elif os.path.isdir(srcname):
|
||||
copy_contents(srcname, dstname)
|
||||
copy_contents(
|
||||
srcname,
|
||||
dstname,
|
||||
ignore_dangling_symlinks=ignore_dangling_symlinks,
|
||||
)
|
||||
else:
|
||||
_call_windows_retry(shutil.copy2, (srcname, dstname))
|
||||
except OSError as why:
|
||||
|
|
Загрузка…
Ссылка в новой задаче