Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add yum -Qe #204

Merged
merged 3 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/yum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ yum_Q() {
fi
}

yum_Qe() {
# in Centos8, repoquery takes 'reason' as format placeholder
centos_version="$($GREP -ohP '(?<=VERSION_ID=")([^"]+)(?=")' /etc/*elease)"
[ "$centos_version" -eq "8" ] && reason="reason" || reason="yumdb_info.reason"

repoquery --installed --qf "%{name} - %{$reason}" --all \
| $GREP 'user$' | cut -d' ' -f1
}

yum_Qi() {
yum info "$@"
}
Expand Down
6 changes: 3 additions & 3 deletions tests/swupd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ im clearlinux:base clearlinux:latest

# Update
in -Su
ou ^Update complete - System already up-to-date
ou ^Update (complete - System already up-to-date|started)
in -Suy
ou ^Update complete - System already up-to-date
ou ^Update (complete - System already up-to-date|started)
in -Sy
ou ^Update complete - System already up-to-date
ou ^Update (complete - System already up-to-date|started)

# Install package (os-core-search needed for searching capabilities)
in -S os-core-search
Expand Down
5 changes: 5 additions & 0 deletions tests/yum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ ou ^Installed:$
in ! command -v nano
ou ^(/usr)?/bin/nano$

# List packages installed explicitly
in -Qe
ou ^nano$
ou ^yum-utils$

# Cache cleaning
in -Sc
ou ^[0-9]+( metadata)? files* removed$
Expand Down