diff options
| author | ruki <[email protected]> | 2024-06-15 00:54:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-06-15 00:54:38 +0800 |
| commit | 9899ce267b0728176efec6d588cb158aa0d4f668 (patch) | |
| tree | edad5a1ace0f140a308f811aa288a9a542c33fd0 /xmake/plugins/pack/deb/main.lua | |
| parent | 7d0b596dec5177ec3702457bda64560cf65739ac (diff) | |
fix archive
Diffstat (limited to 'xmake/plugins/pack/deb/main.lua')
| -rw-r--r-- | xmake/plugins/pack/deb/main.lua | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/xmake/plugins/pack/deb/main.lua b/xmake/plugins/pack/deb/main.lua index 4e7bed7c4..680531ff6 100644 --- a/xmake/plugins/pack/deb/main.lua +++ b/xmake/plugins/pack/deb/main.lua @@ -106,6 +106,12 @@ function _get_installcmds(package, installcmds, cmds) end end +-- get uninstall commands +function _get_uninstallcmds(package, uninstallcmds, cmds) + for _, cmd in ipairs(cmds) do + _get_customcmd(package, uninstallcmds, cmd) + end +end -- get specvars function _get_specvars(package) @@ -130,6 +136,16 @@ function _get_specvars(package) package:set("prefixdir", prefixdir) return table.concat(installcmds, "\n\t") end + specvars.PACKAGE_UNINSTALLCMDS = function () + local uninstallcmds = {} + _get_uninstallcmds(package, uninstallcmds, batchcmds.get_uninstallcmds(package):cmds()) + for _, component in table.orderpairs(package:components()) do + if component:get("default") ~= false then + _get_uninstallcmds(package, uninstallcmds, batchcmds.get_uninstallcmds(component):cmds()) + end + end + return table.concat(uninstallcmds, "\n\t") + end specvars.PACKAGE_BUILDCMDS = function () local buildcmds = {} _get_buildcmds(package, buildcmds, batchcmds.get_buildcmds(package):cmds()) @@ -214,7 +230,7 @@ function _pack_deb(debuild, package) -- archive install files local rootdir = package:source_rootdir() - local oldir = os.cd(sourcedir) + local oldir = os.cd(rootdir) local archivefiles = os.files("**") os.cd(oldir) local archivefile = _get_archivefile(package) |
