r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.35k stars 160 forks source link

Add support for AppImage packages #814

Closed p-bo closed 2 years ago

p-bo commented 2 years ago

I want to suggest a new step Updating AppImage packages

Which tool is this about? Where is its repository? AppImageUpdate https://github.com/AppImage/AppImageUpdate

Which operating systems are supported by this tool? Linux

What should Topgrade do to figure out if the tool needs to be invoked?

Which exact commands should Topgrade run?

I want to suggest some general feature Topgrade should...

More information

MCOfficer commented 2 years ago

I see it has a minimal CLI, but how would one use this to update AppImages? Can you provide an example?

p-bo commented 2 years ago

What about (roughly):

Does it make sense?

p-bo commented 2 years ago

P.S.: as first thing, do --self-update ;-)

MCOfficer commented 2 years ago

What about (roughly):

* collect list of .AppImage files (along with their paths, if not in single place - se 2nd option on next line)
  Either from directory/directories, defined in config file or trough searching - some quick one, *locate perhaps? - trough user home dir and possibly others (configured?) for system wide installs (would need elevated privileges in update/replacement step then)

* run --check-for-update for every .AppImage from above list and save list of all with get exist status 1 (update available)

* run --describe for every .AppImage from more refined list from step above => get zsync URL from this for each

* use these URLs to download fresh .AppImage packages

* remove old versions after successful update (perhaps make configurable?)

Does it make sense?

Ah. I was under the impression that we could use the linked updater, not implement the update process itself. Not sure if this belongs in topgrade tbh, this is exactly the kind of behavior I would've expected to be built into the updater.

p-bo commented 2 years ago

I see. But given how many sources of software components topgrade supports, it is sad that AppImage is missing among them. Must admit, that from top of my head I don't know about some other, more handful cli tool for this (mentioned appimageupdatetool seems to originated from .AppImage format authors). Maybe some clever approach could be inspired from how this gui app is managing updates? : https://github.com/prateekmedia/appimagepool

p-bo commented 2 years ago

This: https://docs.appimage.org/packaging-guide/optional/updates.html#using-libappimageupdate-within-app-store-like-applications

libappimageupdate provides a class called appimage::update::Updater capable of updating a single AppImage. It contains features like an update check, running updates in a separate thread, a status message system, progress indicator support and a lot more.

MCOfficer commented 2 years ago

I see. But given how many sources of software components topgrade supports, it is sad that AppImage is missing among them. Must admit, that from top of my head I don't know about some other, more handful cli tool for this (mentioned appimageupdatetool seems to originated from .AppImage format authors). Maybe some clever approach could be inspired from how this gui app is managing updates? : prateekmedia/appimagepool

That just appears to implement it itself, too :/

This: docs.appimage.org/packaging-guide/optional/updates.html#using-libappimageupdate-within-app-store-like-applications

libappimageupdate provides a class called appimage::update::Updater capable of updating a single AppImage. It contains features like an update check, running updates in a separate thread, a status message system, progress indicator support and a lot more.

Possible, but would require C++ binding, so effort as well.

I'm not saying a PR containing this would be rejected, but I know that I wouldn't work on a bespoke update implementation. It would be much easier if AppImageUpdate just exposed the method they have already implemented over the CLI.

(Just for the record, this isn't my call. Just telling you which way i see the wind blowing)

p-bo commented 2 years ago

Tried to ask AppImageUpdater authors regarding this - see mention above.

MCOfficer commented 2 years ago

Tried to ask AppImageUpdater authors regarding this - see mention above.

Well that's an RTFM on our part, lol. Thanks for clearing this up.

Next question: how do we find this tool and all appimages that need updating? searching the entire filesystem for appimages is probably out of the question, so there's got to be either