New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new command modulesync #444
Conversation
|
I'm not sure how useful is tracking the tool development in separate commits. I think squashing all of them into one commit which introduces the new plugin is cleaner. |
doc/modulesync.rst
Outdated
|
|
||
| `modulesync` downloads packages from modules according to provided arguments and creates a repository with modular data | ||
| in working directory. Im modular environment it is recommend to use the command in combination with other dnf commands | ||
| which downloads RPM packages. See examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused here. Could you elaborate in more details the use case when user needs to download rpm packages separately (using dnf download or such) and then run modulesync to generate modular metadata? I thought that modulesync will download rpm packages from given modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case that a package has modular label in rpm header it cannot be used in new repository without modular metadata. module sync will create a repository including modular metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But modulesync also downloads the rpm package itself, doesn't it? What I do not understand is the need of dnf download before dnf modulesync. I really think this deserves more detailed documentation in the man pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
I can do it. |
865a7eb
to
4523ed0
Compare
|
Please, could you update the commit message with |
97eedc1
to
fd2f1ca
Compare
doc/modulesync.rst
Outdated
| # Copyright (C) 2021 Red Hat, Inc. | ||
| # | ||
| # This copyrighted material is made available to anyone wishing to use, | ||
| # modify, copy, or redistribute it subject to the terms and conditions of | ||
| # the GNU General Public License v.2, or (at your option) any later version. | ||
| # This program is distributed in the hope that it will be useful, but WITHOUT | ||
| # ANY WARRANTY expressed or implied, including the implied warranties of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
| # Public License for more details. You should have received a copy of the | ||
| # GNU General Public License along with this program; if not, write to the | ||
| # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
| # 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
| # source code or documentation are not subject to the GNU General Public | ||
| # License and may only be used or replicated with the express permission of | ||
| # Red Hat, Inc. | ||
| # | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright here is not correctly formated - resulting in inclusion of copyright into the man page itself. Correct format of the comment in rst file is:
..
Copyright (C) 2021 Red Hat, Inc.
This copyrighted...
doc/modulesync.rst
Outdated
| ----------- | ||
|
|
||
| `modulesync` downloads packages from modules according to provided arguments and creates a repository with modular data | ||
| in working directory. Im environment with modules it is recommend to use the command for redistribution of packages, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: In environment
doc/modulesync.rst
Outdated
|
|
||
| `modulesync` downloads packages from modules according to provided arguments and creates a repository with modular data | ||
| in working directory. Im environment with modules it is recommend to use the command for redistribution of packages, | ||
| because DNF prevents from getting modular packages without modular metadata on the system (Fail-safe mechanism). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because DNF does not allow installation of modular packages without modular metadata...?
I'm not sure what getting word here is supposed to mean.
doc/modulesync.rst
Outdated
| ``dnf download nodejs`` | ||
| ``dnf modulesync`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiline examples are incorrectly formatted. In the man page they are rendered as one line e.g.:
dnf download nodejs dnf modulesync
The first download command ...
doc/modulesync.rst
Outdated
| ``dnf --destdir=/tmp/my-temp modulesync nodejs:14/minimal --resolve`` | ||
| Download package required for installation of `minimal` profile from module `nodejs` and stream `14` into directory | ||
| `/tmp/my-temp` and all required dependencies. Then it will create a repository in `/tmp/my-temp` directory with | ||
| packages previously downloaded packages and modular metadata from all available repositories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated packages word
doc/modulesync.rst
Outdated
| ``dnf modulesync --destdir=/tmp/my-temp`` | ||
| The first `dnf module install` command downloads package from required for installation of `minimal` profile from module | ||
| `nodejs` and stream `14` into directory `/tmp/my-temp`. The second command `dnf modulesync` will create | ||
| a repository in `/tmp/my-temp` directory with packages previously downloaded packages and modular metadata from all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again duplicated packages word.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some remaining issues with man pages / documentation. Also the modulesync should be included in index.rst file.
af84b0d
to
faab2fe
Compare
plugins/modulesync.py
Outdated
|
|
||
| return result_query | ||
|
|
||
| def _get_providers_of_requires(self, to_test, done=None, req_dict={}): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using mutable default parameter values (here req_dict={}) is strongly discouraged and has significant side effects (see https://florimond.dev/en/posts/2018/08/python-mutable-defaults-are-the-source-of-all-evil/). Unless you have a reason, please use req_dict=None.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
It will download module metadata from all enabled repositories, module artifacts and profiles of matching modules. Then it creates a repository. = changelog = msg: Add a new subpackage with modulesync command. The command downloads packages from modules and/or creates a repository with modular data. type: enhancement resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1868047
It will download module metadata from all enabled repositories,
module artifacts and profiles of matching modules. Then it creates
a repository.
Requires: rpm-software-management/dnf#1794
For RHEL8 it requires: rpm-software-management/libdnf#1381