Commit ec6d9f26 authored by Hugo Roenick's avatar Hugo Roenick

[OPENBUS-2185] Adaptacao do codigo das dependencias (bibliotecas Lua) para...

[OPENBUS-2185] Adaptacao do codigo das dependencias (bibliotecas Lua) para serem compativeis tambem com Lua 5.2
 - realizando a conversao do sdk-lua para Lua5.2
 


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/branches/02_00_00@146885 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 3c46813d
local table = table
local unpack = table.unpack or unpack
local log = require "openbus.util.logger"
local openbus = require "openbus"
......
......@@ -8,6 +8,7 @@ local pcall = _G.pcall
local rawget = _G.rawget
local setmetatable = _G.setmetatable
local tostring = _G.tostring
local unpack = _G.table.unpack or _G.unpack
local coroutine = require "coroutine"
local running = coroutine.running
......@@ -77,6 +78,7 @@ local unmarshalCredential = BaseInterceptor.unmarshalCredential
-- must be loaded after OiL is loaded because OiL is the one that installs
-- the cothread plug-in that supports the 'now' operation.
cothread.plugin(require "cothread.plugin.sleep")
local delay = cothread.delay
local time = cothread.now
......
......@@ -4,7 +4,7 @@ local pairs = _G.pairs
local pcall = _G.pcall
local rawget = _G.rawget
local setmetatable = _G.setmetatable
local unpack = _G.unpack
local unpack = _G.table.unpack or _G.unpack
local coroutine = require "coroutine"
local running = coroutine.running
......
local _G = require "_G"
local error = _G.error
local ipairs = _G.ipairs
local array = require "table"
......
local _G = require "_G"
local ipairs = _G.ipairs
local unpack = _G.unpack
local array = require "table"
local unpack = array.unpack or _G.unpack
local makeaux = require "openbus.core.idl.makeaux"
local parsed = require "openbus.core.legacy.parsed"
......
local _G = require "_G"
local error = _G.error
local ipairs = _G.ipairs
local array = require "table"
......
PROJNAME= busconsole
APPNAME= $(PROJNAME)
USE_LUA51= YES
OPENBUSINC= ${OPENBUS_HOME}/include
OPENBUSLIB= ${OPENBUS_HOME}/lib
SRC= console.c
ifdef USE_LUA52
SRC= console.c
else
SRC= consoleLua51.c
endif
LIBS:= lce luuid lfs luavararg luastruct luasocket loop luatuple \
luacoroutine luacothread luainspector luaidl oil luascs luaopenbus lua5.1
luacoroutine luacothread luainspector luaidl oil luascs luaopenbus
INCLUDES+= . $(SRCLUADIR) \
$(OPENBUSINC)/luuid \
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,7 +5,6 @@ local ipairs = _G.ipairs
local pairs = _G.pairs
local pcall = _G.pcall
local type = _G.type
local unpack = _G.unpack
local coroutine = require "coroutine"
local string = require "string"
local io = require "io"
......
......@@ -5,7 +5,6 @@ local ipairs = _G.ipairs
local pairs = _G.pairs
local pcall = _G.pcall
local type = _G.type
local unpack = _G.unpack
local coroutine = require "coroutine"
local string = require "string"
local io = require "io"
......
......@@ -5,7 +5,6 @@ local ipairs = _G.ipairs
local pairs = _G.pairs
local pcall = _G.pcall
local type = _G.type
local unpack = _G.unpack
local coroutine = require "coroutine"
local string = require "string"
local io = require "io"
......
......@@ -49,11 +49,11 @@ do
end
do
assert(os.execute("chmod 000 test.db") == 0)
assert(os.execute("chmod 000 test.db"))
local ok, err = pcall(database.open, "test.db")
assert(ok == false)
assert(err:find("cannot open test.db/: Permission denied", 1, true))
assert(os.execute("chmod 755 test.db") == 0)
assert(os.execute("chmod 755 test.db"))
local db = assert(database.open("test.db"))
assert(io.open("test.db/ErrorTable", "w")):close()
......@@ -77,7 +77,7 @@ do
local db = assert(database.open("test.db"))
local table = assert(db:gettable("Table"))
local file = assert(io.open("test.db/Table/error.lua", "w"))
assert(file:write("illegal Lua code") == true)
assert(file:write("illegal Lua code"))
file:close()
local entry, err = table:getentry("missing")
......@@ -86,9 +86,9 @@ do
local entry, err = table:getentry("error")
assert(entry == nil)
assert(err == "unable to load file 'test.db/Table/error.lua' (test.db/Table/error.lua:1: '=' expected near 'Lua')")
assert(type(err) == "string")
assert(os.execute("chmod 000 test.db/Table") == 0)
assert(os.execute("chmod 000 test.db/Table"))
local entry, err = table:getentry("error")
assert(entry == nil)
......@@ -102,14 +102,14 @@ do
assert(not ok)
assert(err:match("unable to remove file 'test%.db/Table/error%.lua' %(.-: Permission denied%)"))
assert(os.execute("chmod 755 test.db/Table") == 0)
assert(os.execute("chmod 555 test.db") == 0)
assert(os.execute("chmod 755 test.db/Table"))
assert(os.execute("chmod 555 test.db"))
local ok, err = table:remove()
assert(not ok)
assert(err == "unable to remove directory 'test.db/Table/' (Permission denied)")
assert(os.execute("chmod 755 test.db") == 0)
assert(os.execute("chmod 755 test.db"))
assert(table:remove())
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment