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

Draft
wants to merge 56 commits into
base: main
Choose a base branch
from
Draft

feat: dnf module #377

wants to merge 56 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[*]}"

modules/dnf/module.yml Outdated Show resolved Hide resolved
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 force-pushed the dnf-module branch 16 times, most recently from c3f963f to 64dcd8f Compare February 3, 2025 18:14
@gmpinder
Copy link
Member

gmpinder commented Feb 4, 2025

@xynydev how does the TSP look for the schema? That's what I'm gonna move towards.

@xynydev
Copy link
Member

xynydev commented Feb 4, 2025

@xynydev how does the TSP look for the schema? That's what I'm gonna move towards.

I'm not sure what your exact question is, but the process goes kind of like this

  1. https://blue-build.org/modules.json is generated by https://github.com/blue-build/website/blob/main/src/plugins/modulesJsonGeneratorPlugin.ts every time the main branch of the modules repo pushes
    • This also launches a schema update
    • I'm working on a PR to make it support versioned modules feat: versioned module reference website#74
    • The file marked to be considered the schema file is based on the file having a .tsp extension
  2. The schema build fetches this modules.json, puts all the schemas in a directory, creates a union type that has all modules, and builds the jsonschema files

@gmpinder
Copy link
Member

gmpinder commented Feb 4, 2025

@xynydev how does the TSP look for the schema? That's what I'm gonna move towards.

I'm not sure what your exact question is, but the process goes kind of like this

I was more asking how does the .tsp file look to you in terms of what we discussed in #361

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