appimagetool icon indicating copy to clipboard operation
appimagetool copied to clipboard

Extend `updateinformation` to specify .AppImage path in .zsync file

Open brunvonlope opened this issue 10 months ago • 3 comments

If I understood correctly the .zsync files generated by appimagetool, all of them points to the .AppImage file in the same dir, which is natural. In GIMP case, that would be: https://download.gimp.org/gimp/v3.0/linux/GIMP-Stable-${ARCH}.AppImage.zsync

The problem is, in that example, the .zsync files are inside a versioned subdirectory (gimp/v3.0/linux) so the .zsync URL is not generic and .appimages willn't update between minor versions of the same stable channel (e.g. from 3.0 to 3.2 and so on).

So the ideal .zsync placement for our case would be: https://download.gimp.org/gimp/GIMP-Stable-${ARCH}.AppImage.zsync. But then we can't update at all since the .zsync file is pointing to an .AppImage file in the same gimp dir, not to gimp/v3.0/linux.


To fix this problem, since it's very unlikely that GIMP devs will change the whole server dirs structure, I propose to enhance updateinformation allowing to point to a relative path of the .AppImage file if needed. Something like:

-updateinformation zsync|zsync_path|optional_appimage_path

brunvonlope avatar Feb 07 '25 14:02 brunvonlope

the .zsync files generated by appimagetool, all of them points to the .AppImage file in the same dir, which is natural.

Not sure what you mean by same dir? The zsync file gets generated by running zsyncmake *.AppImage -u *.AppImage on the produced appimage.

The updateinformation, which tells appimageupdatetool where to find the zsync url, is embedded in the runtime, and as far as I know you can put anything you want in it, as long as appimageupdatetool finds a valid url that is.

Outside of github the update information ends up looking like this:

zsync|https://link/to/AppImage.zsync

So as long as that url points to the latests zsync file for the specific appimage that's all that needs to be done. With github you can specify tags and all of that, and also simple globbing for the AppImage file name, not sure if this is supported outside of github by appimageupdatetool

Samueru-sama avatar Feb 07 '25 19:02 Samueru-sama

Not sure what you mean by same dir?

@Samueru-sama I mean the dir of the .zsync file, which is the same as the .appimage file. On zsync header, I think it is the URL line:

zsync: 0.6.2
...
URL: GIMP-2.99.18-x86_64.AppImage

brunvonlope avatar Feb 07 '25 19:02 brunvonlope

You can just update the URL in the .zsync file as well. It can be both relative and absolute. The value inserted is just a default.

Edit: in your case, something like this should work:

URL: https://download.gimp.org/gimp/v3.0/linux/GIMP-Stable-${ARCH}.AppImage.zsync
URL: v3.0/linux/GIMP-Stable-${ARCH}.AppImage.zsync

Edit 2: alternatively, if you do not feel like patching this semi-text, semi-binary file, you can just re-generate the .zsync file with zsyncmake (part of the zsync package) or our own zsync2make, which both support specifying a URL manually. The result would be the same.

TheAssassin avatar Feb 07 '25 21:02 TheAssassin