summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-07-06 15:34:14 +0800
committerGitHub <[email protected]>2026-07-06 15:34:14 +0800
commit47ac6dbbf4b5e4497d05dabe97cf1910a4f74b2b (patch)
tree99bdc3a0444723d07cb3d6f765fd943ee9d9d856
parent15118bd08542be13f8abe9872903a084edd26deb (diff)
parent047560d9659f742354ef8be6e3394df2984a17f3 (diff)
Merge pull request #7631 from binLep/dev
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..6c0968819 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 and 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())