diff --git a/modules/dnf/README.md b/modules/dnf/README.md index c0f833c..77941e2 100644 --- a/modules/dnf/README.md +++ b/modules/dnf/README.md @@ -14,7 +14,7 @@ Specific COPR repositories can also be specified in `copr: user/project` format If you use a repo that requires adding custom keys (eg. Brave Browser), you can import the keys by declaring the key URLs under `keys:`. The magic string acts the same as it does in `repos`. -Then the module installs the packages declared under `install:` using `dnf -y install`, it removes the packages declared under `remove:` using `dnf -y remove`. If there are packages declared under both `install:` and `remove:` then removal is performed 1st & install 2nd. +Then the module installs the packages declared under `install:` using `dnf -y install --refresh`, it removes the packages declared under `remove:` using `dnf -y remove`. If there are packages declared under both `install:` and `remove:` then removal is performed 1st & install 2nd. Installing RPM packages directly from a `http(s)` url that points to the RPM file is also supported, you can just put the URLs under `install:` and they'll be installed along with the other packages. The magic string `%OS_VERSION%` is substituted with the current VERSION_ID (major Fedora version) like with the `repos:` property. diff --git a/modules/dnf/dnf.sh b/modules/dnf/dnf.sh index ac127b7..dac0ca9 100644 --- a/modules/dnf/dnf.sh +++ b/modules/dnf/dnf.sh @@ -17,7 +17,7 @@ if ! rpm -q dnf5-plugins &>/dev/null; then fi # Check if option for weak dependencies is enabled or disabled -WEAK_DEPENDENCIES=$(echo "${1}" | jq -r 'try .["weak-dependencies"]') +WEAK_DEPENDENCIES=$(echo "${1}" | jq -r 'try .["install-weak-dependencies"]') if [[ -z "${WEAK_DEPENDENCIES}" ]] || [[ "${WEAK_DEPENDENCIES}" == "null" ]] || [[ "${WEAK_DEPENDENCIES}" == "true" ]]; then WEAK_DEPS_FLAG="--setopt=install_weak_deps=True" @@ -138,11 +138,11 @@ if [[ ${#INSTALL_PKGS[@]} -gt 0 && ${#REMOVE_PKGS[@]} -gt 0 ]]; then echo "Removing: ${REMOVE_PKGS[*]}" echo_rpm_install dnf -y "${WEAK_DEPS_FLAG}" remove "${REMOVE_PKGS[@]}" - dnf -y "${WEAK_DEPS_FLAG}" install "${INSTALL_PKGS[@]}" + dnf -y "${WEAK_DEPS_FLAG}" install --refresh "${INSTALL_PKGS[@]}" elif [[ ${#INSTALL_PKGS[@]} -gt 0 ]]; then echo "Installing RPMs" echo_rpm_install - dnf -y "${WEAK_DEPS_FLAG}" install "${INSTALL_PKGS[@]}" + dnf -y "${WEAK_DEPS_FLAG}" install --refresh "${INSTALL_PKGS[@]}" elif [[ ${#REMOVE_PKGS[@]} -gt 0 ]]; then echo "Removing RPMs" echo "Removing: ${REMOVE_PKGS[*]}" diff --git a/modules/dnf/dnf.tsp b/modules/dnf/dnf.tsp index 25b3494..bba46e7 100644 --- a/modules/dnf/dnf.tsp +++ b/modules/dnf/dnf.tsp @@ -32,5 +32,5 @@ model RpmOstreeModule { }>; /** Whether to install weak dependencies during install operation or not. */ - "weak-dependencies"?: boolean = true; + "install-weak-dependencies"?: boolean = true; } \ No newline at end of file diff --git a/modules/dnf/module.yml b/modules/dnf/module.yml index f9b43e0..6fc2c62 100644 --- a/modules/dnf/module.yml +++ b/modules/dnf/module.yml @@ -2,14 +2,14 @@ name: dnf shortdesc: The dnf module offers pseudo-declarative package and repository management using dnf. example: | type: dnf - weak-dependencies: true + install-weak-dependencies: true repos: - copr: atim/starship - https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo keys: - https://brave-browser-rpm-release.s3.brave.com/brave-core.asc optfix: - - Tabby # needed because tabby installs into /opt/Tabby + - Tabby # needed because tabby installs into /opt/Tabby/ - brave.com install: - starship