diff options
| author | Hisham <hisham@gobolinux.org> | 2016-10-19 12:58:53 -0400 |
|---|---|---|
| committer | Hisham <hisham@gobolinux.org> | 2016-10-19 12:58:53 -0400 |
| commit | 25b934ef93bd2bf434c268db8e2a099bfa4e0a2e (patch) | |
| tree | 34d464b63bd327774cc4b48e4d435a99d0991ddc /src | |
| parent | 66a4d40893199fbee5eed5abd3c91aad0a3cce2b (diff) | |
| parent | 5c6eb8604fe5aee3088096ef808399f847fb24a0 (diff) | |
| download | luarocks-25b934ef93bd2bf434c268db8e2a099bfa4e0a2e.tar.gz luarocks-25b934ef93bd2bf434c268db8e2a099bfa4e0a2e.tar.bz2 luarocks-25b934ef93bd2bf434c268db8e2a099bfa4e0a2e.zip | |
Merge branch 'master' into luarocks-3
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/build.lua | 5 | ||||
| -rw-r--r-- | src/luarocks/build/builtin.lua | 7 | ||||
| -rw-r--r-- | src/luarocks/install.lua | 7 | ||||
| -rw-r--r-- | src/luarocks/repos.lua | 28 |
4 files changed, 29 insertions, 18 deletions
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index c43ee949..1d2925f9 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua | |||
| @@ -348,7 +348,7 @@ function build.build_rockspec(rockspec_file, need_to_fetch, minimal_mode, deps_m | |||
| 348 | ok, err = writer.make_rock_manifest(name, version) | 348 | ok, err = writer.make_rock_manifest(name, version) |
| 349 | if err then return nil, err end | 349 | if err then return nil, err end |
| 350 | 350 | ||
| 351 | ok, err = repos.deploy_files(name, version, repos.should_wrap_bin_scripts(rockspec)) | 351 | ok, err = repos.deploy_files(name, version, repos.should_wrap_bin_scripts(rockspec), deps_mode) |
| 352 | if err then return nil, err end | 352 | if err then return nil, err end |
| 353 | 353 | ||
| 354 | util.remove_scheduled_function(rollback) | 354 | util.remove_scheduled_function(rollback) |
| @@ -359,9 +359,6 @@ function build.build_rockspec(rockspec_file, need_to_fetch, minimal_mode, deps_m | |||
| 359 | ok, err = repos.run_hook(rockspec, "post_install") | 359 | ok, err = repos.run_hook(rockspec, "post_install") |
| 360 | if err then return nil, err end | 360 | if err then return nil, err end |
| 361 | 361 | ||
| 362 | ok, err = writer.update_manifest(name, version, nil, deps_mode) | ||
| 363 | if err then return nil, err end | ||
| 364 | |||
| 365 | util.announce_install(rockspec) | 362 | util.announce_install(rockspec) |
| 366 | util.remove_scheduled_function(rollback) | 363 | util.remove_scheduled_function(rollback) |
| 367 | return name, version | 364 | return name, version |
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index d9785b0c..3a4beb17 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
| @@ -223,14 +223,11 @@ function builtin.run(rockspec) | |||
| 223 | local ext = info:match("%.([^.]+)$") | 223 | local ext = info:match("%.([^.]+)$") |
| 224 | if ext == "lua" then | 224 | if ext == "lua" then |
| 225 | local filename = dir.base_name(info) | 225 | local filename = dir.base_name(info) |
| 226 | if info:match("init%.lua$") and not name:match("%.init$") then | 226 | if filename == "init.lua" and not name:match("%.init$") then |
| 227 | moddir = path.module_to_path(name..".init") | 227 | moddir = path.module_to_path(name..".init") |
| 228 | else | 228 | else |
| 229 | local basename = name:match("([^.]+)$") | 229 | local basename = name:match("([^.]+)$") |
| 230 | local baseinfo = filename:gsub("%.lua$", "") | 230 | filename = basename..".lua" |
| 231 | if basename ~= baseinfo then | ||
| 232 | filename = basename..".lua" | ||
| 233 | end | ||
| 234 | end | 231 | end |
| 235 | local dest = dir.path(luadir, moddir, filename) | 232 | local dest = dir.path(luadir, moddir, filename) |
| 236 | lua_modules[info] = dest | 233 | lua_modules[info] = dest |
diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua index 6dded8ee..c9b085f5 100644 --- a/src/luarocks/install.lua +++ b/src/luarocks/install.lua | |||
| @@ -82,7 +82,7 @@ function install.install_binary_rock(rock_file, deps_mode) | |||
| 82 | if err then return nil, err, errcode end | 82 | if err then return nil, err, errcode end |
| 83 | end | 83 | end |
| 84 | 84 | ||
| 85 | ok, err = repos.deploy_files(name, version, repos.should_wrap_bin_scripts(rockspec)) | 85 | ok, err = repos.deploy_files(name, version, repos.should_wrap_bin_scripts(rockspec), deps_mode) |
| 86 | if err then return nil, err end | 86 | if err then return nil, err end |
| 87 | 87 | ||
| 88 | util.remove_scheduled_function(rollback) | 88 | util.remove_scheduled_function(rollback) |
| @@ -92,10 +92,7 @@ function install.install_binary_rock(rock_file, deps_mode) | |||
| 92 | 92 | ||
| 93 | ok, err = repos.run_hook(rockspec, "post_install") | 93 | ok, err = repos.run_hook(rockspec, "post_install") |
| 94 | if err then return nil, err end | 94 | if err then return nil, err end |
| 95 | 95 | ||
| 96 | ok, err = writer.update_manifest(name, version, nil, deps_mode) | ||
| 97 | if err then return nil, err end | ||
| 98 | |||
| 99 | util.announce_install(rockspec) | 96 | util.announce_install(rockspec) |
| 100 | util.remove_scheduled_function(rollback) | 97 | util.remove_scheduled_function(rollback) |
| 101 | return name, version | 98 | return name, version |
diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index 0ed9068c..47a501af 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua | |||
| @@ -191,7 +191,18 @@ function repos.should_wrap_bin_scripts(rockspec) | |||
| 191 | return true | 191 | return true |
| 192 | end | 192 | end |
| 193 | 193 | ||
| 194 | function repos.deploy_files(name, version, wrap_bin_scripts) | 194 | --- Deploy a package from the rocks subdirectory. |
| 195 | -- It is maintained that for each file the one that is provided | ||
| 196 | -- by the newest version of the lexicographically smallest package | ||
| 197 | -- is installed using unversioned name, and other versions of the file | ||
| 198 | -- use versioned names. | ||
| 199 | -- @param name string: name of package | ||
| 200 | -- @param version string: exact package version in string format | ||
| 201 | -- @param wrap_bin_scripts bool: whether commands written in Lua should be wrapped. | ||
| 202 | -- @param deps_mode: string: Which trees to check dependencies for: | ||
| 203 | -- "one" for the current default tree, "all" for all trees, | ||
| 204 | -- "order" for all trees with priority >= the current default, "none" for no trees. | ||
| 205 | function repos.deploy_files(name, version, wrap_bin_scripts, deps_mode) | ||
| 195 | assert(type(name) == "string") | 206 | assert(type(name) == "string") |
| 196 | assert(type(version) == "string") | 207 | assert(type(version) == "string") |
| 197 | assert(type(wrap_bin_scripts) == "boolean") | 208 | assert(type(wrap_bin_scripts) == "boolean") |
| @@ -247,7 +258,13 @@ function repos.deploy_files(name, version, wrap_bin_scripts) | |||
| 247 | if ok and rock_manifest.lib then | 258 | if ok and rock_manifest.lib then |
| 248 | ok, err = deploy_file_tree(rock_manifest.lib, path.lib_dir, cfg.deploy_lib_dir, make_mover(cfg.perm_exec)) | 259 | ok, err = deploy_file_tree(rock_manifest.lib, path.lib_dir, cfg.deploy_lib_dir, make_mover(cfg.perm_exec)) |
| 249 | end | 260 | end |
| 250 | return ok, err | 261 | |
| 262 | if not ok then | ||
| 263 | return nil, err | ||
| 264 | end | ||
| 265 | |||
| 266 | local writer = require("luarocks.manif.writer") | ||
| 267 | return writer.update_manifest(name, version, nil, deps_mode) | ||
| 251 | end | 268 | end |
| 252 | 269 | ||
| 253 | local function delete_suffixed(filename, suffix) | 270 | local function delete_suffixed(filename, suffix) |
| @@ -266,9 +283,12 @@ local function delete_suffixed(filename, suffix) | |||
| 266 | end | 283 | end |
| 267 | 284 | ||
| 268 | --- Delete a package from the local repository. | 285 | --- Delete a package from the local repository. |
| 269 | -- Version numbers are compared as exact string comparison. | 286 | -- It is maintained that for each file the one that is provided |
| 287 | -- by the newest version of the lexicographically smallest package | ||
| 288 | -- is installed using unversioned name, and other versions of the file | ||
| 289 | -- use versioned names. | ||
| 270 | -- @param name string: name of package | 290 | -- @param name string: name of package |
| 271 | -- @param version string: package version in string format | 291 | -- @param version string: exact package version in string format |
| 272 | -- @param deps_mode: string: Which trees to check dependencies for: | 292 | -- @param deps_mode: string: Which trees to check dependencies for: |
| 273 | -- "one" for the current default tree, "all" for all trees, | 293 | -- "one" for the current default tree, "all" for all trees, |
| 274 | -- "order" for all trees with priority >= the current default, "none" for no trees. | 294 | -- "order" for all trees with priority >= the current default, "none" for no trees. |
