aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2019-04-09 16:47:59 -0300
committerHisham Muhammad <hisham@gobolinux.org>2019-04-09 16:49:20 -0300
commitbeb38fee0086a53e075f2db32e2321ba4c76e71b (patch)
treedae5025e29994d1f7c57820ce456c8d686495d00 /src
parent0b6f834fecd36d4b4b10a1245e54be00f9aaf75b (diff)
downloadluarocks-beb38fee0086a53e075f2db32e2321ba4c76e71b.tar.gz
luarocks-beb38fee0086a53e075f2db32e2321ba4c76e71b.tar.bz2
luarocks-beb38fee0086a53e075f2db32e2321ba4c76e71b.zip
make: use a lockfile for patching on first `luarocks make` run
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/build.lua21
1 files changed, 17 insertions, 4 deletions
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
43 function build.apply_patches(rockspec) 43 function build.apply_patches(rockspec)
44 assert(rockspec:type() == "rockspec") 44 assert(rockspec:type() == "rockspec")
45 45
46 if not (rockspec.build.extra_files or rockspec.build.patches) then
47 return true
48 end
49
50 local fd = io.open(".luarocks.patches.applied", "r")
51 if fd then
52 fd:close()
53 return true
54 end
55
46 if rockspec.build.extra_files then 56 if rockspec.build.extra_files then
47 extract_from_rockspec(rockspec.build.extra_files) 57 extract_from_rockspec(rockspec.build.extra_files)
48 end 58 end
@@ -57,6 +67,11 @@ do
57 end 67 end
58 end 68 end
59 end 69 end
70
71 fd = io.open(".luarocks.patches.applied", "w")
72 if fd then
73 fd:close()
74 end
60 return true 75 return true
61 end 76 end
62end 77end
@@ -374,10 +389,8 @@ function build.build_rockspec(rockspec, opts)
374 fs.remove_dir_if_empty(path.versions_dir(name)) 389 fs.remove_dir_if_empty(path.versions_dir(name))
375 end) 390 end)
376 391
377 if not opts.minimal_mode then 392 ok, err = build.apply_patches(rockspec)
378 local ok, err = build.apply_patches(rockspec) 393 if not ok then return nil, err end
379 if not ok then return nil, err end
380 end
381 394
382 ok, err = check_macosx_deployment_target(rockspec) 395 ok, err = check_macosx_deployment_target(rockspec)
383 if not ok then return nil, err end 396 if not ok then return nil, err end