diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2015-07-02 14:58:57 +0200 |
|---|---|---|
| committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2015-07-02 14:58:57 +0200 |
| commit | e26e7a19adb663291ec87b859c26094d7d2c69fc (patch) | |
| tree | 8e27990a1ed56256a97f3331e73d5ba0d579566e | |
| parent | 6ca144cee96ef45d6a203455b236e4077dd37a03 (diff) | |
| download | luarocks-e26e7a19adb663291ec87b859c26094d7d2c69fc.tar.gz luarocks-e26e7a19adb663291ec87b859c26094d7d2c69fc.tar.bz2 luarocks-e26e7a19adb663291ec87b859c26094d7d2c69fc.zip | |
also version the `site_config` file
| -rw-r--r-- | install.bat | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/install.bat b/install.bat index ec20e4dc..5913d3ab 100644 --- a/install.bat +++ b/install.bat | |||
| @@ -794,10 +794,11 @@ print() | |||
| 794 | print("Configuring LuaRocks...") | 794 | print("Configuring LuaRocks...") |
| 795 | 795 | ||
| 796 | -- Create a site-config file | 796 | -- Create a site-config file |
| 797 | if exists(S[[$LUADIR\luarocks\site_config.lua]]) then | 797 | local site_config = S("site_config_$LUA_VERSION"):gsub("%.","_") |
| 798 | exec(S[[RENAME "$LUADIR\luarocks\site_config.lua" site_config.lua.bak]]) | 798 | if exists(S([[$LUADIR\luarocks\]]..site_config..[[.lua]])) then |
| 799 | exec(S([[RENAME "$LUADIR\luarocks\]]..site_config..[[.lua" site_config.lua.bak]])) | ||
| 799 | end | 800 | end |
| 800 | local f = io.open(vars.LUADIR.."\\luarocks\\site_config.lua", "w") | 801 | local f = io.open(vars.LUADIR.."\\luarocks\\"..site_config..".lua", "w") |
| 801 | f:write(S[=[ | 802 | f:write(S[=[ |
| 802 | local site_config = {} | 803 | local site_config = {} |
| 803 | site_config.LUA_INCDIR=[[$LUA_INCDIR]] | 804 | site_config.LUA_INCDIR=[[$LUA_INCDIR]] |
| @@ -821,16 +822,16 @@ site_config.LUAROCKS_MD5CHECKER=[[md5sum]] | |||
| 821 | if FORCE_CONFIG then | 822 | if FORCE_CONFIG then |
| 822 | f:write("site_config.LUAROCKS_FORCE_CONFIG=true\n") | 823 | f:write("site_config.LUAROCKS_FORCE_CONFIG=true\n") |
| 823 | end | 824 | end |
| 824 | if exists(vars.LUADIR.."\\luarocks\\site_config.lua.bak") then | 825 | if exists(vars.LUADIR.."\\luarocks\\"..site_config..".lua.bak") then |
| 825 | for line in io.lines(vars.LUADIR.."\\luarocks\\site_config.lua.bak", "r") do | 826 | for line in io.lines(vars.LUADIR.."\\luarocks\\"..site_config..".lua.bak", "r") do |
| 826 | f:write(line) | 827 | f:write(line) |
| 827 | f:write("\n") | 828 | f:write("\n") |
| 828 | end | 829 | end |
| 829 | exec(S[[DEL /F /Q "$LUADIR\luarocks\site_config.lua.bak"]]) | 830 | exec(S([[DEL /F /Q "$LUADIR\luarocks\]]..site_config..[[.lua.bak"]])) |
| 830 | end | 831 | end |
| 831 | f:write("return site_config\n") | 832 | f:write("return site_config\n") |
| 832 | f:close() | 833 | f:close() |
| 833 | print(S[[Created LuaRocks site-config file: $LUADIR\luarocks\site_config.lua]]) | 834 | print(S([[Created LuaRocks site-config file: $LUADIR\luarocks\]]..site_config..[[.lua]])) |
| 834 | 835 | ||
| 835 | -- create config file | 836 | -- create config file |
| 836 | vars.CONFIG_FILE = vars.SYSCONFDIR.."\\"..vars.SYSCONFFILENAME | 837 | vars.CONFIG_FILE = vars.SYSCONFDIR.."\\"..vars.SYSCONFFILENAME |
