aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md9
-rw-r--r--src/lpm.lua18
-rw-r--r--t/run.lua6
3 files changed, 31 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e5c47b3..6e7a7ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+# 1.2.0
+
+* Vendored `libmicrotar`, so that it can be used to open POSIX tar archives, as well as tar archives that have > 100 character filenames. Thank you @Gaspartcho!
+* Fixed bug that tried to uninstall core depednencies. Thanks @Gaspartcho!
+* Fixed issue with `lpm` not correctly renaming bottles, or moving files around.
+* Added in ability to `--mask`, so that you can explicitly cut out dependencies that you think aren't requried on install/uninstall.
+* Made `--ephemeral` bottles have distinct hashes from non-epehemeral ones.
+* Fixed a bug where we tried to double-install depdendencies if they were explicitly specified in the install command.
+
# 1.1.0
* Added in `font` as a new `type` for addons.
diff --git a/src/lpm.lua b/src/lpm.lua
index d8cac2f..8638efe 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -474,7 +474,7 @@ end
local LATEST_MOD_VERSION = "3.0.0"
local EXECUTABLE_EXTENSION = PLATFORM == "windows" and ".exe" or ""
-local HOME, USERDIR, CACHEDIR, JSON, TABLE, HEADER, VERBOSE, FILTRATION, MOD_VERSION, QUIET, FORCE, REINSTALL, CONFIG, NO_COLOR, AUTO_PULL_REMOTES, ARCH, ASSUME_YES, NO_INSTALL_OPTIONAL, TMPDIR, DATADIR, BINARY, POST, PROGRESS, SYMLINK, REPOSITORY, EPHEMERAL, settings, repositories, lite_xls, system_bottle, progress_bar_label, write_progress_bar
+local HOME, USERDIR, CACHEDIR, JSON, TABLE, HEADER, VERBOSE, FILTRATION, MOD_VERSION, QUIET, FORCE, REINSTALL, CONFIG, NO_COLOR, AUTO_PULL_REMOTES, ARCH, ASSUME_YES, NO_INSTALL_OPTIONAL, TMPDIR, DATADIR, BINARY, POST, PROGRESS, SYMLINK, REPOSITORY, EPHEMERAL, MASK, settings, repositories, lite_xls, system_bottle, progress_bar_label, write_progress_bar
local function engage_locks(func, err, warn)
if not system.stat(CACHEDIR) then common.mkdirp(CACHEDIR) end
@@ -777,6 +777,7 @@ end
function Addon:install(bottle, installing)
+ if MASK[self.id] then if not installing[self.id] then log_warning("won't install masked addon " .. self.id) end installing[self.id] = true return end
if self:is_installed(bottle) and not REINSTALL then error("addon " .. self.id .. " is already installed") return end
if self:is_stub() then self:unstub() end
if self.inaccessible then error("addon " .. self.id .. " is inaccessible: " .. self.inaccessible) end
@@ -949,6 +950,7 @@ end
function Addon:uninstall(bottle, uninstalling)
+ if MASK[self.id] then if not uninstalling[self.id] then log_warning("won't uninstall masked addon " .. self.id) end uninstalling[self.id] = true return end
local install_path = self:get_install_path(bottle)
if self:is_core(bottle) then error("can't uninstall " .. self.id .. "; is a core addon") end
local orphans = common.sort(common.grep(self:get_orphaned_dependencies(bottle), function(e) return not uninstalling or not uninstalling[e.id] end), function(a, b) return a.id < b.id end)
@@ -2047,7 +2049,7 @@ xpcall(function()
remotes = "flag", ["ssl-certs"] = "string", force = "flag", arch = "array", ["assume-yes"] = "flag",
["no-install-optional"] = "flag", datadir = "string", binary = "string", trace = "flag", progress = "flag",
symlink = "flag", reinstall = "flag", ["no-color"] = "flag", config = "string", table = "string", header = "string",
- repository = "string", ephemeral = "flag",
+ repository = "string", ephemeral = "flag", mask = "array",
-- filtration flags
author = "string", tag = "string", stub = "string", dependency = "string", status = "string",
type = "string", name = "string"
@@ -2188,6 +2190,10 @@ Flags have the following effects:
are those specified in this option.
--ephemeral Designates a bottle as 'ephemeral', meaning that it
is fully cleaned up when lpm exits.
+ --mask Excludes the specified addons from the operation
+ you're performing. Can break packages if you exclude
+ dependencies that the addon actually requires to run.
+ Ensure you know what you're doing if you use this.
The following flags are useful when listing plugins, or generating the plugin
table. Putting a ! infront of the string will invert the filter. Multiple
@@ -2283,6 +2289,14 @@ not commonly used publically.
TMPDIR = common.normalize_path(ARGS["tmpdir"]) or CACHEDIR .. PATHSEP .. "tmp"
if ARGS["trace"] then system.trace(true) end
+ MASK = {}
+ if ARGS["mask"] then
+ if type(ARGS["mask"]) ~= "table" then ARGS["mask"] = { ARGS["mask"] } end
+ for i,v in ipairs(ARGS["mask"]) do
+ MASK[v] = true
+ end
+ end
+
if (not JSON and not QUIET and (TTY or PROGRESS)) or (JSON and PROGRESS) then
local start_time, last_read
local function format_bytes(bytes)
diff --git a/t/run.lua b/t/run.lua
index 6b25d50..a58bb12 100644
--- a/t/run.lua
+++ b/t/run.lua
@@ -120,6 +120,12 @@ local tests = {
assert_not_exists(userdir .. "/plugins/lsp")
assert_not_exists(userdir .. "/plugins/lintplus")
assert_not_exists(userdir .. "/plugins/settings.lua")
+ end,
+ ["12_masking"] = function()
+ lpm("install lsp --mask settings")
+ assert_exists(userdir .. "/plugins/lsp")
+ assert_exists(userdir .. "/plugins/lintplus")
+ assert_not_exists(userdir .. "/plugins/settings.lua")
end
}