diff options
-rw-r--r-- | spec/quick/build.q | 47 | ||||
-rw-r--r-- | spec/util/test_env.lua | 2 | ||||
-rw-r--r-- | src/luarocks/manif/writer.lua | 2 | ||||
-rw-r--r-- | src/luarocks/upload/api.lua | 3 |
4 files changed, 51 insertions, 3 deletions
diff --git a/spec/quick/build.q b/spec/quick/build.q index 958ce5d1..6d7c4744 100644 --- a/spec/quick/build.q +++ b/spec/quick/build.q | |||
@@ -302,3 +302,50 @@ return { | |||
302 | } | 302 | } |
303 | } | 303 | } |
304 | -------------------------------------------------------------------------------- | 304 | -------------------------------------------------------------------------------- |
305 | |||
306 | |||
307 | |||
308 | ================================================================================ | ||
309 | TEST: installs bin entries correctly | ||
310 | |||
311 | FILE: test-1.0-1.rockspec | ||
312 | -------------------------------------------------------------------------------- | ||
313 | package = "test" | ||
314 | version = "1.0-1" | ||
315 | source = { | ||
316 | url = "file://%{url(%{fixtures_dir})}/an_upstream_tarball-0.1.tar.gz", | ||
317 | dir = "an_upstream_tarball-0.1", | ||
318 | } | ||
319 | build = { | ||
320 | type = "builtin", | ||
321 | modules = { | ||
322 | my_module = "src/my_module.lua" | ||
323 | }, | ||
324 | install = { | ||
325 | bin = { | ||
326 | "src/my_module.lua" | ||
327 | } | ||
328 | } | ||
329 | } | ||
330 | -------------------------------------------------------------------------------- | ||
331 | |||
332 | RUN: luarocks build test-1.0-1.rockspec --tree=lua_modules | ||
333 | |||
334 | RM: %{fixtures_dir}/bin/something.lua | ||
335 | |||
336 | EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/test-1.0-1.rockspec | ||
337 | |||
338 | FILE_CONTENTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/rock_manifest | ||
339 | -------------------------------------------------------------------------------- | ||
340 | rock_manifest = { | ||
341 | bin = { | ||
342 | ["my_module.lua"] = "25884dbf5be7114791018a48199d4c04" | ||
343 | }, | ||
344 | lua = { | ||
345 | ["my_module.lua"] = "25884dbf5be7114791018a48199d4c04" | ||
346 | }, | ||
347 | ["test-1.0-1.rockspec"] = | ||
348 | } | ||
349 | -------------------------------------------------------------------------------- | ||
350 | |||
351 | EXISTS: ./lua_modules/bin/my_module.lua%{wrapper_extension} | ||
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 2255d141..5d385db3 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
@@ -527,7 +527,7 @@ end | |||
527 | function test_env.write_file(pathname, str, finally) | 527 | function test_env.write_file(pathname, str, finally) |
528 | pathname = V(pathname) | 528 | pathname = V(pathname) |
529 | 529 | ||
530 | local file = assert(io.open(pathname, "w")) | 530 | local file = assert(io.open(pathname, "wb")) |
531 | file:write(str) | 531 | file:write(str) |
532 | file:close() | 532 | file:close() |
533 | if finally then | 533 | if finally then |
diff --git a/src/luarocks/manif/writer.lua b/src/luarocks/manif/writer.lua index e39137c2..36f5f57f 100644 --- a/src/luarocks/manif/writer.lua +++ b/src/luarocks/manif/writer.lua | |||
@@ -267,7 +267,7 @@ function writer.make_rock_manifest(name, version) | |||
267 | local walk = tree | 267 | local walk = tree |
268 | local last | 268 | local last |
269 | local last_name | 269 | local last_name |
270 | for filename in file:gmatch("[^/]+") do | 270 | for filename in file:gmatch("[^\\/]+") do |
271 | local next = walk[filename] | 271 | local next = walk[filename] |
272 | if not next then | 272 | if not next then |
273 | next = {} | 273 | next = {} |
diff --git a/src/luarocks/upload/api.lua b/src/luarocks/upload/api.lua index 8e26f66a..e1413702 100644 --- a/src/luarocks/upload/api.lua +++ b/src/luarocks/upload/api.lua | |||
@@ -8,6 +8,7 @@ local util = require("luarocks.util") | |||
8 | local persist = require("luarocks.persist") | 8 | local persist = require("luarocks.persist") |
9 | local multipart = require("luarocks.upload.multipart") | 9 | local multipart = require("luarocks.upload.multipart") |
10 | local json = require("luarocks.vendor.dkjson") | 10 | local json = require("luarocks.vendor.dkjson") |
11 | local dir_sep = package.config:sub(1, 1) | ||
11 | 12 | ||
12 | local Api = {} | 13 | local Api = {} |
13 | 14 | ||
@@ -15,7 +16,7 @@ local function upload_config_file() | |||
15 | if not cfg.config_files.user.file then | 16 | if not cfg.config_files.user.file then |
16 | return nil | 17 | return nil |
17 | end | 18 | end |
18 | return (cfg.config_files.user.file:gsub("/[^/]+$", "/upload_config.lua")) | 19 | return (cfg.config_files.user.file:gsub("[\\/][^\\/]+$", dir_sep .. "upload_config.lua")) |
19 | end | 20 | end |
20 | 21 | ||
21 | function Api:load_config() | 22 | function Api:load_config() |