New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ynh_check_app_version_changed #521

Open
wants to merge 3 commits into
base: stretch-unstable
from

Conversation

Projects
None yet
4 participants
@maniackcrudelis
Copy link
Contributor

maniackcrudelis commented Aug 27, 2018

The problem

During the upgrade of an app, the app itself and the package are always upgraded, even if no upgrade is really needed.

Solution

  • Add the new helper ynh_check_app_version_changed to check the version before an upgrade
  • Add also the helpers ynh_read_manifest, ynh_app_upstream_version and ynh_app_package_version.
  • These previous helper have been modified (from the experimental version) to support getopts
  • ynh_check_app_version_changed has been modified to use ynh_app_upstream_version

PR Status

Ready to be reviewed

How to test

Use ynh_check_app_version_changed in a package.

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :
Add ynh_check_app_version_changed
- Add the new helper ynh_check_app_version_changed to check the version before an upgrade
- Add also the helpers ynh_read_manifest, ynh_app_upstream_version and ynh_app_package_version.
- These previous helper have been modified (from the experimental version) to support getopts
- ynh_check_app_version_changed has been modified to use ynh_app_upstream_version
# Manage arguments with getopts
ynh_handle_getopts_args "$@"

python3 -c "import sys, json;print(json.load(open('$manifest', encoding='utf-8'))['$manifest_key'])"

This comment has been minimized.

@Psycojoker

Psycojoker Aug 28, 2018

Member

We should probably just bundle jq with YunoHost, that would make things easier (quite minor difference I know).

It's packaged into debian.

This comment has been minimized.

@Psycojoker

Psycojoker Aug 28, 2018

Member

Other comment: do we have a guarantee that python THREE is installed? We don't use it in YunoHost I think 🤔

This comment has been minimized.

@maniackcrudelis

maniackcrudelis Aug 28, 2018

Contributor

I've no idea...
This helper isn't from me. I'd rather prefer a good old "grep | cut" which is faster than that.
But, this helper is already used by some apps, and it seems to work fine so far.

This comment has been minimized.

@Josue-T

Josue-T Aug 28, 2018

Contributor

Mybe jq could also fix definitely any problem about encoding. I rememberer I had some problem about encoding in synapse (this problem is solved by encoding='utf-8') and it's why I decided to use python3 which has a better support of encoding.

This comment has been minimized.

@Psycojoker

Psycojoker Aug 31, 2018

Member

jq is now a dependacy of yunohost if you wish to uses it #532

[fix] Replace manifest_path by manifest
manifest_path isn't defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment