Use the right columns from DNF to split package name and version

This commit is contained in:
mboelen 2016-01-25 15:47:24 +01:00
parent d3e58a0537
commit 647b482c53
1 changed files with 2 additions and 2 deletions

View File

@ -391,8 +391,8 @@
SPACKAGES=`${DNFBINARY} -q list installed 2> /dev/null | awk '{ if ($1!="Installed" && $1!="Last") {print $1","$2 }}'`
for J in ${SPACKAGES}; do
N=`expr ${N} + 1`
PACKAGE_NAME=`echo ${J} | cut -d ',' -f2`
PACKAGE_VERSION=`echo ${J} | cut -d ',' -f3`
PACKAGE_NAME=`echo ${J} | cut -d ',' -f1`
PACKAGE_VERSION=`echo ${J} | cut -d ',' -f2`
LogText "Found package: ${PACKAGE_NAME} (version: ${PACKAGE_VERSION})"
INSTALLED_PACKAGES="${INSTALLED_PACKAGES}|${PACKAGE_NAME},${PACKAGE_VERSION}"
done