diff options
| author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-05-12 19:16:34 +0000 |
|---|---|---|
| committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-05-12 19:16:34 +0000 |
| commit | b4f32b4d095587982911bb4cf925638d136f902d (patch) | |
| tree | d3fbd16df5474eeb4bb0e8a684727baf610ef254 | |
| parent | 9554bbcab95242cd79710ece8118901de65ce6a5 (diff) | |
| download | luarocks-b4f32b4d095587982911bb4cf925638d136f902d.tar.gz luarocks-b4f32b4d095587982911bb4cf925638d136f902d.tar.bz2 luarocks-b4f32b4d095587982911bb4cf925638d136f902d.zip | |
Add test for io.popen
git-svn-id: http://luarocks.org/svn/luarocks/trunk@22 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
| -rw-r--r-- | src/luarocks/cfg.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index d0de70cc..5afb653d 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | ||
| 2 | local rawset, next, table, pairs, print, require, io, os, setmetatable = | 2 | local rawset, next, table, pairs, print, require, io, os, setmetatable, pcall = |
| 3 | rawset, next, table, pairs, print, require, io, os, setmetatable | 3 | rawset, next, table, pairs, print, require, io, os, setmetatable, pcall |
| 4 | 4 | ||
| 5 | --- Configuration for LuaRocks. | 5 | --- Configuration for LuaRocks. |
| 6 | -- Tries to load the user's configuration file and | 6 | -- Tries to load the user's configuration file and |
| @@ -13,6 +13,17 @@ program_version = "1.1" | |||
| 13 | 13 | ||
| 14 | local persist = require("luarocks.persist") | 14 | local persist = require("luarocks.persist") |
| 15 | 15 | ||
| 16 | local popen_ok, popen_result = pcall(io.popen, "") | ||
| 17 | if popen_ok then | ||
| 18 | if popen_result then | ||
| 19 | result:close() | ||
| 20 | end | ||
| 21 | else | ||
| 22 | print("Your version of Lua does not support io.popen,") | ||
| 23 | print("which is required by LuaRocks. Please check your Lua installation.") | ||
| 24 | os.exit(1) | ||
| 25 | end | ||
| 26 | |||
| 16 | local detected = {} | 27 | local detected = {} |
| 17 | local system,proc | 28 | local system,proc |
| 18 | 29 | ||
