lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks for the detailed analysis. You're right about the missing `S` call. It's also still in the current master branch.

Will push a change there, will be fixed in the next release.

Thanks again for your work!

regards
Thijs

________________________________________
From: lua-l-bounces@lists.lua.org [lua-l-bounces@lists.lua.org] on behalf of 书呆彭, Peng Yi [nerditation@outlook.com]
Sent: 25 December 2015 05:20
To: lua-l@lists.lua.org
Subject: Re: luarocks config problem on Windows

在 2015/12/25 11:52, Jonathan Goble 写道:
> On Thu, Dec 24, 2015 at 10:46 PM, 书呆彭, Peng Yi <nerditation@outlook.com> wrote:
>>> site_config.LUAROCKS_SYSCONFIG=[[$CONFIG_FILE]]
>> apparently the CONFIG_FILE variable is not expanded properly while
>> generating site_config.lua
>> I am not very familiar with how luarocks works, could someone please check
>> that out?
> Windows batch files don't use $var for variable expansion. The proper
> syntax is %var% (here, %CONFIG_FILE%).
>

actually the variable is not expanded by the cmd shell, it is expanded by the
installer script itself. the installer script is a lua script using some shell
commentary trick to run as a batch file.

I think the the script at line 986 missed a `S' call which expands the variables.
below is the trivial fix.

======================= patch ===========================
@@ -983,7 +983,7 @@
      f:write("site_config.LUAROCKS_FORCE_CONFIG=true\n")
  end
  if vars.SYSCONFFORCE then  -- only write this value when explcitly given, otherwise rely on defaults
-    f:write(S"site_config.LUAROCKS_SYSCONFIG=[[$CONFIG_FILE]]\n")
+    f:write("site_config.LUAROCKS_SYSCONFIG=[[$CONFIG_FILE]]\n")
  end
  f:write("return site_config\n")
  f:close()
====================== end patch =========================

--
the nerdy Peng / 书呆彭 / Sent from Thunderbird