Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix ynh_check_app_version_changed behavior #756
ynh_check_app_version_changed does not kill the upgrade when the app is up to date.
A subshell can't exit its parent shell, unless with a kill of the parent. Which would be a parricide, not cool...
About the main issue, there's no proper way to exit the parent.
Which means we wouldn't use
Or we could use the way I used here, return a value that says that the app is up to date.
Both solutions work, the first one is lighter for the upgrade script, as you can just change the line, but will exit immediately the script, as it was supposed to be.
Which solution would you prefer ?
Tested with both solutions, only the second one is implement here.
How to test
Returning a value seems good to me and allows us not to have too much work on all the packages. BUT, check the version of the package before (in python then?) might be better to get a simpler upgrade script.
Hum, in both cases we have a value containing the status of the package.
Yeah, the thing is that maybe not all apps currently implement this mechanism (or don't want to have it enabled)
We could choose to impose this behavior to all apps though... Or have an option in the manifest like
Anyway for the current PR, naively this
What I'm thinking about is if people did stuff like
then if this grep doesn't find any match, it would make the whole script crash ...? Are we 100% confident that there's no situation like this in the helpers and app script ? (I really don't know