]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding and using snippets/tpl.280.dist-upgrade.sh; version bump to 2.0.3
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 29 Jun 2020 13:55:11 +0000 (15:55 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 29 Jun 2020 13:55:11 +0000 (15:55 +0200)
kickstart/template-oel7.ks
lib/cr_vmware_tpl/__init__.py
snippets/tpl.270.remove-uek.sh
snippets/tpl.280.dist-upgrade.sh [new file with mode: 0644]

index f8e754d074968baf9062db0922fb1a1f5ea0f01a..b6444fe119f9ef5efebf63aa787179d287c7dd9a 100644 (file)
@@ -231,6 +231,11 @@ echo
 echo "Using snippet $remove_uek_snippet"
 $SNIPPET($remove_uek_snippet)
 
+#set $dist_upgrade_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.280.dist-upgrade.sh"
+echo
+echo "Using snippet $dist_upgrade_snippet"
+$SNIPPET($dist_upgrade_snippet)
+
 #set $create_motd_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.300.create-motd.sh"
 echo
 echo "Using snippet $create_motd_snippet"
index 6273bfbc852a47ff628a5e3afe27b34b33d76da4..d8196e7efa70a98fc8b1848c2fb17312d97b2741 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/env python3
 # -*- coding: utf-8 -*-
 
-__version__ = '2.0.2'
+__version__ = '2.0.3'
 
 # vim: ts=4 et list
index b3e8d86495f4717c36770507a7911cafd1cf68de..3d3de6695a753861d76874879fe31cf3a8d72822 100644 (file)
@@ -12,10 +12,21 @@ remove_uek_packages() {
 
     sed -i -e 's/^\(DEFAULTKERNEL=\).*/\1kernel/i' /etc/sysconfig/kernel
 
-    echo
-    log "Removing UEK packages ..."
+    if rpm -qa | grep -- -uek- >/dev/null ; then
+
+        echo
+        log "Removing UEK packages ..."
+
+        if yum remove -y *-uek-*; then
+            :
+        else
+            echo "[$(date)]: Could not remove UEK packages." | tee -a "${ERROR_POINTER}"
+        fi
 
-    yum remove -y *-uek-*
+    else
+        echo
+        echo "Removing UEK packages not necessary."
+    fi
 
 }
 
diff --git a/snippets/tpl.280.dist-upgrade.sh b/snippets/tpl.280.dist-upgrade.sh
new file mode 100644 (file)
index 0000000..ddc4ea2
--- /dev/null
@@ -0,0 +1,26 @@
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+dist_upgrade() {
+
+    echo
+    echo "${HASH_LINE}"
+    echo "Calling dist_upgrade() ..."
+    echo
+    log "Upgrading all packages ..."
+    echo
+
+    if yum upgrade -y ; then
+        :
+    else
+        echo "[$(date)]: Upgrading system not successful." | tee -a "${ERROR_POINTER}"
+    fi
+
+}
+
+dist_upgrade
+
+#end raw
+## vim: ts=4 et list
+