--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+config_yum() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_config_yum[collapsed=true]\r\e[0KConfiguring Yum and/or Dnf config ..."
+ echo
+ echo "${HASH_LINE}"
+ echo
+ log "Configuring Yum and/or Dnf config ..."
+
+ local cfg_file=
+ local target=
+ local changed=
+
+ for cfg_file in /etc/dnf/dnf.conf /etc/yum.conf ; do
+ if [[ ! -f "${cfg_file}" ]] ; then
+ continue
+ fi
+
+ echo
+ printf "Checking '%s': " "${cfg_file}"
+ if [[ -h "${cfg_file}" ]] ; then
+ target=$( readlink -f "${cfg_file}" )
+ if [[ "${target}" == '/etc/dnf/dnf.conf' ]] ; then
+ echo "is a symlink to '/etc/dnf/dnf.conf'."
+ continue
+ fi
+ fi
+ echo
+ changed=
+
+ echo "Checking '${cfg_file}' ..."
+ echo "Old content:"
+ echo "---------- snip ----------"
+ cat "${cfg_file}"
+ echo "---------- snip ----------"
+
+ if grep --perl-regexp -i --quiet '^\s*install_weak_deps\s*=' "${cfg_file}" ; then
+ if grep --perl-regexp -i --quiet '^\s*install_weak_deps\s*=\s*True' "${cfg_file}" ; then
+ echo
+ echo "Modifying install_weak_deps in '${cfg_file}' ..."
+ sed -i -e 's/^\s*install_weak_deps\s*=.*/install_weak_deps=False/i' "${cfg_file}"
+ changed="y"
+ fi
+ else
+ echo
+ echo "Adding 'install_weak_deps=False' to '${cfg_file}' ..."
+ echo 'install_weak_deps=False' >> "${cfg_file}"
+ changed="y"
+ fi
+
+ if [[ "${changed}" ]] ; then
+ echo
+ echo "New content:"
+ echo "---------- snip ----------"
+ cat "${cfg_file}"
+ echo "---------- snip ----------"
+ fi
+ done
+
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_config_yum\r\e[0K"
+}
+config_yum
+
+#end raw
+## vim: ts=4 et list