-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: dnf
module
#377
base: main
Are you sure you want to change the base?
feat: dnf
module
#377
Conversation
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shellcheck
Did you forget to close this double quoted string? SC1078
Line 91 in cd91b05
CLASSIC_PKGS+=("${PKG}") |
📝 [shellcheck] reported by reviewdog 🐶
This is actually an end quote, but due to next char it looks suspect. SC1079
Line 98 in cd91b05
echo "Installing: ${CLASSIC_PKGS[*]}" |
🚫 [shellcheck] reported by reviewdog 🐶
'(' is invalid here. Did you forget to escape it? SC1036
Line 100 in cd91b05
echo "Installing package(s) directly from URL: ${HTTPS_PKGS[*]}" |
🚫 [shellcheck] reported by reviewdog 🐶
Expected 'fi' matching previously mentioned 'if'. SC1047
Line 100 in cd91b05
echo "Installing package(s) directly from URL: ${HTTPS_PKGS[*]}" |
🚫 [shellcheck] reported by reviewdog 🐶
Expected 'fi'. Fix any mentioned problems and try again. SC1072
Line 100 in cd91b05
echo "Installing package(s) directly from URL: ${HTTPS_PKGS[*]}" |
modules/rpm-ostree/rpm-ostree.sh
Outdated
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.
…d `--refresh` for install operation
Hopefully we can add it around that timeframe, yeah. Thanks for the progress update. |
hey @fiftydinar , is it possible to have a separate module for dnf4? it would prove useful for working with certain images, in my case, |
hey @fiftydinar , is it possible to have a separate module for dnf4? it would prove useful for working with certain images, in my case, centos-bootc:stream10. I did start on this myself, and the modified module is at https://github.com/cherry-os/cherryOS/tree/live/modules/dnf. It mostly contains minor syntax changes and a few links to external bash scripts that modify the output of some dnf4 commands into json that can be parsed properly, due to dnf4 not having --json. Thanks! |
So far my dnf4 module works, you just can't add repositories with it. There may be other issues I'm unaware of though. |
Hi, What's the status of Another option would be to detect if Adding your unofficial However, I would like @gmpinder & @xynydev opinions on this. |
Hey, |
We'd be more than happy for you to contribute what you have. I don't think mixing the two in a single module would be the best option as you claim it doesn't operate the same. |
It operates the same; the only code that's been changed is the addition of two bash scripts and syntax changes for dnf commands. The thing is it outputs a weird error when I try to add a repository using the modified module. |
@gmpinder This is the error I seem to be getting when using the below structure to add a repository file:
Error:
|
The files needs to be an array |
@gmpinder |
Your error looks nothing like the code we have in this PR. You're using your own local changes. Please use our discord server for the discussion instead as it isn't pertinent to these changes. |
Gotcha. |
Can support be added for adding repos with baseurl and (optional) gpg key for repos that don't provide Something like this:
Or with |
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 ready to have this merged if y'all are
In this case, you would want to create your own |
modules/dnf/README.md
Outdated
### Fix Optfix | ||
|
||
* Specify a list of packages to fix optfix issues in the `optfix` field | ||
|
||
Example: | ||
```yaml | ||
type: dnf | ||
optfix: | ||
packages: | ||
- package1 | ||
- package2 | ||
``` |
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.
There is no such thing as an "optfix fix". Optfix is the fix.
### Fix Optfix | |
* Specify a list of packages to fix optfix issues in the `optfix` field | |
Example: | |
```yaml | |
type: dnf | |
optfix: | |
packages: | |
- package1 | |
- package2 | |
``` | |
* Optfix is a script used to work around problems with certain packages that install into `/opt/` | |
* These issues are caused by Fedora Atomic storing `/opt/` at the location `/var/opt/` by default, while `/var/` is only writeable on a live system | |
* The script works around these issues by moving the folder to `/usr/lib/opt/` and creating the proper symlinks at runtime | |
* Specify a list of folders inside `/opt/` | |
Example: | |
```yaml | |
type: dnf | |
optfix: | |
packages: | |
- foldername # ADD AN ACTUAL EXAMPLE FOLDER HERE |
Excuse me for the potentially problematic formatting.
Replacing the kernel with `dnf` module is not done cleanly & some remaints of old kernel will be present. | ||
Please use `rpm-ostree` module for this purpose until this `dnf` behavior is fixed. |
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.
Was this fixed already in some images? I think I remember hearing about this.
## Package Group Removal | ||
|
||
### Remove Packages Groups |
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.
Remove all of these sorts of double-titles from the whole document. This is not a sensible structure.
## Doing a Specific Thing
### Do The Thing
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.
When there are multiple ###
-level titles below the top-level title, that is fine. Might only need minor rewording.
* Specify packages to install in the `install.packages` field | ||
* Use the `repo` parameter to specify a specific repository for installation | ||
* Use the `%OS_VERSION%` variable to automatically determine the operating system version | ||
* Use flags such as `skip-unavailable`, `install-weak-deps`, `skip-broken` and `allow-erasing` to customize package installation |
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 think there should be a section in the README dedicated to explaining what all the available flags are and what they mean. Language such as such as
should be avoided here to avoid ambiguity. I would rather format this as
* You can specify the following flags with this operation
* ...
type: dnf | ||
# Add repos, COPR repos, and repo keys | ||
repos: | ||
cleanup: false # (optional) Set to true to automatically remove added repos at the end of the module execution |
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.
# (optional) Set to true to automatically remove added repos at the end of the module execution
# Add a repo file from a URL
IMO these types of comments are not something that need to be in the example. All of this information should be in the documentation in the schema file, and that will be included on the documentation page on the website as well.
The example should be a fairly clean and readable configuration that one could mostly copy into their own recipe if they wished to. Flags should not be set to their default state manually, they should only be set if there is a specific reason to use the non-default state, with a comment explaining the reasoning.
Starting to get strange errors with this module. |
@xynydev guess that's what happens when I use AI to create the README. |
The dnf plugin will need to be installed first for that to work. Maybe we should have a check for that and install it if you're trying to use it |
|
Changes
Recipe format
Existing features code changes
dnf -y config-manager addrepo --from-repofile=$repo
for repo URLs & repo files, while COPR repos are using nativednf -y copr enable user/project
.COPR repos are written in separate
copr:
array & in simpleruser/project
format in recipe, instead of long URL inrepos:
array.rpm-ostree override remove --install=$pkg
is replaced with 2 operations ofdnf
removal & then install.Single operation of removal + installation of
dnf
doesn't currently exist, but it's not a breaking behavior to not have it.rpm-ostree override replace
is replaced withdnf -y distro-sync --refresh --repo $repo $packages
, which is compatible with all repos.Adding the repository along with replacement is disabled, so it must be done before replacement in
repos:
array if repo doesn't exist.New features
dnf group
removal & installation. Those are declared asgroup-remove
&group-install
array in recipe.They run before the packages installation.
install-weak-dependencies:
option for declaring if weak dependencies (such as Recommended) should be installed.It modifies the install & replace commands itself using
--setopt=install_weak_deps=True/False
flag, it doesn't modify thednf
config file. It defaults totrue
(reflectingdnf
defaults).skip-unavailable-packages:
option for skipping unavailable packages when not available in repositories, or when not available on the system in case of replacing. Passes--skip-unavailable
flag. Defaults to false.skip-broken-packages:
option for skipping the installation/replacement of broken packages. Passes--skip-broken
flag. Defaults to false.allow-erasing-packages
: option for erasing/removing the problematic packages during dependency problems. Passes--allowerasing
flag. Defaults to false.remove-unused-dependencies
is true by default. If false is specified, it passes the--no-autoremove
flag, which won't remove any unused dependencies during removal operation.Issues to be closed
Fixes: #361
Fixes: #370
Fixes: #325
Fixes: #282