Friday, 20 February 2015

Re: Help with debdiff generation of soundconverter package

diff -Nru soundconverter-2.0.4/debian/changelog soundconverter-2.0.4/debian/changelog
--- soundconverter-2.0.4/debian/changelog 2012-11-22 01:24:19.000000000 +0000
+++ soundconverter-2.0.4/debian/changelog 2015-02-20 09:22:15.000000000 +0000
@@ -1,3 +1,14 @@
+soundconverter (2.0.4-0ubuntu2) trusty; urgency=medium
+
+ * [PATCH] 0001-Missing-plugins-handling-ignore-video-codecs.patch
+ - Fix the forever-loop in Ubuntu 14.04 while converting videos (LP: #1308187)
+ * [PATCH] 0002-Apply-patch-from-Michael.-Empty-task-queue-when-abor.patch
+ - Empty task queue when aborting (LP: #1121297)
+ * [PATCH] 0003-Apply-patch-from-Michael-fixing-TypeError-when-calli.patch
+ - Apply patch from Michael fixing TypeError when calling (LP: #1121164)
+
+ -- Javier P.L. <[email protected]> Fri, 20 Feb 2015 09:17:15 +0000
+
soundconverter (2.0.4-0ubuntu1) raring; urgency=low

* New upstream release (LP: #1077508).
diff -Nru soundconverter-2.0.4/debian/patches/0001-Missing-plugins-handling-ignore-video-codecs.patch soundconverter-2.0.4/debian/patches/0001-Missing-plugins-handling-ignore-video-codecs.patch
--- soundconverter-2.0.4/debian/patches/0001-Missing-plugins-handling-ignore-video-codecs.patch 1970-01-01 00:00:00.000000000 +0000
+++ soundconverter-2.0.4/debian/patches/0001-Missing-plugins-handling-ignore-video-codecs.patch 2015-02-20 09:25:04.000000000 +0000
@@ -0,0 +1,36 @@
+From c12eef38dc9740d62452a094b1b8e9db03858b65 Mon Sep 17 00:00:00 2001
+From: kassoulet <[email protected]>
+Date: Fri, 13 Feb 2015 23:47:23 +0100
+Subject: [PATCH 1/3] Missing plugins handling: ignore video codecs.
+
+This seems to fix the forever-loop in Ubuntu 14.04 while converting videos.
+
+Fix lp:1308187, thanks Thibaut.
+---
+ soundconverter/gstreamer.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/soundconverter/gstreamer.py b/soundconverter/gstreamer.py
+index ee61155..14b0810 100644
+--- a/soundconverter/gstreamer.py
++++ b/soundconverter/gstreamer.py
[email protected]@ -208,11 +208,15 @@ class Pipeline(BackgroundTask):
+ elif t == gst.MESSAGE_ELEMENT:
+ st = message.structure
+ if st and st.get_name().startswith('missing-'):
+- self.pipeline.set_state(gst.STATE_NULL)
+ if gst.pygst_version >= (0, 10, 10):
+ import gst.pbutils
+ detail = gst.pbutils.\
+ missing_plugin_message_get_installer_detail(message)
++ mime_type = detail.split('|')[4].split(', ')[0]
++ if 'video' in mime_type:
++ debug('ignoring video codec: ', mime_type)
++ return True
++ self.pipeline.set_state(gst.STATE_NULL)
+ ctx = gst.pbutils.InstallPluginsContext()
+ gst.pbutils.install_plugins_async([detail], ctx,
+ self.install_plugin_cb)
+--
+1.9.1
+
diff -Nru soundconverter-2.0.4/debian/patches/0002-Apply-patch-from-Michael.-Empty-task-queue-when-abor.patch soundconverter-2.0.4/debian/patches/0002-Apply-patch-from-Michael.-Empty-task-queue-when-abor.patch
--- soundconverter-2.0.4/debian/patches/0002-Apply-patch-from-Michael.-Empty-task-queue-when-abor.patch 1970-01-01 00:00:00.000000000 +0000
+++ soundconverter-2.0.4/debian/patches/0002-Apply-patch-from-Michael.-Empty-task-queue-when-abor.patch 2015-02-20 09:25:41.000000000 +0000
@@ -0,0 +1,25 @@
+From e6a48f44779119c8c6a314e72a1f20a29a117b04 Mon Sep 17 00:00:00 2001
+From: kassoulet <[email protected]>
+Date: Sun, 10 Feb 2013 23:57:13 +0100
+Subject: [PATCH 2/3] Apply patch from Michael. Empty task queue when aborting.
+ Closes lp:1121297, thanks Michael.
+
+---
+ soundconverter/ui.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/soundconverter/ui.py b/soundconverter/ui.py
+index fb753ac..5cf8517 100644
+--- a/soundconverter/ui.py
++++ b/soundconverter/ui.py
[email protected]@ -1430,6 +1430,7 @@ class SoundConverterWindow(GladeWindow):
+ self.filelist.hide_row_progress()
+ self.status_frame.show()
+ self.widget.set_sensitive(True)
++ self.converter.abort()
+ try:
+ from gi.repository import Unity
+ launcher = Unity.LauncherEntry.get_for_desktop_id ("soundconverter.desktop")
+--
+1.9.1
+
diff -Nru soundconverter-2.0.4/debian/patches/0003-Apply-patch-from-Michael-fixing-TypeError-when-calli.patch soundconverter-2.0.4/debian/patches/0003-Apply-patch-from-Michael-fixing-TypeError-when-calli.patch
--- soundconverter-2.0.4/debian/patches/0003-Apply-patch-from-Michael-fixing-TypeError-when-calli.patch 1970-01-01 00:00:00.000000000 +0000
+++ soundconverter-2.0.4/debian/patches/0003-Apply-patch-from-Michael-fixing-TypeError-when-calli.patch 2015-02-20 09:25:48.000000000 +0000
@@ -0,0 +1,53 @@
+From f63be1f82100484b958dc85f63daf63a506d3ae8 Mon Sep 17 00:00:00 2001
+From: kassoulet <[email protected]>
+Date: Sun, 10 Feb 2013 21:05:51 +0100
+Subject: [PATCH 3/3] Apply patch from Michael fixing TypeError when calling
+ show_error. Closes lp:1121164, thanks Michael.
+
+---
+ soundconverter/gstreamer.py | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/soundconverter/gstreamer.py b/soundconverter/gstreamer.py
+index 14b0810..98d8e03 100644
+--- a/soundconverter/gstreamer.py
++++ b/soundconverter/gstreamer.py
[email protected]@ -187,7 +187,7 @@ class Pipeline(BackgroundTask):
+ return
+ self.done()
+ if result == gst.pbutils.INSTALL_PLUGINS_USER_ABORT:
+- show_error(_('Plugin installation aborted.'))
++ show_error('Error', _('Plugin installation aborted.'))
+ return
+
+ show_error('Error', 'failed to install plugins: %s' % gobject.markup_escape_text(str(result)))
[email protected]@ -353,6 +353,8 @@ class Decoder(Pipeline):
+ self.sound_file.duration = self.pipeline.query_duration(
+ gst.FORMAT_TIME)[0] / gst.SECOND
+ debug('got file duration:', self.sound_file.duration)
++ if self.sound_file.duration < 0:
++ self.sound_file.duration = None
+ except gst.QueryError:
+ self.sound_file.duration = None
+
[email protected]@ -522,7 +524,7 @@ class Converter(Decoder):
+ if not encoder:
+ # TODO: is this used ?
+ # TODO: add proper error management when an encoder cannot be created
+- show_error(_("Cannot create a decoder for \'%s\' format.") %
++ show_error(_('Error', "Cannot create a decoder for \'%s\' format.") %
+ self.output_type)
+ return
+
[email protected]@ -533,7 +535,7 @@ class Converter(Decoder):
+ if dirname and not gnomevfs.exists(dirname):
+ log('Creating folder: \'%s\'' % dirname)
+ if not vfs_makedirs(str(dirname)):
+- show_error(_("Cannot create \'%s\' folder.") % dirname)
++ show_error('Error', _("Cannot create \'%s\' folder.") % dirname)
+ return
+
+ self.add_command('%s location="%s"' % (
+--
+1.9.1
+
diff -Nru soundconverter-2.0.4/debian/patches/series soundconverter-2.0.4/debian/patches/series
--- soundconverter-2.0.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
+++ soundconverter-2.0.4/debian/patches/series 2015-02-20 09:25:48.000000000 +0000
@@ -0,0 +1,3 @@
+0003-Apply-patch-from-Michael-fixing-TypeError-when-calli.patch
+0002-Apply-patch-from-Michael.-Empty-task-queue-when-abor.patch
+0001-Missing-plugins-handling-ignore-video-codecs.patch
Hi Michele,

Even when I'm not an Ubuntu developer just a enthusiastic user, I gave
it a shot and created a basic debdiff, it may be used as base to
create a formal one. This is how I did it:

$ sudo apt-get install ubuntu-dev-tools git quilt fakeroot debhelper
$ git clone https://github.com/kassoulet/soundconverter/
$ cd soundconverter && git checkout origin/2.0
$ #it seems like the patches you're interested are the last 3 commits
$ git format-patch HEAD~3
$ cd ../ && mkdir ubuntu
$ cd ubuntu && pull-lp-source soundconverter trusty
$ cd soundconverter-2.0.4 && dch -i #document the changes and replace raring with trusty
$ mkdir debian/patches
$ quilt import ../../soundconverter/0001-Missing-plugins-handling-ignore-video-codecs.patch
$ quilt import ../../soundconverter/0002-Apply-patch-from-Michael.-Empty-task-queue-when-abor.patch
$ quilt import ../../soundconverter/0003-Apply-patch-from-Michael-fixing-TypeError-when-calli.patch
$ debuild -S -us -uc
$ cd .. && debdiff *dsc > soundconverter.debdiff

I didn't compile the result neither tested the result, (I ran this on
a remote machine without X). You could compile the result by running:
$ debuild -us -uc #withouth the -S parameter

I consulted the following sites to get the details (terrible memory):

http://raphaelhertzog.com/2011/07/04/how-to-prepare-patches-for-debian-packages/
http://makandracards.com/makandra/2521-git-how-to-create-and-apply-patches

On 19/02/15 at 11:46pm, Michele Giacomoli wrote:
> Hi developers,
>
> The package soundconverter (2.0.4-0ubuntu1) in trusty repo has some bugs,
> so the developer created a branch (
> https://github.com/kassoulet/soundconverter/tree/2.0) with some highly
> recommended fixes for this version.
>
> I filled an SRU request for this (
> https://bugs.launchpad.net/ubuntu/+source/soundconverter/+bug/1423709). I
> managed to build from source and everything seems to work fine, but I would
> need to attach a debdiff to the request, and I feel insecure with packaging
> stuff.
>
> So I ask you for help, if someone could try to build and generate a
> debdiff, or explain me the procedure to solve this problem, or who can ask
> for this.
>
> Thank you very much

> --
> ubuntu-devel mailing list
> [email protected]
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel