diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2010-09-11 19:15:40 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2010-09-11 19:15:40 -0300 |
commit | e775a06997f115ff021d03eb00aac6dc060e956b (patch) | |
tree | 93e54bdb4d44700c02d777bcf7c2fc6e751eba92 | |
parent | cfeb7fd129c58f283668a1142ed653d51465ca85 (diff) | |
parent | 9f65f27ac92c8ce7fa6ea7f03d6f59c54d6f1b22 (diff) | |
download | luarocks-e775a06997f115ff021d03eb00aac6dc060e956b.tar.gz luarocks-e775a06997f115ff021d03eb00aac6dc060e956b.tar.bz2 luarocks-e775a06997f115ff021d03eb00aac6dc060e956b.zip |
Merge branch 'master' of github.com:keplerproject/luarocks
-rw-r--r-- | src/luarocks/build.lua | 2 | ||||
-rw-r--r-- | src/luarocks/install.lua | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index b7386688..6eca0c3e 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua | |||
@@ -278,7 +278,7 @@ function run(...) | |||
278 | end | 278 | end |
279 | assert(type(version) == "string" or not version) | 279 | assert(type(version) == "string" or not version) |
280 | 280 | ||
281 | if not flags["local"] and not fs.is_writable(cfg.root_dir) then | 281 | if not flags["local"] and (fs.exists(cfg.root_dir) and not fs.is_writable(cfg.root_dir)) then |
282 | return nil, "Your user does not have write permissions in " .. cfg.root_dir .. | 282 | return nil, "Your user does not have write permissions in " .. cfg.root_dir .. |
283 | " \n-- you may want to run as a privileged user or use your local tree with --local." | 283 | " \n-- you may want to run as a privileged user or use your local tree with --local." |
284 | end | 284 | end |
diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua index 4bb073dc..f9f27ccf 100644 --- a/src/luarocks/install.lua +++ b/src/luarocks/install.lua | |||
@@ -107,14 +107,14 @@ function run(...) | |||
107 | return nil, "Argument missing, see help." | 107 | return nil, "Argument missing, see help." |
108 | end | 108 | end |
109 | 109 | ||
110 | if not flags["local"] and not fs.is_writable(cfg.root_dir) then | 110 | if not flags["local"] and (fs.exists(cfg.root_dir) and not fs.is_writable(cfg.root_dir)) then |
111 | return nil, "Your user does not have write permissions in " .. cfg.root_dir .. | 111 | return nil, "Your user does not have write permissions in " .. cfg.root_dir .. |
112 | " \n-- you may want to run as a privileged user or use your local tree with --local." | 112 | " \n-- you may want to run as a privileged user or use your local tree with --local." |
113 | end | 113 | end |
114 | 114 | ||
115 | if name:match("%.rockspec$") or name:match("%.src%.rock$") then | 115 | if name:match("%.rockspec$") or name:match("%.src%.rock$") then |
116 | local build = require("luarocks.build") | 116 | local build = require("luarocks.build") |
117 | return build.run(name) | 117 | return build.run(name, flags["local"] and "--local") |
118 | elseif name:match("%.rock$") then | 118 | elseif name:match("%.rock$") then |
119 | return install_binary_rock(name) | 119 | return install_binary_rock(name) |
120 | else | 120 | else |