Skip to content
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

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open

feat: dnf module #377

wants to merge 63 commits into from

Conversation

fiftydinar
Copy link
Collaborator

@fiftydinar fiftydinar commented Dec 22, 2024

Changes

Recipe format

  • Recipe format changed a bit, to satisfy the new feature of dnf flags.

Existing features code changes

  • Adding repos is now using dnf -y config-manager addrepo --from-repofile=$repo for repo URLs & repo files, while COPR repos are using native dnf -y copr enable user/project.
    COPR repos are written in separate copr: array & in simpler user/project format in recipe, instead of long URL in repos: array.
  • rpm-ostree override remove --install=$pkg is replaced with 2 operations of dnf 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 with dnf -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 as group-remove & group-install array in recipe.
    They run before the packages installation.
  • Option for additional flags when doing installation or replacement of packages.
    • 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 the dnf config file. It defaults to true (reflecting dnf 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.
  • Option for additional flags when doing removal of packages.
    • 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

Copy link
Contributor

@github-actions github-actions bot left a 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

⚠️ [shellcheck] reported by reviewdog 🐶
Did you forget to close this double quoted string? SC1078

CLASSIC_PKGS+=("${PKG}")


📝 [shellcheck] reported by reviewdog 🐶
This is actually an end quote, but due to next char it looks suspect. SC1079

echo "Installing: ${CLASSIC_PKGS[*]}"


🚫 [shellcheck] reported by reviewdog 🐶
'(' is invalid here. Did you forget to escape it? SC1036

echo "Installing package(s) directly from URL: ${HTTPS_PKGS[*]}"


🚫 [shellcheck] reported by reviewdog 🐶
Expected 'fi' matching previously mentioned 'if'. SC1047

echo "Installing package(s) directly from URL: ${HTTPS_PKGS[*]}"


🚫 [shellcheck] reported by reviewdog 🐶
Expected 'fi'. Fix any mentioned problems and try again. SC1072

echo "Installing package(s) directly from URL: ${HTTPS_PKGS[*]}"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Possible misspelling: REPOS may not be assigned. Did you mean REPO? SC2153

if [[ ${#REPOS[@]} -gt 0 ]]; then

gmpinder
gmpinder previously approved these changes Feb 18, 2025
@xynydev
Copy link
Member

xynydev commented Feb 18, 2025

Great final changes @gmpinder. Would y'all be fine if the repo thing I talked about above (#377 (comment)) were to be implemented?

@gmpinder
Copy link
Member

Great final changes @gmpinder. Would y'all be fine if the repo thing I talked about above (#377 (comment)) were to be implemented?

Yeah I can totally do that

@gmpinder gmpinder force-pushed the dnf-module branch 6 times, most recently from 9579546 to 04b300b Compare February 19, 2025 04:43
@gmpinder gmpinder force-pushed the dnf-module branch 3 times, most recently from 1638b19 to 2e7f404 Compare February 19, 2025 21:40
@gmpinder
Copy link
Member

I made some changes to force an exit if dnf fails. There seems to be some assumptions I made that no longer hold. I'll have to make some more updates to fix that.

@gmpinder gmpinder force-pushed the dnf-module branch 9 times, most recently from a3917fa to 0bf23f4 Compare February 24, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants