• Home
  • Raw
  • Download

Lines Matching refs:self

30     def __init__(self, packer_args) -> None:  argument
31 self.config = Config()
32 self.replace_items = {
33 r'${product_name}': self.config.product,
34 r'${root_path}': self.config.root_path,
35 r'${out_path}': self.config.out_path
37 self.packing_process = [
38 self.mv_usr_libs, self.create_fs_dirs, self.fs_link,
39 self.fs_filemode, self.fs_make_cmd, self.fs_tear_down
41 self.fs_cfg = None
42 self.chmod_dirs = []
44 def mv_usr_libs(self): argument
45 src_path = self.config.out_path
46 libs = [lib for lib in os.listdir(src_path) if self.is_lib(lib)]
65 def create_fs_dirs(self): argument
66 fs_path = os.path.join(self.config.out_path,
67 self.fs_cfg.get('fs_dir_name', 'rootfs'))
68 exist_ok, with_rm = self.is_incr(self.fs_cfg.get('fs_incr', None))
71 self.replace_items[r'${fs_dir}'] = fs_path
73 for fs_dir in self.fs_cfg.get('fs_dirs', []):
79 source_path = self.fs_dirs_replace(source_dir,
80 self.config.out_path)
81 target_path = self.fs_dirs_replace(target_dir, fs_path)
86 self.chmod_dirs.append(target_mode_tuple)
89 self.copy_files(source_path, target_path, fs_dir)
91 def fs_dirs_replace(self, path, default_path): argument
92 source_path, is_changed = self.replace(path)
97 def copy_files(self, spath, tpath, fs_dir): argument
105 self.chmod_dirs.append((target_path, dir_mode))
109 self.chmod_dirs.append((tfile, file_mode))
118 for srelpath, sfile in self.list_all_files(spath, ignore_files):
143 def list_all_files(self, path, ignore_list=None): argument
145 files = self.filter(files, ignore_list)
151 def replace(self, raw_str): argument
153 for old, new in self.replace_items.items():
157 def fs_link(self): argument
158 fs_symlink = self.fs_cfg.get('fs_symlink', [])
160 source, _ = self.replace(symlink.get('source', ''))
161 link_name, _ = self.replace(symlink.get('link_name', ''))
166 def fs_filemode(self): argument
167 fs_filemode = self.fs_cfg.get('fs_filemode', [])
169 file_dir = os.path.join(self.replace_items[r'${fs_dir}'],
173 self.chmod_dirs.append((file_dir, file_mode))
175 for file_dir, file_mode in self.chmod_dirs:
176 self.chmod(file_dir, file_mode)
178 def fs_make_cmd(self): argument
179 fs_make_cmd = self.fs_cfg.get('fs_make_cmd', [])
180 log_path = self.config.log_path
183 cmd, _ = self.replace(cmd)
187 def fs_tear_down(self): argument
188 while len(self.chmod_dirs):
189 tfile = self.chmod_dirs.pop()[0]
192 self.chmod(tfile, 555)
194 self.chmod(tfile, 755)
196 def fs_attr_process(self, fs_cfg): argument
199 if attr_key in self.config.fs_attr:
208 def fs_make(self, cmd_args): argument
209 fs_cfg_path = os.path.join(self.config.product_path, 'fs.yml')
214 if self.config.fs_attr is None:
220 self.fs_cfg = self.fs_attr_process(fs_cfg)
221 if self.fs_cfg.get('fs_dir_name', None) is None:
224 for fs_process_func in self.packing_process: