[yadt] push by kay.voge...@googlemail.com - refactoring of the yum clean procedure to decrease network load and ma... on 2013-03-14 17:01 GMT

2 views
Skip to first unread message

ya...@googlecode.com

unread,
Mar 14, 2013, 1:01:36 PM3/14/13
to yadt-...@googlegroups.com
Revision: 98d341843335
Branch: default
Author: kay.vog...@gmail.com
Date: Thu Mar 14 10:00:19 2013
Log: refactoring of the yum clean procedure to decrease network load
and make the artefact update non-interactive to be consistent
http://code.google.com/p/yadt/source/detail?r=98d341843335

Modified:
/yadt-client/src/usr/bin/yadt-yum

=======================================
--- /yadt-client/src/usr/bin/yadt-yum Fri Mar 8 08:29:49 2013
+++ /yadt-client/src/usr/bin/yadt-yum Thu Mar 14 10:00:19 2013
@@ -29,9 +29,6 @@
exit 0
fi

-# (2013-03-06 Kay Vogelgesang) disable yum cache up clean by default
-YUMCACHE_CLEAN=false
-
# (2013-03-06 Kay Vogelgesang) source in sysconfig - you can activate
YUMCACHE_CLEAN here
SYSCONFIG="/etc/sysconfig/yadt-yum"
[ -f $SYSCONFIG ] && . $SYSCONFIG
@@ -55,9 +52,16 @@
# we use the fact that repoquery ignores yum plugins by default (without
the --plugins option)
# and that yum sees the RHN channels via the rhn plugin

+ # clean up important yum cache parts if it is configured and make cache
+ if [ "$YUMCACHE_CLEAN_OPTS" ]; then
+ echo "execute yum clean $YUMCACHE_CLEAN_OPTS"
+ yum clean $YUMCACHE_CLEAN_OPTS > /dev/null 2>&1
+ yum makecache > /dev/null 2>&1
+ fi
+
if [ "${PARAMETERS[1]}" ] ; then
# if any parameters beyond "upgrade" are given then we call yum as a
pass-through wrapper
- yum "${OPTIONS[@]}" "${PARAMETERS[@]}"
+ yum "${OPTIONS[@]}" "${PARAMETERS[@]}" -y
EC=$?
/usr/bin/yadt-status-structure
exit $EC
@@ -65,15 +69,7 @@
# if no arguments are given then we call yum and specify all upgrades
from
# YUM channels in our call to yum. That prevents unwanted upgrades from
RHN channels
# perform updates, until there are no more left
- while true; do
- # (2013-03-06 Kay Vogelgesang) clean up important yum cache parts if
it is configured
- if [ $YUMCACHE_CLEAN == "true" ]; then
- echo "clean up all yum caches"
- yum clean all > /dev/null 2>&1
- fi
- # (2012-08-09 Kay Vogelgesang) build yum cache before determining
required updates
- yum makecache > /dev/null 2>&1
- # (2012-08-09 Kay Vogelgesang) force usage of yum cache
+ while true; do
UPDATES=( $(repoquery -a --pkgnarrow=updates --queryformat "%{name}"
--cache) )

if [ "${#UPDATES[@]}" -gt 0 ] ; then
Reply all
Reply to author
Forward
0 new messages