Skip to content

Commit

Permalink
Fix shellcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
janblazek committed Mar 25, 2024
1 parent 3770884 commit 6737692
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mtps-pkg-test
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if command -v "mtps-setup" >/dev/null; then source "mtps-setup"; fi
# If previous fails source `mtps-setup` from this script dir
if [ -z "${YUMDNFCMD:-}" ]; then source "$(dirname "${BASH_SOURCE[0]}")/mtps-setup" || ( echo "Cannot source mtps-setup" >&2; exit 91 ); fi

YUM_VERSION=`$YUMDNFCMD --version`
YUM_VERSION=$("${YUMDNFCMD}" --version)
[ ${YUM_VERSION:0:1} == "3" ] && ALLOWERASING=""

from_nevra() {
Expand Down Expand Up @@ -345,7 +345,7 @@ pkg_downgrade_if_present() {
echo "Not downgrading package: $nevra. There is already installed old package: $installed_nevra_old"
return 0
fi
"$YUMDNFCMD" -y downgrade ${ALLOWERASING} "$name"
"$YUMDNFCMD" -y downgrade "$ALLOWERASING" "$name"
}

get_old_nevra() {
Expand All @@ -357,7 +357,7 @@ get_old_nevra() {
local arch="$(from_nevra "$nevra" "arch")"
# Find previous version of the package.
local old_nevras=($(
repoquery -q $name.$arch --qf="%{name}-%{epoch}:%{version}-%{release}.%{arch}" | \
repoquery -q "$name"."$arch" --qf="%{name}-%{epoch}:%{version}-%{release}.%{arch}" | \
tr -s ' ' | \
grep $arch | \
sed -n -e "/^${name}-${epoch}:${version}-${release}.${arch}$/"'!p'
Expand Down Expand Up @@ -393,7 +393,7 @@ pkg_remove_any_newer() {
continue
fi
echo "Removing package: $to_remove"
"$YUMDNFCMD" -y remove ${ALLOWERASING} "$to_remove" || :
"$YUMDNFCMD" -y remove "$ALLOWERASING" "$to_remove" || :
done
}

Expand All @@ -409,7 +409,7 @@ pkg_remove_any_older() {
fi
if nevra_older_then "$to_remove" "$nevra"; then
echo "Removing older package: $to_remove"
"$YUMDNFCMD" -y remove ${ALLOWERASING} "$to_remove" || :
"$YUMDNFCMD" -y remove "$ALLOWERASING" "$to_remove" || :
else
debug "Not removing newer package: $to_remove"
continue
Expand All @@ -432,7 +432,7 @@ pkg_update_to_new_if_present() {
debug "Installed package $installed_nevra_new is not older. Not updating."
return 0
fi
"$YUMDNFCMD" -y upgrade ${ALLOWERASING} "$nevra"
"$YUMDNFCMD" -y upgrade "$ALLOWERASING" "$nevra"
if pkg_is_absent "$nevra"; then
echo "Could not update to: $nevra"
return 1
Expand Down

0 comments on commit 6737692

Please sign in to comment.