From beb38fee0086a53e075f2db32e2321ba4c76e71b Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 9 Apr 2019 16:47:59 -0300 Subject: make: use a lockfile for patching on first `luarocks make` run --- src/luarocks/build.lua | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index 14d699e5..f104c400 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua @@ -43,6 +43,16 @@ do function build.apply_patches(rockspec) assert(rockspec:type() == "rockspec") + if not (rockspec.build.extra_files or rockspec.build.patches) then + return true + end + + local fd = io.open(".luarocks.patches.applied", "r") + if fd then + fd:close() + return true + end + if rockspec.build.extra_files then extract_from_rockspec(rockspec.build.extra_files) end @@ -57,6 +67,11 @@ do end end end + + fd = io.open(".luarocks.patches.applied", "w") + if fd then + fd:close() + end return true end end @@ -374,10 +389,8 @@ function build.build_rockspec(rockspec, opts) fs.remove_dir_if_empty(path.versions_dir(name)) end) - if not opts.minimal_mode then - local ok, err = build.apply_patches(rockspec) - if not ok then return nil, err end - end + ok, err = build.apply_patches(rockspec) + if not ok then return nil, err end ok, err = check_macosx_deployment_target(rockspec) if not ok then return nil, err end -- cgit v1.2.3-55-g6feb