Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
@ 2020-04-05 14:49 Leonid Vasiliev
  2020-04-09  6:55 ` lvasiliev
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Leonid Vasiliev @ 2020-04-05 14:49 UTC (permalink / raw)
  To: v.shpilevoy; +Cc: tarantool-patches

From: Leonid <lvasiliev@tarantool.org>

The policy for check of luarocks flags has been changed (moved from tarantoolctl to luarocks).
We had a white-list of luarocks options in tarantoolctl before.
Now we have a black-list of options (for tarantool) in luarocks.
Help section has been updated.
Chdir has been moved to luarocks.

@TarantoolBot document
Title: Update tarantoolctl rocks
tarantoolctl rocks commands has been added:
build
config
download
init
lint
new_version
purge
which
write_rockspec

Closes #4629
---
https://github.com/tarantool/tarantool/issues/4629
https://github.com/tarantool/tarantool/tree/lvasiliev/gh-4629-forward-flags

Corresponding with https://github.com/tarantool/luarocks/tree/lvasiliev/gh-4629-add-chdir-to-make

@Changelog
Add tarantoolctl rocks commands: build config download init lint new_version purge which write_rockspec. Fix forwarding flags to luarocks. Help section has been updated.(gh-4629)

 extra/dist/tarantoolctl.in | 159 ++++++++-------------------------------------
 third_party/luarocks       |   2 +-
 2 files changed, 29 insertions(+), 132 deletions(-)

diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
index 6daf866..b34f655 100755
--- a/extra/dist/tarantoolctl.in
+++ b/extra/dist/tarantoolctl.in
@@ -21,7 +21,6 @@ ffi.cdef[[
 int kill(int pid, int sig);
 int isatty(int fd);
 int getppid(void);
-int chdir(const char *path);
 ]]
 
 local TIMEOUT_INFINITY = 100 * 365 * 86400
@@ -936,14 +935,6 @@ local function rocks()
     cfg.init()
     local util = require("luarocks.util")
     local command_line = require("luarocks.cmd")
-    local options = keyword_arguments
-    local key = nil
-    if options["only-server"] ~= nil then
-        key = find_arg("only%-server")
-    else
-        key = find_arg("server")
-    end
-    table.insert(positional_arguments, key)
 
     -- Tweak help messages
     util.see_help = function(command, program)
@@ -951,27 +942,36 @@ local function rocks()
         return "See Tarantool documentation for help."
     end
 
-    -- Enable only useful commands
+    -- Disabled: path, upload
     local rocks_commands = {
+        build = "luarocks.cmd.build",
+        config = "luarocks.cmd.config",
+        doc = "luarocks.cmd.doc",
+        download = "luarocks.cmd.download",
+        help = "luarocks.cmd.help",
+        init = "luarocks.cmd.init",
         install = "luarocks.cmd.install",
-        search = "luarocks.cmd.search",
+        lint = "luarocks.cmd.lint",
         list = "luarocks.cmd.list",
-        remove = "luarocks.cmd.remove",
-        show = "luarocks.cmd.show",
         make = "luarocks.cmd.make",
+        make_manifest = "luarocks.admin.cmd.make_manifest",
+        new_version = "luarocks.cmd.new_version",
         pack = "luarocks.cmd.pack",
-        unpack = "luarocks.cmd.unpack",
-        doc = "luarocks.cmd.doc",
-        help = "luarocks.cmd.help",
+        purge = "luarocks.cmd.purge",
+        remove = "luarocks.cmd.remove",
+        search = "luarocks.cmd.search",
+        show = "luarocks.cmd.show",
         test = "luarocks.cmd.test",
-        make_manifest = "luarocks.admin.cmd.make_manifest",
+        unpack = "luarocks.cmd.unpack",
+        which = "luarocks.cmd.which",
+        write_rockspec = "luarocks.cmd.write_rockspec",
     }
 
-    if keyword_arguments.chdir then
-        ffi.C.chdir(keyword_arguments.chdir)
-    end
-    -- Call LuaRocks
-    command_line.run_command('', rocks_commands, nil, unpack(positional_arguments))
+    -- Prepare arguments for luarocks.
+    shift_argv(lua_arguments, 0, 1)
+    -- Call LuaRocks.
+    command_line.run_command('LuaRocks main command-line interface',
+        rocks_commands, nil, unpack(lua_arguments))
 end
 
 local function exit_wrapper(func)
@@ -1186,117 +1186,14 @@ local commands = setmetatable({
     }, rocks = {
         func = exit_wrapper(rocks), process = process_remote, help = {
             header =
-                "%s rocks [install|make|remove|show|search|list|pack|unpack|doc|test|make_manifest|help]",
+                "%s rocks - package management",
             description =
 [=[
-        Package management.
+        See tarantoolctl rocks help
 ]=],
             weight = 100,
             deprecated = false,
         },
-        subcommands = {
-            install = {
-                weight = 100,
-                help = {
-                    header = "%s rocks install {<rock>|<name> [<version>]}",
-                    description = [=[
-        Install a rock.
-]=],
-                }
-            },
-            make = {
-                weight = 101,
-                help = {
-                    header = "%s rocks make [<rockspec>]",
-                    description = [=[
-        Compile package in current directory using a rockspec.
-]=],
-                }
-            },
-            remove = {
-                weight = 101,
-                help = {
-                    header = "%s rocks remove <name> [<version>]",
-                    description = [=[
-        Uninstall a rock.
-]=],
-                }
-            },
-            show = {
-                weight = 110,
-                help = {
-                    header = "%s rocks list <filter>",
-                    description = [=[
-        Show information about an installed rock
-]=],
-                }
-            },
-            search = {
-                weight = 120,
-                help = {
-                    header = "%s rocks search <name> [<version>]",
-                    description = [=[
-        Search the rocks list for a pattern.
-]=],
-                }
-            },
-            list = {
-                weight = 121,
-                help = {
-                    header = "%s rocks list <filter>",
-                    description = [=[
-        List all installed rocks.
-]=],
-                }
-            },
-            pack = {
-                weight = 131,
-                help = {
-                    header = "%s rocks pack {<rockspec>|<name> [<version>]}",
-                    description = [=[
-        Create a rock, packing sources or binaries.
-]=],
-                }
-            },
-            unpack = {
-                weight = 131,
-                help = {
-                    header = "%s rocks unpack {<rock>|<name> [<version>]}",
-                    description = [=[
-        Unpack the contents of a rock.
-]=],
-                }
-            },
-            test = {
-                weight = 141,
-                help = {
-                    header = "%s rocks test [<rockspec>]",
-                    description = [=[
-        Run the test suite in the current directory.
-]=],
-                }
-            },
-            doc = {
-                weight = 151,
-                help = {
-                    header = "%s rocks doc <rockname>",
-                    description = [=[
-        Show documentation for an installed rock.
-]=],
-                }
-            },
-            make_manifest = {
-                weight = 161,
-                help = {
-                    header = "%s rocks make_manifest <argument>",
-                    description = [=[
-        Compile a manifest file for a repository.
-
-        <argument>, if given, is a local repository pathname.
-]=],
-                }
-            },
-        }
     }
 }, {
     __index = function()
@@ -1396,9 +1293,6 @@ local function populate_arguments()
         { 'help',        'boolean' },
         { 'format',      'string'  },
         { 'replica',     'number+' },
-        { 'chdir',       'string'  },
-        { 'only-server', 'string'  },
-        { 'server',      'string'  },
         { 'language',    'string'  },
     })
 
@@ -1411,7 +1305,10 @@ local function populate_arguments()
 end
 
 local function main()
-    populate_arguments()
+    if command_name ~= 'rocks' then -- rocks parse arguments themselves
+        populate_arguments()
+    end
+
     local cmd_pair = commands[command_name]
     if #arg < 2 then
         log.error("Not enough arguments for '%s' command\n", command_name)
diff --git a/third_party/luarocks b/third_party/luarocks
index 06a657e..b778617 160000
--- a/third_party/luarocks
+++ b/third_party/luarocks
@@ -1 +1 @@
-Subproject commit 06a657e7a68dd475e2afb5a56012c43f3a906640
+Subproject commit b778617bfd07e4b8a34a20db113fb2a413d96e91
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
  2020-04-05 14:49 [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks Leonid Vasiliev
@ 2020-04-09  6:55 ` lvasiliev
  2020-04-10  0:00 ` Vladislav Shpilevoy
  2020-04-12 20:15 ` Vladislav Shpilevoy
  2 siblings, 0 replies; 9+ messages in thread
