Version bumping snaps that have a monitor.sh

Hi there,

I’m just running through a few of the snaps in the repo to test the new version of snapcraft. It came to light that there are a few packages that need to be staged. I figure that If I am going to do a PR to fix the staged packages, I may as well version bump the package if needed (i.e. atom editor).

Now I have seen a few of the repos have a monitor.sh, and *.yaml.in file, etc. Does the monitor script get called during the build? Or how is this intended to be completed?

I just wanted to understand the process and relationship when updating these packages. In some testing, I can see that monitor.sh obviously does a version check and creates a new snapcraft.yaml. But I know I would not want to do a PR with the final yaml (since it will break the monitor.sh script for later builds)

I think Martin wrote those (I might be wrong) so I’ll cc him to get his attention :slight_smile:

cc/ @Wimpress

Yep, those monitor.sh scripts are my doing.

They were used when we originally had stuff hooked up in Launchpad directly. @popey and I are migrating the logic from monitor.sh to scriptlets in the yaml (see Discord) so that versions are derived during the build.

1 Like

Those version scripts @popey invented to do this are voodoo!

1 Like

Yeah, we should a) migrate apps to automagically figuring out version numbers like discord does and b) remove the legacy monitor stuff. Discord was made easier because they have a redirector which always goes to the latest deb that we consume. For applications which don’t have that, but instead just put the latest release on their releases page on github (hello atom) it’s a little more tricky. I think it’s probably still do-able but needs more curl and awk and sed than I’d been willing to commit to so far :slight_smile:

OK, so in theory, the one such as Atom need to be migrated over to follow the same pattern as Discord. Once I get some time I may have a crack at it if they are not yet done.

I have to get through the Krita snap and Budgie welcome first.

Appreciate the info.

I sort of did something similar in some installer scripts I used to use. But I found that it really depended on how the download URL returned results.

Sample here… Maybe not the most elegant way though.