Here's a patch:

--- a/src/luarocks/path.lua
+++ b/src/luarocks/path.lua
@@ -309,7 +309,7 @@ end
 -- @return boolean This function always succeeds.
 function run(...)
    util.printout(cfg.export_lua_path:format(package.path))
-   util.printout(cfg.export_lua_cpath:format(package.path))
+   util.printout(cfg.export_lua_cpath:format(package.cpath))
    return true
 end


I experienced the problem on doing this:

  $ eval `./luarocks path`
  $ lua -lmd5
  lua: error loading module 'md5.core' from file
'/home/username/luarocks//share/lua/5.1//md5.lua':
        /home/username/luarocks//share/lua/5.1//md5.lua: invalid ELF header


BTW, I think there should be some comment about "luarocks path" and
also "eval `./luarocks path`" printed at the end of `make install`.
The instructions [1] don't even mention "luarocks path" either.  I
needed to do some digging on both of these.  I think it would also be
nice to have some simple ways to setup the paths from within Lua; for
example:

   $ lua
   Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
   > dofile '~/luarocks/etc/luarocks/initialize.lua`
   > require 'md5'

   $ LUA_INIT=@~/luarocks/etc/luarocks/initialize.lua lua -lmd5
   Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
   >

[1] http://luarocks.org/en/Installation_instructions_for_Unix

------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Luarocks-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to