Bug#345596: freeloader: fails to start on sarge

2006-01-02 Thread Steve Langasek
On Mon, Jan 02, 2006 at 06:18:33PM +0100, Julien Valroff wrote:
> Le lundi 02 janvier 2006 à 04:10 +, Ben Hutchings a écrit :
> > Package: freeloader
> > Version: 0.3-3
> > Severity: grave
> > Tags: patch
> > Justification: renders package unusable
> I don't think the fact that a package from the unstable distribution
> cannot be used on Sarge is not a justification for a grave status.

Failing to declare a sufficiently strong versioned dependency to let people
*know* it can't be used on sarge is a serious bug.
> > With this second change, the program is barely functional, but
> > continues to print error messages that suggest to me it requires
> > a more recent version of python-gnome2 than that in sarge.
> I agree, thus I changed dependencies so that python-gnome2,
> python-glade2 and python-gtk2 are at least 2.10 (current testing and
> unstable versions).

> The problem will be fixed in the next upload.

Great :)

Cheers,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/


signature.asc
Description: Digital signature


Bug#345596: freeloader: fails to start on sarge

2006-01-02 Thread Ben Hutchings
Julien Valroff wrote:
> Le lundi 02 janvier 2006 à 18:19 +, Ben Hutchings a écrit :
> > 
> > I've actually succeeded in making it build and run in sarge with some
> > quite small changes, so it might be worth leaving the dependencies as
> > they are.  I'm attaching a patch that addresses all the issues I
> > originally mentioned.  This also puts the changes you made to
> > configure
> > (in patch 01_disable_modules_check.dpatch) into configure.ac along
> > with
> > the change needed to accept gnome.vfs in place of gnomevfs, as I
> > believe
> > it is considered bad practice to patch generated files such as
> > configure
> > scripts.
> 
> May you please add the attachment?

That would be a good idea!

Ben.

-- 
Ben Hutchings
Any sufficiently advanced bug is indistinguishable from a feature.
diff -urN freeloader-0.3/configure.ac freeloader-0.3-mine/configure.ac
--- freeloader-0.3/configure.ac
+++ freeloader-0.3-mine/configure.ac
@@ -9,9 +9,15 @@
 
 AX_PYTHON
 AC_PYTHON_MODULE(pygtk, 1)
-AC_PYTHON_MODULE(gtk, 1)
-AC_PYTHON_MODULE(gtk.glade, 1)
-AC_PYTHON_MODULE(gtk.gdk, 1)
+# HACK
+# importing these module fails if no DISPLAY is set
+# which means it fails with pbuilder build and since we do have
+# this module present (due to dependencies) I am going to ignore this
+# error, see: http://oss.codepoet.no/bugzilla/show_bug.cgi?id=155
+#AC_PYTHON_MODULE(gtk, 1)
+#AC_PYTHON_MODULE(gtk.glade, 1)
+#AC_PYTHON_MODULE(gtk.gdk, 1)
+# HACK
 AC_PYTHON_MODULE(gnome, 1)
 AC_PYTHON_MODULE(gnome.ui, 1)
 AC_PYTHON_MODULE(gobject, 1)
@@ -22,7 +28,10 @@
 AC_PYTHON_MODULE(BitTorrent, 1)
 AC_PYTHON_MODULE(BitTorrent.bencode, 1)
 AC_PYTHON_MODULE(BitTorrent.download, 1)
-AC_PYTHON_MODULE(gnomevfs, 1)
+AC_PYTHON_MODULE(gnomevfs)
+if test $HAVE_PYMOD_GNOMEVFS = no; then
+AC_PYTHON_MODULE(gnome.vfs, 1)
+fi
 AC_PYTHON_MODULE(gconf, 1)
 AC_PYTHON_MODULE(tempfile, 1)
 AC_PYTHON_MODULE(urllib, 1)
diff -urN freeloader-0.3/src/Makefile.am freeloader-0.3-mine/src/Makefile.am
--- freeloader-0.3/src/Makefile.am
+++ freeloader-0.3-mine/src/Makefile.am
@@ -3,7 +3,7 @@
 bin_SCRIPTS = freeloader
 
 localdistdir = $(datadir)/@PACKAGE_NAME@
-localdist_SCRIPTS = genericdl.py webdl.py btdl.py sockdae.py
+localdist_SCRIPTS = genericdl.py webdl.py btdl.py sockdae.py gdklock.py
 
 EXTRA_DIST = $(bin_SCRIPTS) $(localdist_SCRIPTS)
 