From: lvasiliev @ 2020-04-09  6:55 UTC (permalink / raw)
  To: v.shpilevoy; +Cc: tarantool-patches

According to 
https://lists.tarantool.org/pipermail/tarantool-patches/2020-April/015461.html 
next diff has been added:

diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
index b34f655..d8b904b 100755
--- a/extra/dist/tarantoolctl.in
+++ b/extra/dist/tarantoolctl.in
@@ -971,7 +971,7 @@ local function rocks()
      shift_argv(lua_arguments, 0, 1)
      -- Call LuaRocks.
      command_line.run_command('LuaRocks main command-line interface',
-        rocks_commands, nil, unpack(lua_arguments))
+                             rocks_commands, nil, unpack(lua_arguments))
  end

  local function exit_wrapper(func)
@@ -1186,14 +1186,20 @@ local commands = setmetatable({
      }, rocks = {
          func = exit_wrapper(rocks), process = process_remote, help = {
              header =
-                "%s rocks - package management",
+                "%s rocks [OPTIONS] COMMAND",
              description =
  [=[
-        See tarantoolctl rocks help
+        Tarantool package manager. To pack/unpack/install/remove
+        LuaRocks packages, and many more other actions. For more
+        information see
+
+            tarantoolctl rocks --help
  ]=],
              weight = 100,
              deprecated = false,
          },
+        -- LuaRocks parse arguments themselves
+        is_self_sufficient = true
      }
  }, {
      __index = function()
@@ -1305,11 +1311,15 @@ local function populate_arguments()
  end

  local function main()
-    if command_name ~= 'rocks' then -- rocks parse arguments themselves
+
+    local cmd_pair = commands[command_name]
+
+    -- Don't call populate arguments() for modules
+    -- that parse arguments themselves.
+    if not cmd_pair.is_self_sufficient then
          populate_arguments()
      end

-    local cmd_pair = commands[command_name]
      if #arg < 2 then
          log.error("Not enough arguments for '%s' command\n", command_name)
          usage(command_name)
diff --git a/third_party/luarocks b/third_party/luarocks
index b778617..1b51b2f 160000
--- a/third_party/luarocks
+++ b/third_party/luarocks
@@ -1 +1 @@
-Subproject commit b778617bfd07e4b8a34a20db113fb2a413d96e91
+Subproject commit 1b51b2fe1c194719a7a8a74220a954a91c21f2a7


On 05.04.2020 17:49, Leonid Vasiliev wrote:
> From: Leonid <lvasiliev@tarantool.org>
> 
> The policy for check of luarocks flags has been changed (moved from tarantoolctl to luarocks).
> We had a white-list of luarocks options in tarantoolctl before.
> Now we have a black-list of options (for tarantool) in luarocks.
> Help section has been updated.
> Chdir has been moved to luarocks.
> 
> @TarantoolBot document
> Title: Update tarantoolctl rocks
> tarantoolctl rocks commands has been added:
> build
> config
> download
> init
> lint
> new_version
> purge
> which
> write_rockspec
> 
> Closes #4629
> ---
> https://github.com/tarantool/tarantool/issues/4629
> https://github.com/tarantool/tarantool/tree/lvasiliev/gh-4629-forward-flags
> 
> Corresponding with https://github.com/tarantool/luarocks/tree/lvasiliev/gh-4629-add-chdir-to-make
> 
> @Changelog
> Add tarantoolctl rocks commands: build config download init lint new_version purge which write_rockspec. Fix forwarding flags to luarocks. Help section has been updated.(gh-4629)
> 
>   extra/dist/tarantoolctl.in | 159 ++++++++-------------------------------------
>   third_party/luarocks       |   2 +-
>   2 files changed, 29 insertions(+), 132 deletions(-)
> 
> diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
> index 6daf866..b34f655 100755
> --- a/extra/dist/tarantoolctl.in
> +++ b/extra/dist/tarantoolctl.in
> @@ -21,7 +21,6 @@ ffi.cdef[[
>   int kill(int pid, int sig);
>   int isatty(int fd);
>   int getppid(void);
> -int chdir(const char *path);
>   ]]
>   
>   local TIMEOUT_INFINITY = 100 * 365 * 86400
> @@ -936,14 +935,6 @@ local function rocks()
>       cfg.init()
>       local util = require("luarocks.util")
>       local command_line = require("luarocks.cmd")
> -    local options = keyword_arguments
> -    local key = nil
> -    if options["only-server"] ~= nil then
> -        key = find_arg("only%-server")
> -    else
> -        key = find_arg("server")
> -    end
> -    table.insert(positional_arguments, key)
>   
>       -- Tweak help messages
>       util.see_help = function(command, program)
> @@ -951,27 +942,36 @@ local function rocks()
>           return "See Tarantool documentation for help."
>       end
>   
> -    -- Enable only useful commands
> +    -- Disabled: path, upload
>       local rocks_commands = {
> +        build = "luarocks.cmd.build",
> +        config = "luarocks.cmd.config",
> +        doc = "luarocks.cmd.doc",
> +        download = "luarocks.cmd.download",
> +        help = "luarocks.cmd.help",
> +        init = "luarocks.cmd.init",
>           install = "luarocks.cmd.install",
> -        search = "luarocks.cmd.search",
> +        lint = "luarocks.cmd.lint",
>           list = "luarocks.cmd.list",
> -        remove = "luarocks.cmd.remove",
> -        show = "luarocks.cmd.show",
>           make = "luarocks.cmd.make",
> +        make_manifest = "luarocks.admin.cmd.make_manifest",
> +        new_version = "luarocks.cmd.new_version",
>           pack = "luarocks.cmd.pack",
> -        unpack = "luarocks.cmd.unpack",
> -        doc = "luarocks.cmd.doc",
> -        help = "luarocks.cmd.help",
> +        purge = "luarocks.cmd.purge",
> +        remove = "luarocks.cmd.remove",
> +        search = "luarocks.cmd.search",
> +        show = "luarocks.cmd.show",
>           test = "luarocks.cmd.test",
> -        make_manifest = "luarocks.admin.cmd.make_manifest",
> +        unpack = "luarocks.cmd.unpack",
> +        which = "luarocks.cmd.which",
> +        write_rockspec = "luarocks.cmd.write_rockspec",
>       }
>   
> -    if keyword_arguments.chdir then
> -        ffi.C.chdir(keyword_arguments.chdir)
> -    end
> -    -- Call LuaRocks
> -    command_line.run_command('', rocks_commands, nil, unpack(positional_arguments))
> +    -- Prepare arguments for luarocks.
> +    shift_argv(lua_arguments, 0, 1)
> +    -- Call LuaRocks.
> +    command_line.run_command('LuaRocks main command-line interface',
> +        rocks_commands, nil, unpack(lua_arguments))
>   end
>   
>   local function exit_wrapper(func)
> @@ -1186,117 +1186,14 @@ local commands = setmetatable({
>       }, rocks = {
>           func = exit_wrapper(rocks), process = process_remote, help = {
>               header =
> -                "%s rocks [install|make|remove|show|search|list|pack|unpack|doc|test|make_manifest|help]",
> +                "%s rocks - package management",
>               description =
>   [=[
> -        Package management.
> +        See tarantoolctl rocks help
>   ]=],
>               weight = 100,
>               deprecated = false,
>           },
> -        subcommands = {
> -            install = {
> -                weight = 100,
> -                help = {
> -                    header = "%s rocks install {<rock>|<name> [<version>]}",
> -                    description = [=[
> -        Install a rock.
> -]=],
> -                }
> -            },
> -            make = {
> -                weight = 101,
> -                help = {
> -                    header = "%s rocks make [<rockspec>]",
> -                    description = [=[
> -        Compile package in current directory using a rockspec.
> -]=],
> -                }
> -            },
> -            remove = {
> -                weight = 101,
> -                help = {
> -                    header = "%s rocks remove <name> [<version>]",
> -                    description = [=[
> -        Uninstall a rock.
> -]=],
> -                }
> -            },
> -            show = {
> -                weight = 110,
> -                help = {
> -                    header = "%s rocks list <filter>",
> -                    description = [=[
> -        Show information about an installed rock
> -]=],
> -                }
> -            },
> -            search = {
> -                weight = 120,
> -                help = {
> -                    header = "%s rocks search <name> [<version>]",
> -                    description = [=[
> -        Search the rocks list for a pattern.
> -]=],
> -                }
> -            },
> -            list = {
> -                weight = 121,
> -                help = {
> -                    header = "%s rocks list <filter>",
> -                    description = [=[
> -        List all installed rocks.
> -]=],
> -                }
> -            },
> -            pack = {
> -                weight = 131,
> -                help = {
> -                    header = "%s rocks pack {<rockspec>|<name> [<version>]}",
> -                    description = [=[
> -        Create a rock, packing sources or binaries.
> -]=],
> -                }
> -            },
> -            unpack = {
> -                weight = 131,
> -                help = {
> -                    header = "%s rocks unpack {<rock>|<name> [<version>]}",
> -                    description = [=[
> -        Unpack the contents of a rock.
> -]=],
> -                }
> -            },
> -            test = {
> -                weight = 141,
> -                help = {
> -                    header = "%s rocks test [<rockspec>]",
> -                    description = [=[
> -        Run the test suite in the current directory.
> -]=],
> -                }
> -            },
> -            doc = {
> -                weight = 151,
> -                help = {
> -                    header = "%s rocks doc <rockname>",
> -                    description = [=[
> -        Show documentation for an installed rock.
> -]=],
> -                }
> -            },
> -            make_manifest = {
> -                weight = 161,
> -                help = {
> -                    header = "%s rocks make_manifest <argument>",
> -                    description = [=[
> -        Compile a manifest file for a repository.
> -
> -        <argument>, if given, is a local repository pathname.
> -]=],
> -                }
> -            },
> -        }
>       }
>   }, {
>       __index = function()
> @@ -1396,9 +1293,6 @@ local function populate_arguments()
>           { 'help',        'boolean' },
>           { 'format',      'string'  },
>           { 'replica',     'number+' },
> -        { 'chdir',       'string'  },
> -        { 'only-server', 'string'  },
> -        { 'server',      'string'  },
>           { 'language',    'string'  },
>       })
>   
> @@ -1411,7 +1305,10 @@ local function populate_arguments()
>   end
>   
>   local function main()
> -    populate_arguments()
> +    if command_name ~= 'rocks' then -- rocks parse arguments themselves
> +        populate_arguments()
> +    end
> +
>       local cmd_pair = commands[command_name]
>       if #arg < 2 then
>           log.error("Not enough arguments for '%s' command\n", command_name)
> diff --git a/third_party/luarocks b/third_party/luarocks
> index 06a657e..b778617 160000
> --- a/third_party/luarocks
> +++ b/third_party/luarocks
> @@ -1 +1 @@
> -Subproject commit 06a657e7a68dd475e2afb5a56012c43f3a906640
> +Subproject commit b778617bfd07e4b8a34a20db113fb2a413d96e91
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
  2020-04-05 14:49 [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks Leonid Vasiliev
  2020-04-09  6:55 ` lvasiliev
@ 2020-04-10  0:00 ` Vladislav Shpilevoy
  2020-04-10  9:10   ` lvasiliev
  2020-04-12 20:15 ` Vladislav Shpilevoy
  2 siblings, 1 reply; 9+ messages in thread
From: Vladislav Shpilevoy @ 2020-04-10  0:00 UTC (permalink / raw)
  To: Leonid Vasiliev; +Cc: Yaroslav Dynnikov, tarantool-patches

Thanks for the patch!

I added Yaroslav to CC since he expressed a will to join the
review.

On 05/04/2020 16:49, Leonid Vasiliev wrote:
> From: Leonid <lvasiliev@tarantool.org>
> 
> The policy for check of luarocks flags has been changed (moved from tarantoolctl to luarocks).

Usually there is a high tolerance to too long commit
message lines, but this is outstanding. Please, try to
keep it in 80 symbols top, 66 best.

> We had a white-list of luarocks options in tarantoolctl before.
> Now we have a black-list of options (for tarantool) in luarocks.

We don't have a blacklist anymore, from what I see. The
not supported options were just removed from the options
parser.

> Help section has been updated.

It was not.

> @TarantoolBot document
> Title: Update tarantoolctl rocks
> tarantoolctl rocks commands has been added:
> build
> config
> download
> init
> lint
> new_version
> purge
> which
> write_rockspec

Where a technical writer should take documentation
on these commands? Their arguments, options? Probably
there is a link describing all of them?

> Closes #4629
> ---
> https://github.com/tarantool/tarantool/issues/4629
> https://github.com/tarantool/tarantool/tree/lvasiliev/gh-4629-forward-flags

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
  2020-04-10  0:00 ` Vladislav Shpilevoy
@ 2020-04-10  9:10   ` lvasiliev
  2020-04-11 14:11     ` Vladislav Shpilevoy
  0 siblings, 1 reply; 9+ messages in thread
From: lvasiliev @ 2020-04-10  9:10 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: Yaroslav Dynnikov, tarantool-patches

Hi.Thanks for the feedback.
I updated the comment.

commit 28a3b55fbc94c10b284201955e8030de75e03f3f
Author: Leonid <lvasiliev@tarantool.org>
Date:   Fri Nov 15 15:36:33 2019 +0300

     rocks: forward options to luarocks

     The policy for check of luarocks flags has been changed
     (moved from tarantoolctl to luarocks).
     Chdir has been moved to luarocks.
     Unsupported flags have been deleted from luarocks

     @TarantoolBot document
     Title: Update tarantoolctl rocks
     tarantoolctl rocks commands has been added:
     build
     config
     download
     init
     lint
     new_version
     purge
     which
     write_rockspec

     https://github.com/luarocks/luarocks/wiki/luarocks

     Closes #4629


On 10.04.2020 3:00, Vladislav Shpilevoy wrote:
> Thanks for the patch!
> 
> I added Yaroslav to CC since he expressed a will to join the
> review.
> 
> On 05/04/2020 16:49, Leonid Vasiliev wrote:
>> From: Leonid <lvasiliev@tarantool.org>
>>
>> The policy for check of luarocks flags has been changed (moved from tarantoolctl to luarocks).
> 
> Usually there is a high tolerance to too long commit
> message lines, but this is outstanding. Please, try to
> keep it in 80 symbols top, 66 best.
> 
>> We had a white-list of luarocks options in tarantoolctl before.
>> Now we have a black-list of options (for tarantool) in luarocks.
> 
> We don't have a blacklist anymore, from what I see. The
> not supported options were just removed from the options
> parser.
> 
>> Help section has been updated.
> 
> It was not.
> 
>> @TarantoolBot document
>> Title: Update tarantoolctl rocks
>> tarantoolctl rocks commands has been added:
>> build
>> config
>> download
>> init
>> lint
>> new_version
>> purge
>> which
>> write_rockspec
> 
> Where a technical writer should take documentation
> on these commands? Their arguments, options? Probably
> there is a link describing all of them?
> 
>> Closes #4629
>> ---
>> https://github.com/tarantool/tarantool/issues/4629
>> https://github.com/tarantool/tarantool/tree/lvasiliev/gh-4629-forward-flags

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
  2020-04-10  9:10   ` lvasiliev
@ 2020-04-11 14:11     ` Vladislav Shpilevoy
  2020-04-12 17:12       ` lvasiliev
  0 siblings, 1 reply; 9+ messages in thread
From: Vladislav Shpilevoy @ 2020-04-11 14:11 UTC (permalink / raw)
  To: lvasiliev; +Cc: Yaroslav Dynnikov, tarantool-patches

>     rocks: forward options to luarocks
> 
>     The policy for check of luarocks flags has been changed
>     (moved from tarantoolctl to luarocks).
>     Chdir has been moved to luarocks.
>     Unsupported flags have been deleted from luarocks
> 
>     @TarantoolBot document
>     Title: Update tarantoolctl rocks
>     tarantoolctl rocks commands has been added:
>     build
>     config
>     download
>     init
>     lint
>     new_version
>     purge
>     which
>     write_rockspec
> 
>     https://github.com/luarocks/luarocks/wiki/luarocks
> 
>     Closes #4629

Please, move 'Closes' out of the docbot request. Otherwise it
will end up in the doc ticket description. Sorry I didn't notice
it earlier.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
  2020-04-11 14:11     ` Vladislav Shpilevoy
@ 2020-04-12 17:12       ` lvasiliev
  2020-04-13 12:03         ` lvasiliev
  0 siblings, 1 reply; 9+ messages in thread
From: lvasiliev @ 2020-04-12 17:12 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: Yaroslav Dynnikov, tarantool-patches

Ok

commit 39fc7b43d6aad0f0c732ff8938515b8301adab40
Author: Leonid <lvasiliev@tarantool.org>
Date:   Fri Nov 15 15:36:33 2019 +0300

     rocks: forward options to luarocks

     The policy for check of luarocks flags has been changed
     (moved from tarantoolctl to luarocks).
     Chdir has been moved to luarocks.
     Unsupported flags have been deleted from luarocks

     Closes #4629

     @TarantoolBot document
     Title: Update tarantoolctl rocks
     tarantoolctl rocks commands has been added:
     build
     config
     download
     init
     lint
     new_version
     purge
     which
     write_rockspec

     https://github.com/luarocks/luarocks/wiki/luarocks


On 11.04.2020 17:11, Vladislav Shpilevoy wrote:
>>      rocks: forward options to luarocks
>>
>>      The policy for check of luarocks flags has been changed
>>      (moved from tarantoolctl to luarocks).
>>      Chdir has been moved to luarocks.
>>      Unsupported flags have been deleted from luarocks
>>
>>      @TarantoolBot document
>>      Title: Update tarantoolctl rocks
>>      tarantoolctl rocks commands has been added:
>>      build
>>      config
>>      download
>>      init
>>      lint
>>      new_version
>>      purge
>>      which
>>      write_rockspec
>>
>>      https://github.com/luarocks/luarocks/wiki/luarocks
>>
>>      Closes #4629
> 
> Please, move 'Closes' out of the docbot request. Otherwise it
> will end up in the doc ticket description. Sorry I didn't notice
> it earlier.
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
  2020-04-05 14:49 [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks Leonid Vasiliev
  2020-04-09  6:55 ` lvasiliev
  2020-04-10  0:00 ` Vladislav Shpilevoy
@ 2020-04-12 20:15 ` Vladislav Shpilevoy
  2 siblings, 0 replies; 9+ messages in thread
From: Vladislav Shpilevoy @ 2020-04-12 20:15 UTC (permalink / raw)
  To: Leonid Vasiliev; +Cc: tarantool-patches

Hi! Thanks for the fixes!

LGTM.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
  2020-04-12 17:12       ` lvasiliev
@ 2020-04-13 12:03         ` lvasiliev
  0 siblings, 0 replies; 9+ messages in thread
From: lvasiliev @ 2020-04-13 12:03 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: Yaroslav Dynnikov, tarantool-patches

Update comment and  commit after updating LuaRocks patchset.

diff --git a/third_party/luarocks b/third_party/luarocks
index 1b51b2f..8e8db7f 160000
--- a/third_party/luarocks
+++ b/third_party/luarocks
@@ -1 +1 @@
-Subproject commit 1b51b2fe1c194719a7a8a74220a954a91c21f2a7
+Subproject commit 8e8db7f255a855c585245c288414ceb097576e07


commit 47992ecebf83572b7b69000625ba7e2ccc92f7a6
Author: Leonid <lvasiliev@tarantool.org>
Date:   Fri Nov 15 15:36:33 2019 +0300

     rocks: forward options to luarocks

     The policy for check of luarocks flags has been changed
     (moved from tarantoolctl to luarocks).
     Chdir has been moved to luarocks.

     Closes #4629

     @TarantoolBot document
     Title: Update tarantoolctl rocks
     tarantoolctl rocks commands has been added:
     build
     config
     download
     init
     lint
     new_version
     purge
     which
     write_rockspec

     https://github.com/luarocks/luarocks/wiki/luarocks


On 12.04.2020 20:12, lvasiliev wrote:
> Ok
> 
> commit 39fc7b43d6aad0f0c732ff8938515b8301adab40
> Author: Leonid <lvasiliev@tarantool.org>
> Date:   Fri Nov 15 15:36:33 2019 +0300
> 
>      rocks: forward options to luarocks
> 
>      The policy for check of luarocks flags has been changed
>      (moved from tarantoolctl to luarocks).
>      Chdir has been moved to luarocks.
>      Unsupported flags have been deleted from luarocks
> 
>      Closes #4629
> 
>      @TarantoolBot document
>      Title: Update tarantoolctl rocks
>      tarantoolctl rocks commands has been added:
>      build
>      config
>      download
>      init
>      lint
>      new_version
>      purge
>      which
>      write_rockspec
> 
>      https://github.com/luarocks/luarocks/wiki/luarocks
> 
> 
> On 11.04.2020 17:11, Vladislav Shpilevoy wrote:
>>>      rocks: forward options to luarocks
>>>
>>>      The policy for check of luarocks flags has been changed
>>>      (moved from tarantoolctl to luarocks).
>>>      Chdir has been moved to luarocks.
>>>      Unsupported flags have been deleted from luarocks
>>>
>>>      @TarantoolBot document
>>>      Title: Update tarantoolctl rocks
>>>      tarantoolctl rocks commands has been added:
>>>      build
>>>      config
>>>      download
>>>      init
>>>      lint
>>>      new_version
>>>      purge
>>>      which
>>>      write_rockspec
>>>
>>>      https://github.com/luarocks/luarocks/wiki/luarocks
>>>
>>>      Closes #4629
>>
>> Please, move 'Closes' out of the docbot request. Otherwise it
>> will end up in the doc ticket description. Sorry I didn't notice
>> it earlier.
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks
@ 2019-11-19  8:56 Leonid
  0 siblings, 0 replies; 9+ messages in thread
From: Leonid @ 2019-11-19  8:56 UTC (permalink / raw)
  To: alexander.turenko; +Cc: tarantool-patches

https://github.com/tarantool/tarantool/issues/4629
https://github.com/tarantool/tarantool/tree/lvasiliev/gh-4629-forward-flags

---
 extra/dist/tarantoolctl.in | 157 +++++++------------------------------
 third_party/luarocks       |   2 +-
 2 files changed, 28 insertions(+), 131 deletions(-)

diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
index 6daf866ac..66dfec88f 100755
--- a/extra/dist/tarantoolctl.in
+++ b/extra/dist/tarantoolctl.in
@@ -21,7 +21,6 @@ ffi.cdef[[
 int kill(int pid, int sig);
 int isatty(int fd);
 int getppid(void);
-int chdir(const char *path);
 ]]
 
 local TIMEOUT_INFINITY = 100 * 365 * 86400
@@ -936,14 +935,6 @@ local function rocks()
     cfg.init()
     local util = require("luarocks.util")
     local command_line = require("luarocks.cmd")
-    local options = keyword_arguments
-    local key = nil
-    if options["only-server"] ~= nil then
-        key = find_arg("only%-server")
-    else
-        key = find_arg("server")
-    end
-    table.insert(positional_arguments, key)
 
     -- Tweak help messages
     util.see_help = function(command, program)
@@ -951,27 +942,36 @@ local function rocks()
         return "See Tarantool documentation for help."
     end
 
-    -- Enable only useful commands
+    -- Disabled: path, upload
     local rocks_commands = {
+        build = "luarocks.cmd.build",
+        config = "luarocks.cmd.config",
+        doc = "luarocks.cmd.doc",
+        download = "luarocks.cmd.download",
+        help = "luarocks.cmd.help",
+        init = "luarocks.cmd.init",
         install = "luarocks.cmd.install",
-        search = "luarocks.cmd.search",
+        lint = "luarocks.cmd.lint",
         list = "luarocks.cmd.list",
-        remove = "luarocks.cmd.remove",
-        show = "luarocks.cmd.show",
         make = "luarocks.cmd.make",
+        make_manifest = "luarocks.admin.cmd.make_manifest",
+        new_version = "luarocks.cmd.new_version",
         pack = "luarocks.cmd.pack",
-        unpack = "luarocks.cmd.unpack",
-        doc = "luarocks.cmd.doc",
-        help = "luarocks.cmd.help",
+        purge = "luarocks.cmd.purge",
+        remove = "luarocks.cmd.remove",
+        search = "luarocks.cmd.search",
+        show = "luarocks.cmd.show",
         test = "luarocks.cmd.test",
-        make_manifest = "luarocks.admin.cmd.make_manifest",
+        unpack = "luarocks.cmd.unpack",
+        which = "luarocks.cmd.which",
+        write_rockspec = "luarocks.cmd.write_rockspec",
     }
 
-    if keyword_arguments.chdir then
-        ffi.C.chdir(keyword_arguments.chdir)
-    end
+    --prepare arguments for luarocks
+    shift_argv(lua_arguments, 0, 1)
     -- Call LuaRocks
-    command_line.run_command('', rocks_commands, nil, unpack(positional_arguments))
+    command_line.run_command('LuaRocks main command-line interface',
+        rocks_commands, nil, unpack(lua_arguments))
 end
 
 local function exit_wrapper(func)
@@ -1186,117 +1186,14 @@ local commands = setmetatable({
     }, rocks = {
         func = exit_wrapper(rocks), process = process_remote, help = {
             header =
-                "%s rocks [install|make|remove|show|search|list|pack|unpack|doc|test|make_manifest|help]",
+                "%s rocks - package managment",
             description =
 [=[
-        Package management.
+        See tarantoolctl rocks help
 ]=],
             weight = 100,
             deprecated = false,
         },
-        subcommands = {
-            install = {
-                weight = 100,
-                help = {
-                    header = "%s rocks install {<rock>|<name> [<version>]}",
-                    description = [=[
-        Install a rock.
-]=],
-                }
-            },
-            make = {
-                weight = 101,
-                help = {
-                    header = "%s rocks make [<rockspec>]",
-                    description = [=[
-        Compile package in current directory using a rockspec.
-]=],
-                }
-            },
-            remove = {
-                weight = 101,
-                help = {
-                    header = "%s rocks remove <name> [<version>]",
-                    description = [=[
-        Uninstall a rock.
-]=],
-                }
-            },
-            show = {
-                weight = 110,
-                help = {
-                    header = "%s rocks list <filter>",
-                    description = [=[
-        Show information about an installed rock
-]=],
-                }
-            },
-            search = {
-                weight = 120,
-                help = {
-                    header = "%s rocks search <name> [<version>]",
-                    description = [=[
-        Search the rocks list for a pattern.
-]=],
-                }
-            },
-            list = {
-                weight = 121,
-                help = {
-                    header = "%s rocks list <filter>",
-                    description = [=[
-        List all installed rocks.
-]=],
-                }
-            },
-            pack = {
-                weight = 131,
-                help = {
-                    header = "%s rocks pack {<rockspec>|<name> [<version>]}",
-                    description = [=[
-        Create a rock, packing sources or binaries.
-]=],
-                }
-            },
-            unpack = {
-                weight = 131,
-                help = {
-                    header = "%s rocks unpack {<rock>|<name> [<version>]}",
-                    description = [=[
-        Unpack the contents of a rock.
-]=],
-                }
-            },
-            test = {
-                weight = 141,
-                help = {
-                    header = "%s rocks test [<rockspec>]",
-                    description = [=[
-        Run the test suite in the current directory.
-]=],
-                }
-            },
-            doc = {
-                weight = 151,
-                help = {
-                    header = "%s rocks doc <rockname>",
-                    description = [=[
-        Show documentation for an installed rock.
-]=],
-                }
-            },
-            make_manifest = {
-                weight = 161,
-                help = {
-                    header = "%s rocks make_manifest <argument>",
-                    description = [=[
-        Compile a manifest file for a repository.
-
-        <argument>, if given, is a local repository pathname.
-]=],
-                }
-            },
-        }
     }
 }, {
     __index = function()
@@ -1396,9 +1293,6 @@ local function populate_arguments()
         { 'help',        'boolean' },
         { 'format',      'string'  },
         { 'replica',     'number+' },
-        { 'chdir',       'string'  },
-        { 'only-server', 'string'  },
-        { 'server',      'string'  },
         { 'language',    'string'  },
     })
 
