From 09c0dbaedc51359cd4d1145968ff35474c6b5bc7 Mon Sep 17 00:00:00 2001 From: Luke Macken Date: Aug 18 2015 19:18:01 +0000 Subject: Patched to work better against bodhi2 with the latest python-fedora --- diff --git a/0001-Make-the-bodhi-client-properly-print-the-update-afte.patch b/0001-Make-the-bodhi-client-properly-print-the-update-afte.patch new file mode 100644 index 0000000..045ef1a --- /dev/null +++ b/0001-Make-the-bodhi-client-properly-print-the-update-afte.patch @@ -0,0 +1,32 @@ +From 5f4a445b2d5841f77cfa6fe08e4231c205b8f3c9 Mon Sep 17 00:00:00 2001 +From: Luke Macken +Date: Tue, 18 Aug 2015 12:02:46 -0600 +Subject: [PATCH 1/2] Make the bodhi-client properly print the update after + creation with bodhi2 + + +diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py +index 0e636c7..9db535e 100755 +--- a/bodhi/tools/client.py ++++ b/bodhi/tools/client.py +@@ -228,6 +228,8 @@ def main(): + if 'updates' in data: + for update in data['updates']: + print(bodhi.update_str(update).encode("UTF-8")) ++ elif 'title' in data: ++ print(bodhi.update_str(data).encode("UTF-8")) + + else: + builds = ",".join(args) +@@ -252,6 +254,8 @@ def main(): + if 'updates' in data: + for update in data['updates']: + print(bodhi.update_str(update).encode("UTF-8")) ++ elif 'title' in data: ++ print(bodhi.update_str(data).encode("UTF-8")) + + elif opts.edit: + verify_args(args) +-- +2.4.3 + diff --git a/0002-cli-Get-the-queries-working-against-bodhi2.patch b/0002-cli-Get-the-queries-working-against-bodhi2.patch new file mode 100644 index 0000000..060a7fd --- /dev/null +++ b/0002-cli-Get-the-queries-working-against-bodhi2.patch @@ -0,0 +1,28 @@ +From f75ce1ff74f97d0e152d08e36b0efe096d6bfca5 Mon Sep 17 00:00:00 2001 +From: Luke Macken +Date: Tue, 18 Aug 2015 12:16:49 -0600 +Subject: [PATCH 2/2] cli: Get the queries working against bodhi2 + + +diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py +index 9db535e..1296671 100755 +--- a/bodhi/tools/client.py ++++ b/bodhi/tools/client.py +@@ -468,11 +468,12 @@ def main(): + if 'tg_flash' in data and data['tg_flash']: + log.error(data['tg_flash']) + sys.exit(-1) +- if data['num_items'] > 1: ++ total = data.get('num_items', data.get('total', 0)) ++ if total > 1: + for update in data['updates']: + print(bodhi.update_str(update, minimal=True).encode("UTF-8")) + log.info("%d updates found (%d shown)" % ( +- data['num_items'], len(data['updates']))) ++ total, len(data['updates']))) + else: + for update in data['updates']: + print(bodhi.update_str(update).encode("UTF-8")) +-- +2.4.3 + diff --git a/bodhi.patch b/bodhi.patch new file mode 100644 index 0000000..5288709 --- /dev/null +++ b/bodhi.patch @@ -0,0 +1,23 @@ +diff --git a/bodhi/util.py b/bodhi/util.py +index 80c86cd..3d0dd7b 100644 +--- a/bodhi/util.py ++++ b/bodhi/util.py +@@ -28,7 +28,7 @@ import turbogears + + from kid import Element + from yum import repoMDObject +-from yum.misc import checksum ++from yum.misc import checksum, decompress + from os.path import isdir, join, dirname, basename, isfile + from datetime import datetime, timedelta + from decorator import decorator +@@ -469,7 +469,8 @@ def sanity_check_repodata(myurl): + errorstrings.append("checksum: %s" % t) + + if href.find('xml') != -1: +- retcode = subprocess.call(['/usr/bin/xmllint', '--noout', dest]) ++ decompressed = decompress(dest) ++ retcode = subprocess.call(['/usr/bin/xmllint', '--noout', decompressed]) + if retcode != 0: + errorstrings.append("failed xml read: %s" % t) + diff --git a/bodhi.spec b/bodhi.spec index d19611a..2072b69 100644 --- a/bodhi.spec +++ b/bodhi.spec @@ -3,13 +3,16 @@ Name: bodhi Version: 0.9.12.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A modular framework that facilitates publishing software updates Group: Applications/Internet License: GPLv2+ URL: https://fedorahosted.org/bodhi Source0: https://fedorahosted.org/releases/b/o/bodhi/bodhi-%{version}.tar.bz2 +Patch0: 0001-Make-the-bodhi-client-properly-print-the-update-afte.patch +Patch1: 0002-cli-Get-the-queries-working-against-bodhi2.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -79,6 +82,8 @@ updates for a software distribution. %prep %setup -q +%patch0 -p1 +%patch1 -p1 rm -rf bodhi/tests bodhi/tools/test-bodhi.py @@ -134,6 +139,9 @@ rm -rf bodhi/tests bodhi/tools/test-bodhi.py %changelog +* Tue Aug 18 2015 Luke Macken - 0.9.12.2-3 +- Patched to work better against bodhi2 with the latest python-fedora + * Wed Jun 17 2015 Fedora Release Engineering - 0.9.12.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild