From e3203adbc3f5daa5f46097d3439edbada01807f3 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 22 Sep 2015 13:38:52 -0300 Subject: add set_time function for tar module without lfs --- src/luarocks/cfg.lua | 1 + src/luarocks/fs/unix/tools.lua | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 31b3211a..1b4923ab 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -349,6 +349,7 @@ local defaults = { OPENSSL = "openssl", MD5 = "md5", STAT = "stat", + TOUCH = "touch", CMAKE = "cmake", SEVENZ = "7z", diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index 150a5ff8..442004ce 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua @@ -346,4 +346,9 @@ function tools.browser(url) return fs.execute(cfg.web_browser, url) end +function tools.set_time(file, time) + file = dir.normalize(file) + return fs.execute(vars.TOUCH, "-d", "@"..tostring(time), file) +end + return tools -- cgit v1.2.3-55-g6feb