willeccles / cpm

🌵 A wrapper for package managers to make them consistent for those of us who are lazy.
MIT License
69 stars 13 forks source link

attempt to add Portage(emerge) and some fixes for apk #16

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hey again!

This is an attempt to add Portage (emerge), Gentoo's package manager. Alongside some minor fixes on apk.

PORTAGE NOTES

willeccles commented 4 years ago

Listing installed packages is only doable via an external program (qlist -IRv) or using coreutils

I doubt this could only be done with coreutils or an external program. However, if this external program is likely to be installed, it may be worth using. Could you elaborate?

ghost commented 4 years ago

What's up with the echo here?

It's put as a placeholder. Portage does not have any programs for listing programs by itself.

I doubt this could only be done with coreutils or an external program. However, if this external program is likely to be installed, it may be worth using. Could you elaborate?

Said programs needed would be qlist and eix, most Gentoo users are likely to install them but if needed I could make cpm possibly check for them too. As for why this or coreutils would be the only way is explained above.

willeccles commented 4 years ago

Okay, I think what should be done is to make those two cases multiple lines, so that you end up with something like this:

list)
    if has qlist; then
        # do that here
    elif has otherthing; then
        # do other things here
    else
        >&2 echo "Could not find program1 or program2"
        exit 1
    fi
    ;;
ghost commented 4 years ago

Okay, I think what should be done is to make those two cases multiple lines, so that you end up with something like this:

list)
    if has qlist; then
        # do that here
    elif has otherthing; then
        # do other things here
    else
        >&2 echo "Could not find program1 or program2"
        exit 1
    fi
    ;;

Good idea! Will get started on it.

willeccles commented 4 years ago

In the future, use spaces instead of tabs. However, I will merge this and update it myself, as I am going to add a modeline to all my projects' source files from now on anyway.