Skip to content

Commit

Permalink
chore: Document code some more
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftydinar authored Dec 22, 2024
1 parent 0bb79d0 commit 70c5766
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/dnf/dnf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if [[ ${#OPTFIX[@]} -gt 0 ]]; then
echo "Creating symlinks to fix packages that install to /opt"
# Create symlink for /opt to /var/opt since it is not created in the image yet
mkdir -p "/var/opt"
ln -snf "/var/opt" "/opt"
ln -snf "/var/opt" "/opt"
# Create symlinks for each directory specified in recipe.yml
for OPTPKG in "${OPTFIX[@]}"; do
OPTPKG="${OPTPKG%\"}"
Expand All @@ -80,8 +80,7 @@ CLASSIC_INSTALL=false
HTTPS_INSTALL=false
LOCAL_INSTALL=false

# Install and remove RPM packages
# Sort classic, URL & local packages
# Sort classic, URL & local install packages
if [[ ${#INSTALL_PKGS[@]} -gt 0 ]]; then
for i in "${!INSTALL_PKGS[@]}"; do
PKG="${INSTALL_PKGS[$i]}"
Expand All @@ -99,6 +98,7 @@ if [[ ${#INSTALL_PKGS[@]} -gt 0 ]]; then
done
fi

# Function to inform the user about which type of packages is he installing
echo_rpm_install() {
if ${CLASSIC_INSTALL} && ! ${HTTPS_INSTALL} && ! ${LOCAL_INSTALL}; then
echo "Installing: ${CLASSIC_PKGS[*]}"
Expand All @@ -122,8 +122,9 @@ echo_rpm_install() {
fi
}

# Remove & install RPM packages
if [[ ${#INSTALL_PKGS[@]} -gt 0 && ${#REMOVE_PKGS[@]} -gt 0 ]]; then
echo "Installing & Removing RPMs"
echo "Removing & Installing RPMs"
echo "Removing: ${REMOVE_PKGS[*]}"
echo_rpm_install
dnf -y remove "${REMOVE_PKGS[@]}"
Expand Down

0 comments on commit 70c5766

Please sign in to comment.