]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Setting tesflags=nodocs in dnf.conf
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 15 Nov 2023 14:08:23 +0000 (15:08 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 15 Nov 2023 14:08:23 +0000 (15:08 +0100)
snippets/tpl.120.config_yum.sh

index 3502d7eca904e55f963cbca7b70fa1850bb34cc6..d6a105426166a31e0505164f266d8e3a38e32e24 100644 (file)
@@ -50,6 +50,20 @@ config_yum() {
             changed="y"
         fi
 
+        if grep --perl-regexp -i --quiet '^\s*tsflags\s*=' "${cfg_file}" ; then
+            if grep --perl-regexp -i --quiet '^\s*tsflags\s*=\s*nodocs' "${cfg_file}" ; then
+                echo
+                echo "Modifying tsflags in '${cfg_file}' ..."
+                sed -i -e 's/^\s*tsflags\s*=.*/tsflags=nodocs/i' "${cfg_file}"
+                changed="y"
+            fi
+        else
+            echo
+            echo "Adding 'tsflags=nodocs' to '${cfg_file}' ..."
+            echo 'tsflags=nodocs' >> "${cfg_file}"
+            changed="y"
+        fi
+
         if [[ "${changed}" ]] ; then
             echo
             echo "New content:"