From 04bc6d458d749611ace37e4782a1d6eafab73d1a Mon Sep 17 00:00:00 2001 From: Ville-Pekka Vainio Date: Aug 23 2010 08:35:27 +0000 Subject: - Add patches to fix two Fedora bugs, #620584 (problems with the episode list) and #619295 (database ProgrammingError) --- diff --git a/gpodder.git-6a2c1baf.patch b/gpodder.git-6a2c1baf.patch new file mode 100644 index 0000000..b1854c3 --- /dev/null +++ b/gpodder.git-6a2c1baf.patch @@ -0,0 +1,83 @@ +From 6a2c1bafbf50bdb48b3479550c9466f9614ab74b Mon Sep 17 00:00:00 2001 +From: Thomas Perl +Date: Fri, 20 Aug 2010 23:59:24 +0200 +Subject: [PATCH] Always initialize model rows (bug 1099) + +Don't append columns and add data later, but +inject valid data at append time to avoid race +conditions when trying to read data after the +append but before data has been filled in. +--- + src/gpodder/gtkui/model.py | 43 ++++++++++++++++++++++--------------------- + 1 files changed, 22 insertions(+), 21 deletions(-) + +diff --git a/src/gpodder/gtkui/model.py b/src/gpodder/gtkui/model.py +index 81d9209..abbb9ba 100644 +--- a/src/gpodder/gtkui/model.py ++++ b/src/gpodder/gtkui/model.py +@@ -181,13 +181,18 @@ class EpisodeListModel(gtk.ListStore): + count = len(episodes) + + for position, episode in enumerate(episodes): +- iter = self.append() +- self.set(iter, \ +- self.C_URL, episode.url, \ +- self.C_TITLE, episode.title, \ +- self.C_FILESIZE_TEXT, self._format_filesize(episode), \ +- self.C_EPISODE, episode, \ +- self.C_PUBLISHED_TEXT, episode.cute_pubdate()) ++ iter = self.append((episode.url, \ ++ episode.title, \ ++ self._format_filesize(episode), \ ++ episode, \ ++ None, \ ++ episode.cute_pubdate(), \ ++ '', \ ++ '', \ ++ True, \ ++ True, \ ++ True)) ++ + self.update_by_iter(iter, downloading, include_description, \ + generate_thumbnails, reload_from_db=False) + +@@ -646,26 +651,22 @@ class PodcastListModel(gtk.ListStore): + # Clear the model and update the list of podcasts + self.clear() + ++ def channel_to_row(channel): ++ return (channel.url, '', '', None, channel, \ ++ self._get_cover_image(channel), '', True, True, True, \ ++ True, True, False) ++ + if config.podcast_list_view_all and channels: + all_episodes = PodcastChannelProxy(db, config, channels) +- iter = self.append() +- self.set(iter, \ +- self.C_URL, all_episodes.url, \ +- self.C_CHANNEL, all_episodes, \ +- self.C_COVER, self._get_cover_image(all_episodes), \ +- self.C_SEPARATOR, False) ++ iter = self.append(channel_to_row(all_episodes)) + self.update_by_iter(iter) + +- iter = self.append() +- self.set(iter, self.C_SEPARATOR, True) ++ # Separator item ++ self.append(('', '', '', None, None, None, '', True, True, \ ++ True, True, True, True)) + + for channel in channels: +- iter = self.append() +- self.set(iter, \ +- self.C_URL, channel.url, \ +- self.C_CHANNEL, channel, \ +- self.C_COVER, self._get_cover_image(channel), \ +- self.C_SEPARATOR, False) ++ iter = self.append(channel_to_row(channel)) + self.update_by_iter(iter) + + def get_filter_path_from_url(self, url): +-- +1.6.5.GIT + diff --git a/gpodder.git-92bf1255c432510f0c3b767d6c928e4e7e68de95.patch b/gpodder.git-92bf1255c432510f0c3b767d6c928e4e7e68de95.patch new file mode 100644 index 0000000..c2bd7c2 --- /dev/null +++ b/gpodder.git-92bf1255c432510f0c3b767d6c928e4e7e68de95.patch @@ -0,0 +1,57 @@ +From 92bf1255c432510f0c3b767d6c928e4e7e68de95 Mon Sep 17 00:00:00 2001 +From: Ville-Pekka Vainio +Date: Thu, 29 Jul 2010 22:58:13 +0300 +Subject: [PATCH] minidb: Convert values in remove (RH bug 619295, gpo bug 1088) + +Make convert an instance method and +convert the values in remove too. + +See also: +RedHat bug 619295 and gPodder bug 1088 +--- + src/gpodder/minidb.py | 15 ++++++++------- + 1 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/src/gpodder/minidb.py b/src/gpodder/minidb.py +index 6026c9f..8c7ae53 100644 +--- a/src/gpodder/minidb.py ++++ b/src/gpodder/minidb.py +@@ -81,6 +81,12 @@ class Store(object): + self.db.execute('CREATE TABLE %s (%s)' % (table, + ', '.join('%s TEXT'%s for s in slots))) + ++ def convert(self, v): ++ if isinstance(v, str) or isinstance(v, unicode): ++ return v ++ else: ++ return str(v) ++ + def update(self, o, **kwargs): + self.remove(o) + for k, v in kwargs.items(): +@@ -100,12 +106,7 @@ class Store(object): + # Only save values that have values set (non-None values) + slots = [s for s in slots if getattr(o, s, None) is not None] + +- def convert(v): +- if isinstance(v, str) or isinstance(v, unicode): +- return v +- else: +- return str(v) +- values = [convert(getattr(o, slot)) for slot in slots] ++ values = [self.convert(getattr(o, slot)) for slot in slots] + self.db.execute('INSERT INTO %s (%s) VALUES (%s)' % (table, + ', '.join(slots), ', '.join('?'*len(slots))), values) + +@@ -135,7 +136,7 @@ class Store(object): + # Use "None" as wildcard selector in remove actions + slots = [s for s in slots if getattr(o, s, None) is not None] + +- values = [getattr(o, slot) for slot in slots] ++ values = [self.convert(getattr(o, slot)) for slot in slots] + self.db.execute('DELETE FROM %s WHERE %s' % (table, + ' AND '.join('%s=?'%s for s in slots)), values) + +-- +1.6.5.GIT + diff --git a/gpodder.spec b/gpodder.spec index 5b71c7f..07ba6c6 100644 --- a/gpodder.spec +++ b/gpodder.spec @@ -3,13 +3,17 @@ Name: gpodder Version: 2.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Podcast receiver/catcher written in Python Group: Applications/Multimedia License: GPLv3 URL: http://gpodder.berlios.de/ Source0: http://download.berlios.de/%{name}/%{name}-%{version}.tar.gz +# rhbz 620584 +Patch0: gpodder.git-6a2c1baf.patch +# rhbz 619295 +Patch1: gpodder.git-92bf1255c432510f0c3b767d6c928e4e7e68de95.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python-devel, python-feedparser, python-mygpoclient >= 1.4 @@ -30,6 +34,8 @@ It also optionally supports syncing with ipods. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build make messages @@ -79,6 +85,10 @@ fi %{python_sitelib}/%{name}*.egg-info %changelog +* Mon Aug 23 2010 Ville-Pekka Vainio - 2.7-3 +- Add patches to fix two Fedora bugs, #620584 (problems with the episode list) + and #619295 (database ProgrammingError) + * Wed Jul 21 2010 David Malcolm - 2.7-2 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild