aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c>2009-08-26 15:12:42 +0000
committerhisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c>2009-08-26 15:12:42 +0000
commit284bf00bb2fa157063ce8d5dc58e47d38eea8209 (patch)
tree60a22f2ebe719b1fe8f7feea1b7853b231626968 /src
parentec074fcb99c44941c38775e51700d60cbd59cfd4 (diff)
downloadluarocks-284bf00bb2fa157063ce8d5dc58e47d38eea8209.tar.gz
luarocks-284bf00bb2fa157063ce8d5dc58e47d38eea8209.tar.bz2
luarocks-284bf00bb2fa157063ce8d5dc58e47d38eea8209.zip
better error checking
git-svn-id: http://luarocks.org/svn/luarocks/trunk@49 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/command_line.lua1
-rw-r--r--src/luarocks/fetch.lua3
-rw-r--r--src/luarocks/fs/unix/tools.lua3
3 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua
index 963916bd..58c54354 100644
--- a/src/luarocks/command_line.lua
+++ b/src/luarocks/command_line.lua
@@ -6,6 +6,7 @@ local util = require("luarocks.util")
6local cfg = require("luarocks.cfg") 6local cfg = require("luarocks.cfg")
7local fs = require("luarocks.fs") 7local fs = require("luarocks.fs")
8local path = require("luarocks.path") 8local path = require("luarocks.path")
9local dir = require("luarocks.dir")
9 10
10--- Display an error message and exit. 11--- Display an error message and exit.
11-- @param message string: The error message. 12-- @param message string: The error message.
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua
index fc0535a9..407d72c5 100644
--- a/src/luarocks/fetch.lua
+++ b/src/luarocks/fetch.lua
@@ -263,6 +263,9 @@ function get_sources(rockspec, extract, dest_dir)
263 if extract then 263 if extract then
264 fs.change_dir(store_dir) 264 fs.change_dir(store_dir)
265 fs.unpack_archive(rockspec.source.file) 265 fs.unpack_archive(rockspec.source.file)
266 if not fs.exists(rockspec.source.dir) then
267 return nil, "Directory "..rockspec.source.dir.." not found inside archive "..rockspec.source.file
268 end
266 fs.pop_dir() 269 fs.pop_dir()
267 end 270 end
268 return source_file, store_dir 271 return source_file, store_dir
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua
index b4cb43a7..c8fefd4d 100644
--- a/src/luarocks/fs/unix/tools.lua
+++ b/src/luarocks/fs/unix/tools.lua
@@ -14,7 +14,8 @@ local dir_stack = {}
14-- @return boolean: true if command succeeds (status code 0), false 14-- @return boolean: true if command succeeds (status code 0), false
15-- otherwise. 15-- otherwise.
16function execute_string(cmd) 16function execute_string(cmd)
17 if os.execute("cd " .. fs.Q(fs.current_dir()) .. " && " .. cmd) == 0 then 17 local actual_cmd = "cd " .. fs.Q(fs.current_dir()) .. " && " .. cmd
18 if os.execute(actual_cmd) == 0 then
18 return true 19 return true
19 else 20 else
20 return false 21 return false