diff options
| author | James Turner <james@calminferno.net> | 2010-11-22 19:54:35 -0500 |
|---|---|---|
| committer | James Turner <james@calminferno.net> | 2010-11-22 19:54:35 -0500 |
| commit | abf7a9d408ed279a98287dad020afee88dcc68cc (patch) | |
| tree | 92dfaaae8470f490788956feedf247d669f88bb8 | |
| parent | 6d7b31ad8d340ec237b07664070ef325ea6314a4 (diff) | |
| download | luarocks-abf7a9d408ed279a98287dad020afee88dcc68cc.tar.gz luarocks-abf7a9d408ed279a98287dad020afee88dcc68cc.tar.bz2 luarocks-abf7a9d408ed279a98287dad020afee88dcc68cc.zip | |
Add OpenBSD support
| -rw-r--r-- | src/luarocks/cfg.lua | 9 | ||||
| -rw-r--r-- | src/luarocks/fs/unix/tools.lua | 13 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index d141bdee..2385d665 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
| @@ -64,6 +64,10 @@ if system == "FreeBSD" then | |||
| 64 | detected.unix = true | 64 | detected.unix = true |
| 65 | detected.freebsd = true | 65 | detected.freebsd = true |
| 66 | detected.bsd = true | 66 | detected.bsd = true |
| 67 | elseif system == "OpenBSD" then | ||
| 68 | detected.unix = true | ||
| 69 | detected.openbsd = true | ||
| 70 | detected.bsd = true | ||
| 67 | elseif system == "Darwin" then | 71 | elseif system == "Darwin" then |
| 68 | detected.unix = true | 72 | detected.unix = true |
| 69 | detected.macosx = true | 73 | detected.macosx = true |
| @@ -289,6 +293,11 @@ if detected.freebsd then | |||
| 289 | defaults.variables.LIBFLAG = "-shared" | 293 | defaults.variables.LIBFLAG = "-shared" |
| 290 | end | 294 | end |
| 291 | 295 | ||
| 296 | if detected.openbsd then | ||
| 297 | defaults.arch = "openbsd-"..proc | ||
| 298 | defaults.platforms = {"unix", "bsd", "openbsd"} | ||
| 299 | end | ||
| 300 | |||
| 292 | -- Expose some more values detected by LuaRocks for use by rockspec authors. | 301 | -- Expose some more values detected by LuaRocks for use by rockspec authors. |
| 293 | defaults.variables.LUA = defaults.lua_interpreter | 302 | defaults.variables.LUA = defaults.lua_interpreter |
| 294 | defaults.variables.LIB_EXTENSION = defaults.lib_extension | 303 | defaults.variables.LIB_EXTENSION = defaults.lib_extension |
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index bb7e48db..c805fb48 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua | |||
| @@ -350,7 +350,18 @@ end | |||
| 350 | 350 | ||
| 351 | function get_permissions(filename) | 351 | function get_permissions(filename) |
| 352 | local ret | 352 | local ret |
| 353 | local flag = cfg.is_platform("bsd") and "-f '%A'" or "-c '%a'" | 353 | |
| 354 | local flag | ||
| 355 | if cfg.is_platform("bsd") then | ||
| 356 | if cfg.is_platform("openbsd") then | ||
| 357 | flag = "-f '%Op'" | ||
| 358 | else | ||
| 359 | flag = "-f '%A'" | ||
| 360 | end | ||
| 361 | else | ||
| 362 | flag = "-c '%a'" | ||
| 363 | end | ||
| 364 | |||
| 354 | local pipe = io.popen("stat "..flag.." "..fs.Q(filename)) | 365 | local pipe = io.popen("stat "..flag.." "..fs.Q(filename)) |
| 355 | ret = pipe:read("*l") | 366 | ret = pipe:read("*l") |
| 356 | pipe:close() | 367 | pipe:close() |