diff -urN freeloader-0.3/src/btdl.py freeloader-0.3-mine/src/btdl.py
--- freeloader-0.3/src/btdl.py	2005-04-07 03:28:06.0 +0100
+++ freeloader-0.3-mine/src/btdl.py	2006-01-02 04:13:36.0 +
@@ -22,6 +22,7 @@
 import BitTorrent
 import BitTorrent.download
 import genericdl
+from gdklock import GdkLock
 import urllib
 import threading
 import os
@@ -96,17 +97,15 @@
 		self.update_fields()
 
 	def error(self, errormsg):
-		gtk.gdk.threads_enter()
+		gdk_lock = GdkLock()
 		self.print_log(errormsg, gtk.STOCK_DIALOG_ERROR)
-		gtk.gdk.threads_leave()
 
 	def finished(self):
 		self.downRate = 0
 		self.completed()
-		gtk.gdk.threads_enter()
+		gdk_lock = GdkLock()
 		self.print_log("Completed Torrent: " + self.get_tail(),
 "arrows-up")
-		gtk.gdk.threads_leave()
 
 	def run(self):
 		args = ()
@@ -125,10 +124,10 @@
 
 		args += ("--saveas", self.des_file, self.src_file)
 
-		gtk.gdk.threads_enter()
+		gdk_lock = GdkLock()
 		self.print_log("Starting Torrent: " + self.get_tail(),
 "arrows-down-up")
-		gtk.gdk.threads_leave()
+		del gdk_lock
 
 		try:
 			BitTorrent.download.download(	args,
@@ -140,16 +139,16 @@
 			20)
 		except:
 			#there are non fatal exceptions?
-			gtk.gdk.threads_enter()
+			gdk_lock = GdkLock()
 			self.print_log("Error in Torrent thread",
 	gtk.STOCK_DIALOG_ERROR)
-			gtk.gdk.threads_leave()
+			del gdk_lock
 
 		if self.killflag.isSet():
 			self.downRate = 0
 			self.completed()
-			gtk.gdk.threads_enter()
+			gdk_lock = GdkLock()
 			self.print_log("Stopped Torrent: " + self.get_tail(),
 	gtk.STOCK_DIALOG_INFO)
-			gtk.gdk.threads_leave()
+			del gdk_lock
 
diff -urN freeloader-0.3/src/freeloader.in freeloader-0.3-mine/src/freeloader.in
--- freeloader-0.3/src/freeloader.in	2005-04-07 03:31:52.0 +0100
+++ freeloader-0.3-mine/src/freeloader.in	2006-01-02 04:33:22.0 +
@@ -39,7 +39,10 @@
 import gconf
 import socket
 import random
-import gnomevfs
+try:
+	import gnomevfs
+except ImportError:
+	import gnome.vfs as gnomevfs
 import BitTorrent.bencode
 import string
 try:
@@ -78,6 +81,7 @@
 import btdl
 import genericdl
 import sockdae
+from gdklock import GdkLock
 #import webbtdl
 #import fldservice
 
@@ -673,16 +681,14 @@
 	def sync_ui_timer(self):
 		if self.killflag.isSet():
 			return False
-		gtk.gdk.threads_enter()
+		gdk_lock = GdkLock()
 		if gtk.main_level() == 0:
-			gtk.gdk.threads_leave()
 			return False
 		try:
 			self.sync_ui()
 		except:
-			gtk.gdk.threads_leave()
 			return False
-		gtk.gdk.threads_leave()
+		del gdk_lock
 		if self.use_gamin == 1:
 			if self.gam.event_pending() > 0:
 self.gam.handle_events()
@@ -717,7 +720

Bug#345596: freeloader: fails to start on sarge

2006-01-02 Thread Julien Valroff
Le lundi 02 janvier 2006 à 18:19 +, Ben Hutchings a écrit :
> 
> I've actually succeeded in making it build and run in sarge with some
> quite small changes, so it might be worth leaving the dependencies as
> they are.  I'm attaching a patch that addresses all the issues I
> originally mentioned.  This also puts the changes you made to
> configure
> (in patch 01_disable_modules_check.dpatch) into configure.ac along
> with
> the change needed to accept gnome.vfs in place of gnomevfs, as I
> believe
> it is considered bad practice to patch generated files such as
> configure
> scripts.

May you please add the attachment?

Cheers,
Julien





Bug#345596: freeloader: fails to start on sarge

