Skip to content

Commit

Permalink
Bug fix---don't rely upon print() in Makefile
Browse files Browse the repository at this point in the history
From the Lua mailing list:

> Better would be
>
> LUA_VERSION = $(shell $(LUA) -E -e "print (_VERSION:match '^Lua (.*)')")
>
> or maybe (because 5.1 doesn't have -E)
>
> LUA_VERSION = $(shell $(LUA) -e
> "io.stdout:write(string.match(_VERSION,'^Lua (.*)'),'\n')")
>
>
> LUA_INIT (if defined and not disabled by -E) runs first and can
> add/remove/replace a lot of things.  Don't depend on print producing
> "dumb" output if there's LUA_INIT.  (The Lua REPL uses whatever _G.print
> is to output results, so my 'print' colors values by types, adds metatable
> info etc.  etc.  - resulting in some really funky directory names if used
> like that!)
>
> -- nobody (probably not the only one with a colorful REPL)
  • Loading branch information
spc476 committed Dec 3, 2016
1 parent 809a762 commit f9a1941
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ override CFLAGS += -DVERSION='"$(VERSION)"'
# ===================================================

LUA = lua
LUA_VERSION = $(shell $(LUA) -e "print (_VERSION:match '^Lua (.*)')")
LUA_VERSION = $(shell $(LUA) -e "io.stdout:write(_VERSION:match '^Lua (.*)','\n')")
LIBDIR = $(LUA_DIR)/lib/lua/$(LUA_VERSION)
LUADIR = $(LUA_DIR)/share/lua/$(LUA_VERSION)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package = "org.conman.cbor"
version = "1.2.1-2"
version = "1.2.2-1"

source =
{
Expand Down

0 comments on commit f9a1941

Please sign in to comment.