Compare commits

..
Author SHA1 Message Date
sisungo 8fe867991c feat (lib): fix cpp auto-pack symlink error
Signed-off-by: sisungo <[email protected]>
2026-06-18 01:20:14 +08:00
2 changed files with 9 additions and 7 deletions
+6 -1
View File
@@ -83,7 +83,10 @@ def _do_auto_pack(pc: pkgcomposer.PkgComposer, srcdir: str, dstdir: str, filter)
pc.makedirs(os.path.dirname(f"{dstdir}/{ent.name}"))
pc.addfile(ent.path, f"{dstdir}/{ent.name}")
elif ent.is_symlink() and not os.path.isabs(os.readlink(ent.path)):
pc.addfile(ent.path, f"{dstdir}/{ent.name}")
try:
pc.addfile(ent.path, f"{dstdir}/{ent.name}")
except Exception:
pass
def _is_dev_file(ent) -> bool:
@@ -94,6 +97,8 @@ def _is_dev_file(ent) -> bool:
or ent.name.endswith(".pc")
or ent.name.endswith(".h")
or ent.name.endswith(".cmake")
or ent.name.endswith(".inc")
or ("Makefile" in ent.name)
)
+3 -6
View File
@@ -22,10 +22,6 @@ def build(rem: list[str] = []):
subprocess.run(cmdline)
def artifacts_dir():
return f"target/{_rust_triple(arch.get_target())}/release"
def _do_auto_pack(pc: pkgcomposer.PkgComposer, srcdir: str, dstdir: str, filter):
pc.makedir(dstdir)
with os.scandir(srcdir) as entries:
@@ -53,10 +49,11 @@ def _autopack_filter_bin(ent) -> bool:
def _auto_pack(profiles: list[str], pc: pkgcomposer.PkgComposer):
target_dir = f"target/{_rust_triple(arch.get_target())}/release"
if "lib" in profiles:
_do_auto_pack(pc, artifacts_dir(), "lib", _autopack_filter_lib)
_do_auto_pack(pc, target_dir, "lib", _autopack_filter_lib)
if "bin" in profiles:
_do_auto_pack(pc, artifacts_dir(), "bin", _autopack_filter_bin)
_do_auto_pack(pc, target_dir, "bin", _autopack_filter_bin)
def use_auto_pack(profiles: list[str]):