2006-01-02 Thread Ben Hutchings
You wrote:
> Le lundi 02 janvier 2006 à 04:10 +, Ben Hutchings a écrit :
> > Package: freeloader
> > Version: 0.3-3
> > Severity: grave
> > Tags: patch
> > Justification: renders package unusable
> I don't think the fact that a package from the unstable distribution
> cannot be used on Sarge is not a justification for a grave status.

Yes, you're right - I was confused by the fact that I was able to
install it on sarge without any need to tell apt explicitly to download
unstable packages.

> [...]
> 
> > With this second change, the program is barely functional, but
> > continues to print error messages that suggest to me it requires
> > a more recent version of python-gnome2 than that in sarge.
> I agree, thus I changed dependencies so that python-gnome2,
> python-glade2 and python-gtk2 are at least 2.10 (current testing and
> unstable versions).
> 
> The problem will be fixed in the next upload.

I've actually succeeded in making it build and run in sarge with some
quite small changes, so it might be worth leaving the dependencies as
they are.  I'm attaching a patch that addresses all the issues I
originally mentioned.  This also puts the changes you made to configure
(in patch 01_disable_modules_check.dpatch) into configure.ac along with
the change needed to accept gnome.vfs in place of gnomevfs, as I believe
it is considered bad practice to patch generated files such as configure
scripts.

Most of these changes could probably go upstream.

Ben.

-- 
Ben Hutchings
Any sufficiently advanced bug is indistinguishable from a feature.


signature.asc
Description: This is a digitally signed message part


Bug#345596: freeloader: fails to start on sarge

2006-01-02 Thread Julien Valroff
Le lundi 02 janvier 2006 à 04:10 +, Ben Hutchings a écrit :
> Package: freeloader
> Version: 0.3-3
> Severity: grave
> Tags: patch
> Justification: renders package unusable
I don't think the fact that a package from the unstable distribution
cannot be used on Sarge is not a justification for a grave status.

[...]

> With this second change, the program is barely functional, but
> continues to print error messages that suggest to me it requires
> a more recent version of python-gnome2 than that in sarge.
I agree, thus I changed dependencies so that python-gnome2,
python-glade2 and python-gtk2 are at least 2.10 (current testing and
unstable versions).

The problem will be fixed in the next upload.

Thanks for your report.

Cheers,
Julien





Bug#345596: freeloader: fails to start on sarge

2006-01-01 Thread Ben Hutchings
Package: freeloader
Version: 0.3-3
Severity: grave
Tags: patch
Justification: renders package unusable

Running "freeloader" results in the following error message:

Traceback (most recent call last):
  File "/usr/bin/freeloader", line 42, in ?
import gnomevfs
ImportError: No module named gnomevfs

I guessed that the gnome.vfs module in the stable version of
python2.3-gnome2 might be an earlier version of gnomevfs, so I tried
replacing this line with:

try:
import gnomevfs
except ImportError:
import gnome.vfs as gnomevfs

After this change, it was possible to start the program, open dialogs,
and beging downloading files.  However, after a download is finished,
it shows the error message:

Exception in thread Thread-2:Traceback (most recent call last):
  File "/usr/lib/python2.3/threading.py", line 442, in __bootstrap
self.run()
  File "/usr/share/freeloader/webdl.py", line 111, in run
self.completed()
  File "/usr/share/freeloader/genericdl.py", line 162, in completed
iname = gnome.ui.icon_lookup(theme, fact,
AttributeError: 'module' object has no attribute 'icon_lookup'

and then becomes unresponsive; I had to send it a SIGTERM to kill it.
Looking at the source, I can see why - it fails to release the Gdk
mutex if an exception occurs on this line!  To avoid this sort of
problem, each use of gtk.gdk.threads_{enter,leave} in the program
should be replaced with something like "gdk_lock = GdkLock()" or "del
gdk_lock" respectively, where GdkLock is defined as something like:

class GdkLock:
def __init__(self):
gtk.gdk.threads_enter()
def __del__(self):
gtk.gdk.threads_leave()

With this second change, the program is barely functional, but
continues to print error messages that suggest to me it requires
a more recent version of python-gnome2 than that in sarge.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.27-2-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages freeloader depends on:
ii  bittorrent   3.4.2-3sarge0.1 Scatter-gather network file transf
ii  librsvg2-2   2.8.1-3 SAX-based renderer library for SVG
ii  python   2.3.5-2 An interactive high-level object-o
ii  python-glade22.6.1-2 GTK+ bindings: Glade support
ii  python-gnome22.6.1-1 Python bindings for the GNOME desk
ii  python-gtk2  2.6.1-2 Python bindings for the GTK+ widge

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]