willeccles / cpm

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

from: fallback to command for non-existent files #51

Closed eepykate closed 2 years ago

eepykate commented 2 years ago

example (From a dir without that filename): cpm f test will be replaced with cpm f /bin/test, which will probably be coreutils.

eepykate commented 2 years ago

every package manager benefits from both symlink resolution

like... no? ​ It's just xbps that needs it.

and your patch

Does in this patch too, just without it being a constant downgrade.

you can use the PM directly

It's literally a feature that cpm already supports, why are you suggesting "don't use cpm for something that it supports which doesn't go against its philosophy so i can downgrade it for no sane reason"

If you also want to make it work for multiple arguments, you can do that, too. Just don't do it for PMs which only support one.

I have no idea what you mean with this, but tbh I'm done, it's clear that you just want to downgrade it.

willeccles commented 2 years ago

like... no? ​ It's just xbps that needs it.

Some package managers may return the "wrong" package if the target file is a symlink. While it may point to a file installed by another package (and which you are almost certainly looking for), you will get the package that installed the symlink, which may not be the same. It's a very rare case that you'd be interested in which package installed the symlink.

I have no idea what you mean with this, but tbh I'm done, it's clear that you just want to downgrade it.

If you want to allow multiple arguments, at least make your patch actually handle this case. If you added it to the resolve function and used that for every PM, you could make it support multiple arguments there, too, if you wanted. Just don't use $@ for (for example) xbps, which only allows one argument. I'm not sure why this is so difficult.

willeccles commented 2 years ago

I'd be willing to merge even if you didn't use resolve for everything, but at the very least make your fix work for all arguments rather than just the first one.