Blob Blame Raw
From 6171adb8111747550e5093cd673e2f254ec1b7c9 Mon Sep 17 00:00:00 2001
From: Matej Habrnal <mhabrnal@redhat.com>
Date: Wed, 26 Aug 2015 13:18:26 +0200
Subject: [PATCH] bodhi: add ignoring of Rawhide

Resolves: rhbz#1256493

Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
---
 src/plugins/bodhi.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/plugins/bodhi.c b/src/plugins/bodhi.c
index 831f5ff..9149347 100644
--- a/src/plugins/bodhi.c
+++ b/src/plugins/bodhi.c
@@ -422,6 +422,10 @@ int main(int argc, char **argv)
     {
         if (release)
         {
+            /* There are no bodhi updates for Rawhide */
+            if (strcasecmp(release, "rawhide") == 0)
+                error_msg_and_die("Reselase \"%s\" is not supported",release);
+
             query = strbuf_append_strf(query, "releases=%s&", release);
         }
         else
@@ -439,10 +443,21 @@ int main(int argc, char **argv)
             map_string_t *osinfo = new_map_string();
             problem_data_get_osinfo(problem_data, osinfo);
             parse_osinfo_for_rhts(osinfo, &product, &version);
-            query = strbuf_append_strf(query, "releases=f%s&", version);
+
+            /* There are no bodhi updates for Rawhide */
+            bool rawhide = strcasecmp(release, "rawhide") == 0;
+            if (!rawhide)
+                query = strbuf_append_strf(query, "releases=f%s&", version);
+
             free(product);
             free(version);
             free_map_string(osinfo);
+
+            if (rawhide)
+            {
+                strbuf_free(query);
+                error_msg_and_die("Reselase \"Rawhide\" is not supported");
+            }
         }
     }
 
-- 
2.5.0