summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2010-02-17 04:07:40 +0100
committerVincent Untz <vuntz@gnome.org>2010-03-10 03:29:52 +0100
commit0a2a429ca2943f7b329d9a90f4950588a56f9f15 (patch)
tree5f00513683b7e3b1fd046aaf00a5262383baf80e
parentbaf763143043b9be48ef8dc8bf7050f418aa0bb2 (diff)
Make some of the new errors non-fatal for now
Making errors introduced in a release fatal will annoy many people. They're still marked as errors and will be visible (so fixable), but they won't make the program return 1, so people can still work. They should be marked as fatal after the release.
-rw-r--r--src/validate.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/validate.c b/src/validate.c
index fa92ef4..cb04061 100644
--- a/src/validate.c
+++ b/src/validate.c
@@ -510,6 +510,23 @@ print_fatal (kf_validator *kf, const char *format, ...)
}
static void
+print_future_fatal (kf_validator *kf, const char *format, ...)
+{
+ va_list args;
+ gchar *str;
+
+ g_return_if_fail (kf != NULL && format != NULL);
+
+ va_start (args, format);
+ str = g_strdup_vprintf (format, args);
+ va_end (args);
+
+ g_print ("%s: error: (will be fatal in the future): %s", kf->filename, str);
+
+ g_free (str);
+}
+
+static void
print_warning (kf_validator *kf, const char *format, ...)
{
va_list args;
@@ -1453,11 +1470,11 @@ handle_categories_key (kf_validator *kf,
g_string_append_printf (output_required, ", or %s",
registered_categories[j].requires[k]);
- print_fatal (kf, "value \"%s\" in key \"%s\" in group \"%s\" "
- "requires another category to be present among the "
- "following categories: %s\n",
- categories[i], locale_key, kf->current_group,
- output_required->str);
+ print_future_fatal (kf, "value \"%s\" in key \"%s\" in group \"%s\" "
+ "requires another category to be present among the "
+ "following categories: %s\n",
+ categories[i], locale_key, kf->current_group,
+ output_required->str);
g_string_free (output_required, TRUE);
retval = FALSE;
@@ -1469,9 +1486,9 @@ handle_categories_key (kf_validator *kf,
g_hash_table_destroy (hashtable);
if (!main_category_present) {
- print_fatal (kf, "value \"%s\" for key \"%s\" in group \"%s\" "
- "does not contain a registered main category\n",
- value, locale_key, kf->current_group, categories[i]);
+ print_future_fatal (kf, "value \"%s\" for key \"%s\" in group \"%s\" "
+ "does not contain a registered main category\n",
+ value, locale_key, kf->current_group, categories[i]);
retval = FALSE;
}