summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-06-29 14:55:37 -0400
committerGitHub <noreply@github.com>2016-06-29 14:55:37 -0400
commita9076e9bec8454251c3fc74dcc47b0b1f94db169 (patch)
treec4445fa8971c833709a7997f1d0d900adaec0885 /playbooks
parenta7c5f41157e61d9478c0f46671347bc84401f2c7 (diff)
parentc64bd9065511bc6cb508750d167ab9d8a03b182f (diff)
downloadopenshift-a9076e9bec8454251c3fc74dcc47b0b1f94db169.tar.gz
openshift-a9076e9bec8454251c3fc74dcc47b0b1f94db169.tar.bz2
openshift-a9076e9bec8454251c3fc74dcc47b0b1f94db169.tar.xz
openshift-a9076e9bec8454251c3fc74dcc47b0b1f94db169.zip
Merge pull request #2097 from sdodson/repoquery
Switch to repoquery, enable plugins for satellite support
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh b/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
index a2a9579b5..8d7543f3c 100644
--- a/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
+++ b/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
@@ -1,7 +1,11 @@
#!/bin/bash
-
-installed=$(yum list installed -e 0 -q "$@" 2>&1 | tail -n +2 | awk '{ print $2 }' | sort -r | tr '\n' ' ')
-available=$(yum list available -e 0 -q "$@" 2>&1 | tail -n +2 | grep -v 'el7ose' | awk '{ print $2 }' | sort -r | tr '\n' ' ')
+if [ `which dnf 2> /dev/null` ]; then
+ installed=$(dnf repoquery --installed --latest-limit 1 -d 0 --qf '%{version}-%{release}' "${@}" 2> /dev/null)
+ installed=$(dnf repoquery --available --latest-limit 1 -d 0 --qf '%{version}-%{release}' "${@}" 2> /dev/null)
+else
+ installed=$(repoquery --plugins --pkgnarrow=installed --qf '%{version}-%{release}' "${@}" 2> /dev/null)
+ available=$(repoquery --plugins --pkgnarrow=available --qf '%{version}-%{release}' "${@}" 2> /dev/null)
+fi
echo "---"
echo "curr_version: ${installed}"