I-Dream-in-Code / kde-arch-update-plasmoid

30 stars 9 forks source link

How about Yakauake #1

Closed el-dot closed 6 years ago

el-dot commented 6 years ago

How about ability to use yaourt for update check? Just config with custom command would be enough.

If you're wondering why I see it useful: yaourt allows to check also AUR packages updates and perform upgrades on them easily.

I-Dream-in-Code commented 6 years ago

I'll look into it. I was debating between yaourt vs apacman vs others.

I need to be sure that it can display version upgrade numbers. If it can I'll start the new branch.

What I don't want is people asking for everyone's favorite AUR helper to add compatability, ya know?

el-dot commented 6 years ago

Yeah, I see. But with custom command approach, you can specify format (csv maybe?) you expect from command given by user. This way one can leverage bash pipelines (and tools like cut and awk of course) to transform almost any tool output to work with your notifier. And still you don't support directly any tool, so the "everyone's favorite helper problem" won't be the case.

How about that?

I-Dream-in-Code commented 6 years ago

Sounds worthwhile to look into.

But like I said it needs to be able to display upgraded version numbers.

el-dot commented 6 years ago

Ok, so you can specify that command should return csv in format "package, version" or "package, oldversion, newversion". And all fields are required. Then the problem is on the side of the user to provide this format from command he types in plasmoid setting :)

I-Dream-in-Code commented 6 years ago

Actually he doesn't have to

If you look at my settings now it's just a check box to hide version number.

That's all it needs to be and doesn't need to change.

Even if it did I just add a few more check boxes and run a Boolean test to figure out the right one

I-Dream-in-Code commented 6 years ago

Or I can do an ordered selection box that creates the order for me with some backend magic :)

I-Dream-in-Code commented 6 years ago

Okay so I figured out how to do it I think

ls /usr/bin | egrep '(yaourt|apacman...)' | head -n1 shows which package manager they have

Using the -Qu flag shows the list with upgraded version numbers

As long as I can format the output like the checkupdates command normally outputs it's really easy to implement

I-Dream-in-Code commented 6 years ago

So apacman can't distinguish new package version numbers

yaourt can do -Qua flag and it shows it fine

apacman's --auronly only works with -Syyu for some stupid reason

this is honestly why I didn't do it in the first place since I'd be fighting with 20 different syntaxes that stupidly won't work with the -Qu flag

I-Dream-in-Code commented 6 years ago

The only semi-plausible way would be to do a for loop that runs -Ss on each individual package that's in the AUR

depending on the format it's aur/*package name* current version # (not a uniform format) installed: *current version*

So I'd have to parse the output for 3 things in some complicated regex that has ZERO uniformity and honestly would take forever

I-Dream-in-Code commented 6 years ago

if you feel like testing it out and giving me some benchmarks:

pacman -Qm lists all foreign packages

create a bash script that runs a for/do while from stdin newline separated packages that calls any package manager -Ss

apacman -Ss plasma5-applets-kde-arch-update-notifier-git: returns aur/plasma5-applets-kde-arch-update-notifier-git 2.1-1 [installed: 1-1] (2) `

yaourt -Ss plasma5-applets-kde-arch-update-notifier-git: returns aur/plasma5-applets-kde-arch-update-notifier-git 2.1-1 [installed: 1-1] (2) (0.72)

Also the 26 AUR helpers list on arch wiki need to all return the same result of:

package_name current_version new_version

I-Dream-in-Code commented 6 years ago

The only viable option is adding yaourt only

I-Dream-in-Code commented 6 years ago

please see #2 for updates AUR support