@@ -1411,7 +1305,10 @@ local function populate_arguments()
 end
 
 local function main()
-    populate_arguments()
+    if command_name ~= 'rocks' then -- rocks parse arguments themselves
+        populate_arguments()
+    end
+
     local cmd_pair = commands[command_name]
     if #arg < 2 then
         log.error("Not enough arguments for '%s' command\n", command_name)
diff --git a/third_party/luarocks b/third_party/luarocks
index 06a657e7a..84f7da7c7 160000
--- a/third_party/luarocks
+++ b/third_party/luarocks
@@ -1 +1 @@
-Subproject commit 06a657e7a68dd475e2afb5a56012c43f3a906640
+Subproject commit 84f7da7c7c1ff9502e8f1e023ce2bec0aabc402f
-- 
2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-04-13 12:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-05 14:49 [Tarantool-patches] [PATCH v2] rocks: forward options to luarocks Leonid Vasiliev
2020-04-09  6:55 ` lvasiliev
2020-04-10  0:00 ` Vladislav Shpilevoy
2020-04-10  9:10   ` lvasiliev
2020-04-11 14:11     ` Vladislav Shpilevoy
2020-04-12 17:12       ` lvasiliev
2020-04-13 12:03         ` lvasiliev
2020-04-12 20:15 ` Vladislav Shpilevoy
  -- strict thread matches above, loose matches on Subject: below --
2019-11-19  8:56 Leonid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox