diff options
author | Nikolai Prokoschenko <nikolai@prokoschenko.de> | 2016-01-26 14:38:06 +0100 |
---|---|---|
committer | Nikolai Prokoschenko <nikolai@prokoschenko.de> | 2016-01-26 14:38:06 +0100 |
commit | f8d11d94210e3677a70091b4146da445d557b615 (patch) | |
tree | 870164825c71917a7a1e76fcf5d2dd9067e5b1a2 /playbooks/common | |
parent | 9d2d123403e244bb49997c0bb498b5aca4c625b9 (diff) | |
download | openshift-f8d11d94210e3677a70091b4146da445d557b615.tar.gz openshift-f8d11d94210e3677a70091b4146da445d557b615.tar.bz2 openshift-f8d11d94210e3677a70091b4146da445d557b615.tar.xz openshift-f8d11d94210e3677a70091b4146da445d557b615.zip |
Fix checking for update package availability
Currently, if `yum list available` returns two versions, for whatever reason, no sorting is imposed. Therefore it's possible that an upgraded package version is available but is not being detected.
This patch sorts the version number list so that most recent version is always picked first.
Diffstat (limited to 'playbooks/common')
-rw-r--r-- | playbooks/common/openshift-cluster/upgrades/files/versions.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/files/versions.sh b/playbooks/common/openshift-cluster/upgrades/files/versions.sh index b46407ed7..3a1a8ebb1 100644 --- a/playbooks/common/openshift-cluster/upgrades/files/versions.sh +++ b/playbooks/common/openshift-cluster/upgrades/files/versions.sh @@ -1,8 +1,8 @@ #!/bin/bash -yum_installed=$(yum list installed -e 0 -q "$@" 2>&1 | tail -n +2 | awk '{ print $2 }' | tr '\n' ' ') +yum_installed=$(yum list installed -e 0 -q "$@" 2>&1 | tail -n +2 | awk '{ print $2 }' | sort -r | tr '\n' ' ') -yum_available=$(yum list available -e 0 -q "$@" 2>&1 | tail -n +2 | grep -v 'el7ose' | awk '{ print $2 }' | tr '\n' ' ') +yum_available=$(yum list available -e 0 -q "$@" 2>&1 | tail -n +2 | grep -v 'el7ose' | awk '{ print $2 }' | sort -r | tr '\n' ' ') echo "---" echo "curr_version: ${yum_installed}" |