MCPcopy Create free account
hub / github.com/ceph/ceph / _copy_binary

Method _copy_binary

src/script/cpatch.py:516–530  ·  view source on GitHub ↗
(self, src_path, dst_path)

Source from the content-addressed store, hash-verified

514 tar.add(dfile, recursive=False)
515
516 def _copy_binary(self, src_path, dst_path):
517 log.debug("binary: %s -> %s", src_path, dst_path)
518 if self._ctx.strip_binaries:
519 log.debug("copy and strip: %s", dst_path)
520 shutil.copy2(src_path, dst_path)
521 output = _run(["file", str(dst_path)], capture_output=True, text=True)
522 if "ELF" in output.stdout:
523 _run(["strip", str(dst_path)]).check_returncode()
524 return
525 log.debug("hard linking: %s", dst_path)
526 try:
527 os.unlink(dst_path)
528 except FileNotFoundError:
529 pass
530 os.link(src_path, dst_path)
531
532 def _bins_and_libs(self, prefix, bin_patterns, lib_patterns, exclude_prefixes=[]):
533 out = []

Callers 2

_bins_and_libsMethod · 0.95
_pybind_jobMethod · 0.95

Calls 5

copy2Method · 0.80
_runFunction · 0.70
debugMethod · 0.45
unlinkMethod · 0.45
linkMethod · 0.45

Tested by

no test coverage detected