提交 b3c546fb 编写于 作者: O openharmony_ci 提交者: Gitee

!116 【轻量级 PR】:opt fs copy procedure

Merge pull request !116 from yangming_ha/N/A
...@@ -24,6 +24,7 @@ from hb.common.utils import exec_command ...@@ -24,6 +24,7 @@ from hb.common.utils import exec_command
from hb.common.utils import makedirs from hb.common.utils import makedirs
from hb.common.utils import read_yaml_file from hb.common.utils import read_yaml_file
from hb.common.utils import hb_info from hb.common.utils import hb_info
from hb.common.utils import hb_warning
from hb.common.config import Config from hb.common.config import Config
...@@ -107,8 +108,11 @@ class Packer(): ...@@ -107,8 +108,11 @@ class Packer():
makedirs(target_path) makedirs(target_path)
self.chmod_dirs.append((target_path, dir_mode)) self.chmod_dirs.append((target_path, dir_mode))
tfile = os.path.join(target_path, os.path.basename(source_path)) tfile = os.path.join(target_path, os.path.basename(source_path))
shutil.copy(sfile, tfile, follow_symlinks=False) try:
self.chmod_dirs.append((tfile, file_mode)) shutil.copy(sfile, tfile, follow_symlinks=False)
self.chmod_dirs.append((tfile, file_mode))
except FileExistsError:
hb_warning(f'Target file: {tfile} already exists!')
if os.path.isfile(spath): if os.path.isfile(spath):
sfile = spath sfile = spath
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册