Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed Sep 15, 2024
1 parent cd4fb38 commit 44ab4f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build_helper/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def prepare(configs: dict[str, dict[str, Any]]) -> None:
tasks = []
for cfg_name, openwrt in openwrts.items():
config = configs[cfg_name]
tasks.append((config, cfg_name, openwrt.path, cloned_repos, global_files_path, compiler))
tasks.append((config, cfg_name, openwrt, cloned_repos, global_files_path, compiler))
with Pool(len(cfg_names)) as p:
for cfg_name, config, tar_path in p.starmap(prepare_cfg, tasks):
configs[cfg_name] = config
Expand All @@ -212,11 +212,10 @@ def prepare(configs: dict[str, dict[str, Any]]) -> None:

def prepare_cfg(config: dict[str, Any],
cfg_name: str,
openwrt_path: str,
openwrt: OpenWrt,
cloned_repos: dict[tuple[str, str], str],
global_files_path: str,
compiler: str):
openwrt = OpenWrt(openwrt_path)
logger.info("%s处理软件包...", cfg_name)
for pkg_name, pkg in config["extpackages"].items():
path = os.path.join(openwrt.path, "package", "cmzj_packages", pkg_name)
Expand Down
9 changes: 9 additions & 0 deletions build_helper/utils/openwrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,12 @@ def fix_problems(self) -> None:
core.error("修复libpfring失败, 这可能会导致编译错误。\nttps://github.com/openwrt/packages/commit/c3a50a9fac8f9d8665f8b012abd85bb9e461e865")
else:
core.error("获取libpfring修复补丁失败, 这可能会导致编译错误。\nttps://github.com/openwrt/packages/commit/c3a50a9fac8f9d8665f8b012abd85bb9e461e865")

def __getstate__(self) -> dict:
state = self.__dict__.copy()
del state['repo']
return state

def __setstate__(self, state: dict) -> None:
self.__dict__.update(state)
self.file = pygit2.Repository(self.path)

0 comments on commit 44ab4f4

Please sign in to comment.