From e86b29ab0dd08502a089769391688fac898d376d Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Fri, 25 Oct 2013 22:58:15 -0700 Subject: [PATCH 1/2] Added option to load luadist as a module. --- luadist.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/luadist.lua b/luadist.lua index 0c47b2d..da875dc 100755 --- a/luadist.lua +++ b/luadist.lua @@ -727,7 +727,9 @@ function apply_settings(variable, value) end -- Parse command line input and run the required command. -if not commands[arg[1]] and commands[arg[2]] then +if pcall(debug.getlocal, 4, 1) then + return commands -- return commands when used as module +elseif not commands[arg[1]] and commands[arg[2]] then -- deploy_dir specified return run_command(arg[1], arg[2], 3) elseif commands[arg[1]] then From 9cacf85758e111bf905ddb40f2b31fe777d65031 Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Fri, 25 Oct 2013 23:01:47 -0700 Subject: [PATCH 2/2] Fixed an error thrown when `retrieve_pkg_info` fails. --- dist/depends.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/depends.lua b/dist/depends.lua index bd2cfd6..2a6b7f0 100644 --- a/dist/depends.lua +++ b/dist/depends.lua @@ -327,7 +327,7 @@ local function get_packages_to_install(pkg, installed, manifest, dependency_mani end end - if was_scm_version then pkg.was_scm_version = true end + if pkg and was_scm_version then pkg.was_scm_version = true end -- check arch & type if not err then