Skip to content

Commit

Permalink
tolerate name/epoch switcheroo in versionlock command
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
  • Loading branch information
dims committed Jul 9, 2023
1 parent 2c41c1a commit f3e568b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ fi
echo "Verifying that the package versionlocks are correct..."

function versionlock-entries() {
# the format of this output is EPOCH:NAME-VERSION-RELEASE.ARCH
# more info in yum-versionlock(1)
# rpm doesn't accept EPOCH when querying the db, so remove it
yum versionlock list --quiet | cut -d ':' -f2
if [ -f "/etc/dnf/plugins/versionlock.conf" ]; then
# the format of this output in al2023 is NAME-EPOCH:VERSION-RELEASE.ARCH
# rpm works fine with this format
yum versionlock list --quiet
else
# the format of this output is EPOCH:NAME-VERSION-RELEASE.ARCH
# more info in yum-versionlock(1)
# rpm doesn't accept EPOCH when querying the db, so remove it
yum versionlock list --quiet | cut -d ':' -f2
fi
}

function versionlock-packages() {
Expand Down

0 comments on commit f3e568b

Please sign in to comment.