From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D35BC4696C3 for ; Mon, 13 Apr 2020 16:09:57 +0300 (MSK) From: Leonid Vasiliev Date: Mon, 13 Apr 2020 16:09:55 +0300 Message-Id: <8e8db7f255a855c585245c288414ceb097576e07.1586783231.git.lvasiliev@tarantool.org> Subject: [Tarantool-patches] [PATCH V4] Add the chdir option for make List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: v.shpilevoy@tarantool.org, yaroslav.dynnikov@tarantool.org Cc: tarantool-patches@dev.tarantool.org Flag --chdir for make command (with help) has been added. It's add possibility to specify a source directory of the rock when make. --- https://github.com/tarantool/tarantool/issues/4629 https://github.com/tarantool/luarocks/tree/lvasiliev/gh-4629-add-chdir-to-make See corresponding patch for tarantoolctl (https://github.com/tarantool/tarantool/tree/lvasiliev/gh-4629-forward-flags) Motivation: Imperfect integretion of the Luarocks to tarantoolctl (enable some commands) Was done: whitelist of tarantoolctl don't used for luarocks flags Option chdir has been moved from tarantoolctl to luarocks @ChangeLog - see a comment in tarantool src/luarocks/cmd/make.lua | 8 ++++++++ src/luarocks/util.lua | 1 + 2 files changed, 9 insertions(+) diff --git a/src/luarocks/cmd/make.lua b/src/luarocks/cmd/make.lua index 4d81386..015b01d 100644 --- a/src/luarocks/cmd/make.lua +++ b/src/luarocks/cmd/make.lua @@ -59,6 +59,8 @@ only dependencies of the rockspec (see `luarocks help install`). --sign To be used with --pack-binary-rock. Also produce a signature file for the generated .rock file. +--chdir= Specify a source directory of the rock. + ]] --- Driver function for "make" command. @@ -68,6 +70,12 @@ only dependencies of the rockspec (see `luarocks help install`). function make.command(flags, rockspec_filename) assert(type(rockspec_filename) == "string" or not rockspec_filename) + if flags["chdir"] then + local ok, err = fs.change_dir(flags["chdir"]) + if not ok then + return nil, err + end + end if not rockspec_filename then local err rockspec_filename, err = util.get_default_rockspec() diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index abf6d90..8ccda27 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua @@ -92,6 +92,7 @@ local supported_flags = { ["binary"] = true, ["branch"] = "", ["build-deps"] = true, + ["chdir"] = "", ["debug"] = true, ["deps"] = true, ["deps-mode"] = "", -- 2.7.4