bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
605 stars 64 forks source link

pmm: Implement list upgradable packages #156

Closed NICHOLAS85 closed 4 years ago

NICHOLAS85 commented 4 years ago

This is going to be updated as I have the time to test and implement it across all the package managers. Currently, it simply prints the package name prepended by :. ie:

$ # Apt user interface
$ pmm list --upgradable
* strat -r debian apt-get -smV --no-download dist-upgrade | awk '/=>/{print$1}'
debian:apt      qt5-default
debian:apt      qt5-qmake
debian:apt      qt5-qmake-bin
debian:apt      qtbase5-dev
debian:apt      qtbase5-dev-tools
* strat -r arch pacman -Qu | cut -d' ' -f1
arch:pacman     python
arch:pacman     python-setuptools
arch:pacman     python-six
arch:pacman     python2-setuptools
arch:pacman     python2-six

A question I have is whether or not version information should be included as well and how that should be standardized. (0.84.8 => 0.90 or 0.84.8 -> 0.90, etc)

paradigm commented 4 years ago

Looks good so far!

A question I have is whether or not version information should be included as well and how that should be standardized. (0.84.8 => 0.90 or 0.84.8 -> 0.90, etc)

I did some testing in pre-beta pmm outputting version information in a third column for various commands to better match expectations from commands like dpkg -l and pacman -Q. I found:

I concluded it's not worthwhile, and dropped it from every operation. I'm inclined to just continue the pattern of leaving it out of this one as well. That having been said, I'm open to counter arguments if you disagree.

NICHOLAS85 commented 4 years ago

We'd have to wait and see if people's expectations warrant a change in behavior, but for now, from your points, I'd agree that it can be left out.

NICHOLAS85 commented 4 years ago

Currently waiting on some updates to hit my machine to test implementing this for the xbps package manager. This was a fun little project, I learned a lot about how these other package managers work! I hope you find the current implementations adequate. I'm going to be looking into the package name filtering to make sure they're foolproof.

paradigm commented 4 years ago

I like everything I'm seeing so far. It's nice to see that pmm's configuration design is intuitive enough that others can pick it up without documentation or hand holding. I'm glad you're enjoying working on it. There's no rush; if this isn't ready by the time pmm leaves beta we can always just make it a 0.7.x update following. Nothing is blocked on it.

NICHOLAS85 commented 4 years ago

Implemented in all package managers now! The only issue I could see is in portage and xbps when printing packages which contain version info in their names (Due to using -[0-9] as a delimiter). For example with xbps boost-python3-1.72-1.72.0_1 prints as boost-python3 instead of boost-python3-1.72. I have only been able to find this example in Void repos and none so far in Gentoos so it may be an insignificant issue. If you know of a better way of filtering for those feel free to share.

NICHOLAS85 commented 4 years ago

I've used a different filter which cuts everything after the last -[0-9] match in xbps and prints between the first / and last -[0-9] in portage. That should cover the issue I pointed out ealier.

NICHOLAS85 commented 4 years ago

Noting the following commands have issues when placed into the pmm config files

sed 's/.*\/\(.*\)-[0-9].*/\1/;t;d' 
sed 's|\(.*\)-.*|\1|'

Their current sed -E adaptations can't be used.

NICHOLAS85 commented 4 years ago

Closing for now, will come back once --standardize/--pass-through is being looked at again as a pmm flag.