diff options
| author | ruki <[email protected]> | 2018-09-23 21:03:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-09-23 21:03:42 +0800 |
| commit | d9d422c8fe2f838052fc2dd92b6801a81a515b34 (patch) | |
| tree | 760c31d11c480a36ac0378824c270abda8b9d60b /xmake/actions/require/action/install.lua | |
| parent | 6935be8876c358d89b5c5c2d5c0a56f4ea9d1590 (diff) | |
add envars for package
Diffstat (limited to 'xmake/actions/require/action/install.lua')
| -rw-r--r-- | xmake/actions/require/action/install.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xmake/actions/require/action/install.lua b/xmake/actions/require/action/install.lua index 8339238e4..660256386 100644 --- a/xmake/actions/require/action/install.lua +++ b/xmake/actions/require/action/install.lua @@ -32,9 +32,9 @@ import("filter") -- uninstall package from the prefix directory function uninstall_prefix(package) - -- remove the previous prefix files + -- remove the previous installed files local prefixdir = package:prefixdir() - for _, relativefile in ipairs(package:prefixlist()) do + for _, relativefile in ipairs(package:prefixinfo().installed) do -- trace vprint("removing %s ..", relativefile) @@ -51,6 +51,9 @@ function uninstall_prefix(package) end end + -- unregister this package + package:unregister() + -- remove the prefix file os.tryrm(package:prefixfile()) end @@ -106,8 +109,13 @@ function install_prefix(package) finally { function () - -- save the prefix list to file - io.save(package:prefixfile(), relativefiles) + -- save the prefix info to file + local prefixinfo = package:prefixinfo() + prefixinfo.installed = relativefiles + io.save(package:prefixfile(), prefixinfo) + + -- register this package + package:register() end } } |
