Skip to content

Commit

Permalink
Install site_config.lua after Makefile calls luarocks.
Browse files Browse the repository at this point in the history
Otherwise, when luarocks removes a previous version it may
end up deleting the site_config.lua file that was freshly
installed. Closes #625.
  • Loading branch information
hishamhm committed Oct 6, 2016
1 parent 1dc76db commit ccfcd97
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Expand Up @@ -2,7 +2,8 @@
include config.unix

.PHONY: all build dev build_bins luadoc check_makefile cleanup_bins clean \
install_site_config write_sysconfig install bootstrap install_rock
install_site_config write_sysconfig install bootstrap install_rock \
run_luarocks

ROCKS_TREE ?= $(PREFIX)
SYSCONFDIR ?= $(PREFIX)/etc/luarocks
Expand Down Expand Up @@ -124,6 +125,9 @@ cleanup_bins:
clean: cleanup_bins
rm -f src/luarocks/site_config.lua

run_luarocks:
'$(LUA_BINDIR)/lua$(LUA_SUFFIX)' -e "package.path=[[$(SAFEPWD)/src/?.lua;]]..package.path" src/bin/luarocks make rockspec --tree="$(PREFIX)"

install_site_config: src/luarocks/site_config.lua
mkdir -p "$(DESTDIR)$(LUADIR)/luarocks"
cp src/luarocks/site_config.lua "$(DESTDIR)$(LUADIR)/luarocks"
Expand All @@ -144,8 +148,7 @@ write_sysconfig:

install: install_bins install_luas install_site_config write_sysconfig

bootstrap: src/luarocks/site_config.lua install_site_config write_sysconfig cleanup_bins
'$(LUA_BINDIR)/lua$(LUA_SUFFIX)' -e "package.path=[[$(SAFEPWD)/src/?.lua;]]..package.path" src/bin/luarocks make rockspec --tree="$(PREFIX)"
bootstrap: src/luarocks/site_config.lua run_luarocks install_site_config write_sysconfig cleanup_bins

install_rock: install_bins install_luas

0 comments on commit ccfcd97

Please sign in to comment.