diff options
author | Hisham <hisham@gobolinux.org> | 2016-07-28 17:24:15 -0300 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-07-28 17:24:15 -0300 |
commit | accce73cf90bde70baa3d8101b76ca56b0cb0720 (patch) | |
tree | 705bb1ba44cd07f9b701cb8d6cf969d7bb48fd72 /src | |
parent | 5f5b26206068ba597091bb6fc22d8d63c0fef408 (diff) | |
parent | 67a737310b31eed8d1c38eb0e34ff4b6fc411731 (diff) | |
download | luarocks-accce73cf90bde70baa3d8101b76ca56b0cb0720.tar.gz luarocks-accce73cf90bde70baa3d8101b76ca56b0cb0720.tar.bz2 luarocks-accce73cf90bde70baa3d8101b76ca56b0cb0720.zip |
Merge branch 'master' into luarocks-3
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/core/cfg.lua | 2 | ||||
-rw-r--r-- | src/luarocks/fs/win32.lua | 2 | ||||
-rw-r--r-- | src/luarocks/help.lua | 2 | ||||
-rw-r--r-- | src/luarocks/new_version.lua | 14 | ||||
-rw-r--r-- | src/luarocks/unpack.lua | 1 | ||||
-rw-r--r-- | src/luarocks/upload.lua | 3 |
6 files changed, 16 insertions, 8 deletions
diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index 42508b9e..73bff097 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua | |||
@@ -406,7 +406,7 @@ local defaults = { | |||
406 | 406 | ||
407 | if cfg.platforms.windows then | 407 | if cfg.platforms.windows then |
408 | local full_prefix = (site_config.LUAROCKS_PREFIX or (os.getenv("PROGRAMFILES")..[[\LuaRocks]])) | 408 | local full_prefix = (site_config.LUAROCKS_PREFIX or (os.getenv("PROGRAMFILES")..[[\LuaRocks]])) |
409 | extra_luarocks_module_dir = full_prefix.."\\lua\\?.lua" | 409 | extra_luarocks_module_dir = full_prefix.."/lua/?.lua" |
410 | 410 | ||
411 | home_config_file = home_config_file and home_config_file:gsub("\\","/") | 411 | home_config_file = home_config_file and home_config_file:gsub("\\","/") |
412 | defaults.fs_use_modules = false | 412 | defaults.fs_use_modules = false |
diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua index c03db6a0..9ce95986 100644 --- a/src/luarocks/fs/win32.lua +++ b/src/luarocks/fs/win32.lua | |||
@@ -130,6 +130,8 @@ function win32.wrap_script(file, dest, name, version) | |||
130 | local wrapname = fs.is_dir(dest) and dest.."/"..base or dest | 130 | local wrapname = fs.is_dir(dest) and dest.."/"..base or dest |
131 | wrapname = wrapname..".bat" | 131 | wrapname = wrapname..".bat" |
132 | local lpath, lcpath = cfg.package_paths() | 132 | local lpath, lcpath = cfg.package_paths() |
133 | lpath = util.remove_path_dupes(lpath, ";") | ||
134 | lcpath = util.remove_path_dupes(lcpath, ";") | ||
133 | local wrapper = io.open(wrapname, "w") | 135 | local wrapper = io.open(wrapname, "w") |
134 | if not wrapper then | 136 | if not wrapper then |
135 | return nil, "Could not open "..wrapname.." for writing." | 137 | return nil, "Could not open "..wrapname.." for writing." |
diff --git a/src/luarocks/help.lua b/src/luarocks/help.lua index 51e2cf57..d27c3a50 100644 --- a/src/luarocks/help.lua +++ b/src/luarocks/help.lua | |||
@@ -64,7 +64,7 @@ function help.command(flags, command) | |||
64 | --verbose Display verbose output of commands executed. | 64 | --verbose Display verbose output of commands executed. |
65 | --timeout=<seconds> Timeout on network operations, in seconds. | 65 | --timeout=<seconds> Timeout on network operations, in seconds. |
66 | 0 means no timeout (wait forever). | 66 | 0 means no timeout (wait forever). |
67 | Default is ]]..cfg.connection_timeout..[[.]]) | 67 | Default is ]]..tostring(cfg.connection_timeout)..[[.]]) |
68 | print_section("VARIABLES") | 68 | print_section("VARIABLES") |
69 | util.printout([[ | 69 | util.printout([[ |
70 | Variables from the "variables" table of the configuration file | 70 | Variables from the "variables" table of the configuration file |
diff --git a/src/luarocks/new_version.lua b/src/luarocks/new_version.lua index eb5dea25..000b459b 100644 --- a/src/luarocks/new_version.lua +++ b/src/luarocks/new_version.lua | |||
@@ -133,15 +133,19 @@ function new_version.command(flags, input, version, url) | |||
133 | end | 133 | end |
134 | assert(type(input) == "string") | 134 | assert(type(input) == "string") |
135 | 135 | ||
136 | local filename = input | 136 | local filename, err |
137 | if not input:match("rockspec$") then | 137 | if input:match("rockspec$") then |
138 | local err | 138 | filename, err = fetch.fetch_url(input) |
139 | if not filename then | ||
140 | return nil, err | ||
141 | end | ||
142 | else | ||
139 | filename, err = download.download("rockspec", input) | 143 | filename, err = download.download("rockspec", input) |
140 | if not filename then | 144 | if not filename then |
141 | return nil, err | 145 | return nil, err |
142 | end | 146 | end |
143 | end | 147 | end |
144 | 148 | ||
145 | local valid_rs, err = fetch.load_rockspec(filename) | 149 | local valid_rs, err = fetch.load_rockspec(filename) |
146 | if not valid_rs then | 150 | if not valid_rs then |
147 | return nil, err | 151 | return nil, err |
@@ -167,7 +171,7 @@ function new_version.command(flags, input, version, url) | |||
167 | end | 171 | end |
168 | local new_rockver = new_ver:gsub("-", "") | 172 | local new_rockver = new_ver:gsub("-", "") |
169 | 173 | ||
170 | local out_rs = persist.load_into_table(filename) | 174 | local out_rs, err = persist.load_into_table(filename) |
171 | local out_name = out_rs.package:lower() | 175 | local out_name = out_rs.package:lower() |
172 | out_rs.version = new_rockver.."-"..new_rev | 176 | out_rs.version = new_rockver.."-"..new_rev |
173 | 177 | ||
diff --git a/src/luarocks/unpack.lua b/src/luarocks/unpack.lua index 22b3f49b..af3398ab 100644 --- a/src/luarocks/unpack.lua +++ b/src/luarocks/unpack.lua | |||
@@ -44,7 +44,6 @@ local function unpack_rockspec(rockspec_file, dir_name) | |||
44 | if not ok then return nil, err end | 44 | if not ok then return nil, err end |
45 | ok, err = build.apply_patches(rockspec) | 45 | ok, err = build.apply_patches(rockspec) |
46 | fs.pop_dir() | 46 | fs.pop_dir() |
47 | fs.pop_dir() | ||
48 | if not ok then return nil, err end | 47 | if not ok then return nil, err end |
49 | return rockspec | 48 | return rockspec |
50 | end | 49 | end |
diff --git a/src/luarocks/upload.lua b/src/luarocks/upload.lua index 4bda4303..baee47ab 100644 --- a/src/luarocks/upload.lua +++ b/src/luarocks/upload.lua | |||
@@ -75,6 +75,9 @@ function upload.command(flags, fname) | |||
75 | local module_url = res.module_url | 75 | local module_url = res.module_url |
76 | 76 | ||
77 | if rock_fname then | 77 | if rock_fname then |
78 | if (not res.version) or (not res.version.id) then | ||
79 | return nil, "Invalid response from server." | ||
80 | end | ||
78 | util.printout(("Sending " .. tostring(rock_fname) .. " ...")) | 81 | util.printout(("Sending " .. tostring(rock_fname) .. " ...")) |
79 | res, err = api:method("upload_rock/" .. ("%d"):format(res.version.id), nil, { | 82 | res, err = api:method("upload_rock/" .. ("%d"):format(res.version.id), nil, { |
80 | rock_file = multipart.new_file(rock_fname) | 83 | rock_file = multipart.new_file(rock_fname) |