repo: Reword min-free-space-size option's error strings

It is important that we use user-friendly error strings. The reason
being error strings are seen by users such as in GNOME Software's
error banner.

Closes: #1671
Approved by: jlebon
This commit is contained in:
Umang Jain 2018-07-05 17:07:34 +05:30 committed by Atomic Bot
parent 4c023a9585
commit eeacbc6b29

View File

@ -2670,7 +2670,7 @@ min_free_space_size_validate_and_convert (OstreeRepo *self,
g_autoptr(GMatchInfo) match = NULL;
if (!g_regex_match (regex, min_free_space_size_str, 0, &match))
return glnx_throw (error, "Failed to match '^[0-9]+[GMT]B$'");
return glnx_throw (error, "It should be of the format '123MB', '123GB' or '123TB'");
g_autofree char *size_str = g_match_info_fetch (match, 1);
g_autofree char *unit = g_match_info_fetch (match, 2);
@ -2693,7 +2693,7 @@ min_free_space_size_validate_and_convert (OstreeRepo *self,
guint64 min_free_space = g_ascii_strtoull (size_str, NULL, 10);
if (shifts > 0 && g_bit_nth_lsf (min_free_space, 63 - shifts) != -1)
return glnx_throw (error, "Integer overflow detected");
return glnx_throw (error, "Value was too high");
self->min_free_space_mb = min_free_space << shifts;