Skip to content

Commit

Permalink
feat: add rpm-ostree support (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
atillart-one committed May 9, 2023
1 parent 107cc12 commit c3eb7f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ sudo make install
- MacPorts (macOS)
- pacman (Arch)
- pkg (FreeBSD and OpenBSD)
- rpm-ostree (Fedora Silverblue)
- slackpkg (Slackware)
- sorcery (Source Mage)
- urpmi (Mageia)
Expand Down
19 changes: 19 additions & 0 deletions cpm
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,22 @@ _dnf() {
esac
}

_rpm_ostree() {
case "$OP" in
install) rpm-ostree install "$@";;
remove) rpm-ostree uninstall "$@";;
list) rpm -qa;;
count) rpm -qa | tot;;
update) rpm-ostree update;;
upgrade) rpm-ostree upgrade;;
search) pem "unsupported: this feature is currently unavailable in this PM";;
show) rpm -qi "$@";;
files) rpm -ql "$@";;
from) rpm -q --whatprovides "$@";;
clean) rpm-ostree cleanup --rollback;;
esac
}

_pacman() {
case "$OP" in
install) su_do pacman -S "$@";;
Expand Down Expand Up @@ -499,6 +515,9 @@ elif ! [ "$(uname -s)" = "Darwin" ]; then
elif has dnf; then
# fedora
_dnf "$@"
elif has rpm-ostree; then
# fedora silverblue
_rpm_ostree "$@"
elif has pacman-key; then
# arch/manjaro
_pacman "$@"
Expand Down

0 comments on commit c3eb7f3

Please sign in to comment.