Blame SOURCES/0001-trivial-Return-a-sensible-error-if-DownloadURI-is-in.patch

af0569
From df5652ffb55974c3153fd0a66a2ac606bd46cfc5 Mon Sep 17 00:00:00 2001
af0569
From: Richard Hughes <richard@hughsie.com>
af0569
Date: Mon, 8 May 2017 19:06:08 +0100
af0569
Subject: [PATCH] trivial: Return a sensible error if DownloadURI is
af0569
 intentionaly left blank
af0569
af0569
---
af0569
 src/fu-util.c | 9 +++++++++
af0569
 1 file changed, 9 insertions(+)
af0569
af0569
diff --git a/src/fu-util.c b/src/fu-util.c
af0569
index 677cc7a..d24e46e 100644
af0569
--- a/src/fu-util.c
af0569
+++ b/src/fu-util.c
af0569
@@ -697,6 +697,15 @@ fu_util_download_metadata (FuUtilPrivate *priv, GError **error)
af0569
 	data_uri = g_key_file_get_string (config, "fwupd", "DownloadURI", error);
af0569
 	if (data_uri == NULL)
af0569
 		return FALSE;
af0569
+	if (data_uri[0] == '\0') {
af0569
+		g_set_error (error,
af0569
+			     FWUPD_ERROR,
af0569
+			     FWUPD_ERROR_NOT_SUPPORTED,
af0569
+			     "Nothing set as DownloadURI in %s",
af0569
+			     config_fn);
af0569
+		return FALSE;
af0569
+
af0569
+	}
af0569
 	sig_uri = g_strdup_printf ("%s.asc", data_uri);
af0569
 	data_fn = g_build_filename (cache_dir, "firmware.xml.gz", NULL);
af0569
 	sig_fn = g_strdup_printf ("%s.asc", data_fn);
af0569
-- 
af0569
2.12.2
af0569