aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-02-15 11:35:25 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-02-15 11:35:25 -0200
commit7f6320cfda5787ce3ef29965309e40df53a314d0 (patch)
tree9651858c433666f29db5ac8d49fde0378ef1f2c4
parent113ada0d24e148bca42cc79ca05b0cec12b1fd0e (diff)
parent500741fa04122ae437b6d7546efed0b2aeef9c99 (diff)
downloadluarocks-7f6320cfda5787ce3ef29965309e40df53a314d0.tar.gz
luarocks-7f6320cfda5787ce3ef29965309e40df53a314d0.tar.bz2
luarocks-7f6320cfda5787ce3ef29965309e40df53a314d0.zip
Merge pull request #309 from mpeterv/unused_variables
Removed some unused and global variables
-rw-r--r--src/luarocks/manif_core.lua1
-rw-r--r--src/luarocks/path_cmd.lua1
-rw-r--r--src/luarocks/persist.lua5
-rw-r--r--src/luarocks/upload/api.lua2
4 files changed, 3 insertions, 6 deletions
diff --git a/src/luarocks/manif_core.lua b/src/luarocks/manif_core.lua
index 1a2c111f..d719caa2 100644
--- a/src/luarocks/manif_core.lua
+++ b/src/luarocks/manif_core.lua
@@ -9,7 +9,6 @@ local persist = require("luarocks.persist")
9local type_check = require("luarocks.type_check") 9local type_check = require("luarocks.type_check")
10local dir = require("luarocks.dir") 10local dir = require("luarocks.dir")
11local util = require("luarocks.util") 11local util = require("luarocks.util")
12local cfg = require("luarocks.cfg")
13local path = require("luarocks.path") 12local path = require("luarocks.path")
14 13
15manif_core.manifest_cache = {} 14manif_core.manifest_cache = {}
diff --git a/src/luarocks/path_cmd.lua b/src/luarocks/path_cmd.lua
index 95532f9f..2bee4cb5 100644
--- a/src/luarocks/path_cmd.lua
+++ b/src/luarocks/path_cmd.lua
@@ -6,7 +6,6 @@ local path_cmd = {}
6local util = require("luarocks.util") 6local util = require("luarocks.util")
7local deps = require("luarocks.deps") 7local deps = require("luarocks.deps")
8local cfg = require("luarocks.cfg") 8local cfg = require("luarocks.cfg")
9local path = require("luarocks.path")
10 9
11path_cmd.help_summary = "Return the currently configured package path." 10path_cmd.help_summary = "Return the currently configured package path."
12path_cmd.help_arguments = "" 11path_cmd.help_arguments = ""
diff --git a/src/luarocks/persist.lua b/src/luarocks/persist.lua
index 39e1e71c..9a40785c 100644
--- a/src/luarocks/persist.lua
+++ b/src/luarocks/persist.lua
@@ -54,8 +54,7 @@ function persist.load_into_table(filename, tbl)
54 assert(type(filename) == "string") 54 assert(type(filename) == "string")
55 assert(type(tbl) == "table" or not tbl) 55 assert(type(tbl) == "table" or not tbl)
56 56
57 local result, ok, err 57 local result = tbl or {}
58 result = tbl or {}
59 local globals = {} 58 local globals = {}
60 local globals_mt = { 59 local globals_mt = {
61 __index = function(t, n) 60 __index = function(t, n)
@@ -66,7 +65,7 @@ function persist.load_into_table(filename, tbl)
66 local save_mt = getmetatable(result) 65 local save_mt = getmetatable(result)
67 setmetatable(result, globals_mt) 66 setmetatable(result, globals_mt)
68 67
69 ok, err, errcode = run_file(filename, result) 68 local ok, err, errcode = run_file(filename, result)
70 69
71 setmetatable(result, save_mt) 70 setmetatable(result, save_mt)
72 71
diff --git a/src/luarocks/upload/api.lua b/src/luarocks/upload/api.lua
index 97c3598e..fd476968 100644
--- a/src/luarocks/upload/api.lua
+++ b/src/luarocks/upload/api.lua
@@ -155,7 +155,7 @@ function Api:request(url, params, post_params)
155 if cfg.connection_timeout and cfg.connection_timeout > 0 then 155 if cfg.connection_timeout and cfg.connection_timeout > 0 then
156 curl_cmd = curl_cmd .. "--connect-timeout "..tonumber(cfg.connection_timeout).." " 156 curl_cmd = curl_cmd .. "--connect-timeout "..tonumber(cfg.connection_timeout).." "
157 end 157 end
158 ok = fs.execute_string(curl_cmd..fs.Q(url).." -o "..fs.Q(tmpfile)) 158 local ok = fs.execute_string(curl_cmd..fs.Q(url).." -o "..fs.Q(tmpfile))
159 if not ok then 159 if not ok then
160 return nil, "API failure: " .. tostring(url) 160 return nil, "API failure: " .. tostring(url)
161 end 161 end