summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbinLep <[email protected]>2026-06-30 14:17:34 +0800
committerbinLep <[email protected]>2026-06-30 14:17:34 +0800
commit0cc074f1e31253225ae955bb7d3b75b8f61e190a (patch)
treed31851b6b525ee1d5a5b73294519f62856ab17b9
parent5cb46ce73332d1cb361b1869e92441d24a017469 (diff)
fix(deb): Avoid passing empty PATH arguments to debuild
-rw-r--r--xmake/plugins/pack/deb/main.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/xmake/plugins/pack/deb/main.lua b/xmake/plugins/pack/deb/main.lua
index ebbdb548e..b0b1633ed 100644
--- a/xmake/plugins/pack/deb/main.lua
+++ b/xmake/plugins/pack/deb/main.lua
@@ -256,7 +256,18 @@ function _pack_deb(debuild, package)
-- build package
-- https://github.com/xmake-io/xmake/issues/7626
- os.vrunv(debuild, {"-e", "PATH=" .. (os.getenv("PATH") or ""), "-us", "-uc"}, {curdir = sourcedir})
+ local debuild_args = {}
+ local pathenv = os.getenv("PATH")
+
+ if pathenv then
+ table.insert(debuild_args, "-e")
+ table.insert(debuild_args, "PATH=" .. pathenv)
+ end
+
+ table.insert(debuild_args, "-us")
+ table.insert(debuild_args, "-uc")
+
+ os.vrunv(debuild, debuild_args, {curdir = sourcedir})
-- copy deb file
os.vcp(path.join(path.directory(sourcedir), "*.deb"), package:outputfile())