From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 51FAA4696C3 for ; Thu, 2 Apr 2020 12:58:56 +0300 (MSK) References: <00ad585a2a6163d6ca21f3477d4c864841ccdc26.1585168251.git.lvasiliev@tarantool.org> From: lvasiliev Message-ID: Date: Thu, 2 Apr 2020 12:58:55 +0300 MIME-Version: 1.0 In-Reply-To: <00ad585a2a6163d6ca21f3477d4c864841ccdc26.1585168251.git.lvasiliev@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 1/3] 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 Cc: tarantool-patches@dev.tarantool.org diff --git a/src/luarocks/cmd/make.lua b/src/luarocks/cmd/make.lua index dc70d49..660c3fe 100644 --- a/src/luarocks/cmd/make.lua +++ b/src/luarocks/cmd/make.lua @@ -70,6 +70,13 @@ only dependencies of the rockspec (see `tarantoolctl rocks 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() @@ -80,13 +87,6 @@ function make.command(flags, rockspec_filename) if not rockspec_filename:match("rockspec$") then return nil, "Invalid argument: 'make' takes a rockspec as a parameter. "..util.see_help("make") end - - if flags["chdir"] then - local ok, err = fs.change_dir(flags["chdir"]) - if not ok then - return nil, err - end - end local rockspec, err, errcode = fetch.load_rockspec(rockspec_filename) if not rockspec then On 26.03.2020 0:50, Leonid Vasiliev wrote: > --- > src/luarocks/cmd/make.lua | 9 +++++++++ > src/luarocks/util.lua | 1 + > 2 files changed, 10 insertions(+) > > diff --git a/src/luarocks/cmd/make.lua b/src/luarocks/cmd/make.lua > index 4d81386..025ac11 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. > @@ -79,6 +81,13 @@ function make.command(flags, rockspec_filename) > return nil, "Invalid argument: 'make' takes a rockspec as a parameter. "..util.see_help("make") > end > > + if flags["chdir"] then > + local ok, err = fs.change_dir(flags["chdir"]) > + if not ok then > + return nil, err > + end > + end > + > local rockspec, err, errcode = fetch.load_rockspec(rockspec_filename) > if not rockspec then > return nil, err > 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"] = "", >