From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (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 4221F4696C3 for ; Mon, 13 Apr 2020 16:24:40 +0300 (MSK) Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1jNz4p-0000SU-LD for tarantool-patches@dev.tarantool.org; Mon, 13 Apr 2020 16:24:39 +0300 Received: by mail-lf1-f44.google.com with SMTP id t11so6499902lfe.4 for ; Mon, 13 Apr 2020 06:24:39 -0700 (PDT) MIME-Version: 1.0 References: <8e8db7f255a855c585245c288414ceb097576e07.1586783231.git.lvasiliev@tarantool.org> In-Reply-To: <8e8db7f255a855c585245c288414ceb097576e07.1586783231.git.lvasiliev@tarantool.org> From: Yaroslav Dynnikov Date: Mon, 13 Apr 2020 16:24:28 +0300 Message-ID: Content-Type: multipart/alternative; boundary="0000000000004e57c905a32c01b5" Subject: Re: [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: Leonid Vasiliev Cc: Yaroslav Dynnikov , tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy --0000000000004e57c905a32c01b5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Leonid. Thanks for your patch, LGTM. On Mon, 13 Apr 2020 at 16:09, Leonid Vasiliev wrote: > 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-fla= gs > ) > > 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=3D 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) =3D=3D "string" or not rockspec_filena= me) > > + if flags["chdir"] then > + local ok, err =3D fs.change_dir(flags["chdir"]) > + if not ok then > + return nil, err > + end > + end > if not rockspec_filename then > local err > rockspec_filename, err =3D 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 =3D { > ["binary"] =3D true, > ["branch"] =3D "", > ["build-deps"] =3D true, > + ["chdir"] =3D "", > ["debug"] =3D true, > ["deps"] =3D true, > ["deps-mode"] =3D "", > -- > 2.7.4 > > --=20 =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC. =D0=94=D1=8B=D0=BD=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2 =D0=AF=D1=80=D0=BE=D1=81= =D0=BB=D0=B0=D0=B2. --0000000000004e57c905a32c01b5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, Leonid.

Thanks for your = patch, LGTM.

On Mon, 13 Apr 2020 at 16:09, Leonid Vasiliev <lvasiliev@tarantool.org> wro= te:
Flag --chdir= for make command (with help) has been added.
It's add possibility to specify a source directory of the rock when mak= e.
---

https://github.com/tarantool/tarantool/issues/4629=
https://github.com/tar= antool/luarocks/tree/lvasiliev/gh-4629-add-chdir-to-make
See corresponding patch for tarantoolctl
(https://github.com/taran= tool/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

=C2=A0src/luarocks/cmd/make.lua | 8 ++++++++
=C2=A0src/luarocks/util.lua=C2=A0 =C2=A0 =C2=A0| 1 +
=C2=A02 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 ins= tall`).
=C2=A0--sign=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 To be used wit= h --pack-binary-rock. Also produce
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0a signature file for the generated .rock file.

+--chdir=3D<path>=C2=A0 =C2=A0 =C2=A0 Specify a source directory of t= he rock.
+
=C2=A0]]

=C2=A0--- Driver function for "make" command.
@@ -68,6 +70,12 @@ only dependencies of the rockspec (see `luarocks help in= stall`).
=C2=A0function make.command(flags, rockspec_filename)
=C2=A0 =C2=A0 assert(type(rockspec_filename) =3D=3D "string" or n= ot rockspec_filename)

+=C2=A0 =C2=A0if flags["chdir"] then
+=C2=A0 =C2=A0 =C2=A0 local ok, err =3D fs.change_dir(flags["chdir&quo= t;])
+=C2=A0 =C2=A0 =C2=A0 if not ok then
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return nil, err
+=C2=A0 =C2=A0 =C2=A0 end
+=C2=A0 =C2=A0end
=C2=A0 =C2=A0 if not rockspec_filename then
=C2=A0 =C2=A0 =C2=A0 =C2=A0local err
=C2=A0 =C2=A0 =C2=A0 =C2=A0rockspec_filename, err =3D util.get_default_rock= spec()
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 =3D {
=C2=A0 =C2=A0 ["binary"] =3D true,
=C2=A0 =C2=A0 ["branch"] =3D "<branch-name>",
=C2=A0 =C2=A0 ["build-deps"] =3D true,
+=C2=A0 =C2=A0["chdir"] =3D "<path>",
=C2=A0 =C2=A0 ["debug"] =3D true,
=C2=A0 =C2=A0 ["deps"] =3D true,
=C2=A0 =C2=A0 ["deps-mode"] =3D "<mode>",
--
2.7.4



--
=D0=A1 =D1=83= =D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC.=C2=A0
=D0=94=D1=8B=D0= =BD=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2 =D0=AF=D1=80=D0=BE=D1=81=D0=BB=D0=B0=D0= =B2.
--0000000000004e57c905a32c01b5--