Message ID | 20230526120919.82638-1-Vijaikumar_Kanagarajan@mentor.com |
---|---|
State | Accepted |
Headers | show |
Series | core/parser: fix misleading error messages | expand |
On 26.05.23 14:09, Vijai Kumar K wrote: > no-downgrading enforces a minimum version and doesnot reject if the > version is same as the current version. > > Similarly max_version enforces a maximum version and doesnot reject if > the current version is same as the max_version. > > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com> > --- > core/parser.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/core/parser.c b/core/parser.c > index 33d4f2d..50d9957 100644 > --- a/core/parser.c > +++ b/core/parser.c > @@ -213,7 +213,7 @@ int parse(struct swupdate_cfg *sw, const char *descfile) > */ > if (sw->no_downgrading) { > if (compare_versions(sw->version, sw->minimum_version) < 0) { > - ERROR("No downgrading allowed: new version %s <= installed %s", > + ERROR("No downgrading allowed: new version %s < installed %s", > sw->version, sw->minimum_version); > return -EPERM; > } > @@ -226,7 +226,7 @@ int parse(struct swupdate_cfg *sw, const char *descfile) > */ > if (sw->check_max_version) { > if (compare_versions(sw->version, sw->maximum_version) > 0) { > - ERROR("Max version set: new version %s >= max allowed %s", > + ERROR("Max version set: new version %s > max allowed %s", > sw->version, sw->maximum_version); > return -EPERM; > } Correct, thanks for fixing this. Reviewed-by: Stefano Babic <sbabic@denx.de> Best regards, Stefano Babic
diff --git a/core/parser.c b/core/parser.c index 33d4f2d..50d9957 100644 --- a/core/parser.c +++ b/core/parser.c @@ -213,7 +213,7 @@ int parse(struct swupdate_cfg *sw, const char *descfile) */ if (sw->no_downgrading) { if (compare_versions(sw->version, sw->minimum_version) < 0) { - ERROR("No downgrading allowed: new version %s <= installed %s", + ERROR("No downgrading allowed: new version %s < installed %s", sw->version, sw->minimum_version); return -EPERM; } @@ -226,7 +226,7 @@ int parse(struct swupdate_cfg *sw, const char *descfile) */ if (sw->check_max_version) { if (compare_versions(sw->version, sw->maximum_version) > 0) { - ERROR("Max version set: new version %s >= max allowed %s", + ERROR("Max version set: new version %s > max allowed %s", sw->version, sw->maximum_version); return -EPERM; }
no-downgrading enforces a minimum version and doesnot reject if the version is same as the current version. Similarly max_version enforces a maximum version and doesnot reject if the current version is same as the max_version. Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com> --- core/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)