mudler / luet

:package: :whale: 0-dependency Container-based Package Manager using SAT solver and QLearning
https://luet.io
GNU General Public License v3.0
261 stars 24 forks source link

License banner is displayed when running extensions #247

Closed geaaru closed 2 years ago

geaaru commented 3 years ago

Luet version: Luet version 0.17.8-g3402641241fd6459a4c95f6055b98a728c4e2c67 2021-08-11 0135 UTC

Describe the bug

$ luet repo-devkit -- pkgs -t ./amd64/ -t ./multi-arch/   --missings  --json -p ./repo
 Luet version 0.17.8-g3402641241fd6459a4c95f6055b98a728c4e2c67 2021-08-11 0135 UTC

    Luet Copyright (C) 2019-2021 Ettore Di Giacinto
    This program comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it
    under certain conditions.

[{"name":"funtoo-boot-portage",...

IMHO, it's better drop it or show it only in build, install, uninstall, upgrade commands.

mudler commented 3 years ago

I dunno what luet repo-devkit is doing behind the scenes, but we do not show that always. https://github.com/mudler/luet/blob/master/cmd/root.go#L66

geaaru commented 3 years ago

Not at the moment, you print the banner always exclude the commands reported in the link. So every extension is now broken if it generates JSON.

It better works in inverse mode: https://github.com/geaaru/luet/commit/af8862304372180fc5aead6d139eaa959427e1e8 And set the list of the commands with the banner.

mudler commented 3 years ago

Not at the moment, you print the banner always exclude the commands reported in the link. So every extension is now broken if it generates JSON.

It better works in inverse mode: geaaru@af88623 And set the list of the commands with the banner.

I don't understand. What's the command which is being called by repo devkit which shows the banner?

geaaru commented 3 years ago

It isn't a command, it's luet itself. If you run luet repo-devkit that is an extension (luet-repo-devkit) then it's executed the Execute method that prints the banner and then it calls the extension.

https://github.com/mudler/luet/blob/master/cmd/root.go#L207

This happens with every extensions, it isn't related to repo-devkit. That is only an example:

$ luet initenv -- --help
 Luet version 0.17.8-g3402641241fd6459a4c95f6055b98a728c4e2c67 2021-08-12 1248 UTC

    Luet Copyright (C) 2019-2021 Ettore Di Giacinto
    This program comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it
    under certain conditions.

Copyright (c) 2020 Luet Extensions

luet initenv [opts]

Initialize a repository tree for build Luet packages:

  * create Makefile
  * empty packages tree(s)

Example:
mudler commented 3 years ago

I see, it makes sense to hide that while adding plugins