Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Feb 2013 13:03:04 +0000 (UTC)
From:      Ruslan Mahmatkhanov <rm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r311424 - in head/net-p2p/deluge: . files
Message-ID:  <201302021303.r12D35Oe052021@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rm
Date: Sat Feb  2 13:03:04 2013
New Revision: 311424
URL: http://svnweb.freebsd.org/changeset/ports/311424

Log:
  - switch the dependency to libtorrent-rasterbar 1.6.x, because with importing of
    new version of boost-libs, libtorrent-raster 1.5.x is now broken. In fact I'm
    using it already for some time, and everything is fine except for downloading
    via proxy, there is details [1]
  - backport upstream patch that is fixing libtorrent 0.16-specific issues with
    unicoded filenames [2]
  - convert to optionsng
  - tab -> space change in pkg-descr
  - bump PORTREVISION
  - add UPDATING entry
  
  [1] https://dev.deluge-torrent.org/ticket/2149
  [2] http://goo.gl/i5hXc

Added:
  head/net-p2p/deluge/files/patch-deluge__core__torrent.py   (contents, props changed)
  head/net-p2p/deluge/files/patch-deluge__core__torrentmanager.py   (contents, props changed)
  head/net-p2p/deluge/files/patch-deluge__ui__gtkui__createtorrentdialog.py   (contents, props changed)
Modified:
  head/net-p2p/deluge/Makefile
  head/net-p2p/deluge/pkg-descr   (contents, props changed)

Modified: head/net-p2p/deluge/Makefile
==============================================================================
--- head/net-p2p/deluge/Makefile	Sat Feb  2 12:06:36 2013	(r311423)
+++ head/net-p2p/deluge/Makefile	Sat Feb  2 13:03:04 2013	(r311424)
@@ -2,7 +2,7 @@
 
 PORTNAME=	deluge
 PORTVERSION=	1.3.5
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	net-p2p python
 MASTER_SITES=	http://download.deluge-torrent.org/source/
@@ -14,7 +14,7 @@ COMMENT=	Bittorrent client using Python,
 LICENSE=	GPLv3
 
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}xdg>=0.18:${PORTSDIR}/devel/py-xdg \
-		${PYTHON_PKGNAMEPREFIX}libtorrent-rasterbar>=0.15.1:${PORTSDIR}/net-p2p/libtorrent-rasterbar-15-python \
+		${PYTHON_PKGNAMEPREFIX}libtorrent-rasterbar>=0.16.0:${PORTSDIR}/net-p2p/libtorrent-rasterbar-16-python \
 		${PYTHON_PKGNAMEPREFIX}openssl>=0.8:${PORTSDIR}/security/py-openssl \
 		${PYTHON_PKGNAMEPREFIX}chardet>=1.0.1:${PORTSDIR}/textproc/py-chardet \
 		${PYTHON_PKGNAMEPREFIX}mako>=0.2.5:${PORTSDIR}/textproc/py-mako
@@ -32,7 +32,8 @@ USE_TWISTED_RUN=	web
 USE_PYDISTUTILS=	easy_install
 PYDISTUTILS_BUILD_TARGET=	build bdist_egg
 
-OPTIONS=	PYGTK "Enable GUI and gtk dep (GUI files always installed)" on
+OPTIONS_DEFINE=	GTK2
+OPTIONS_DEFAULT=GTK2
 
 MAN1=		deluge.1 deluge-console.1 deluge-gtk.1 deluge-web.1 deluged.1
 
@@ -56,7 +57,7 @@ PLIST_FILES+=	${PYTHON_SITELIBDIR:S;${LO
 .endfor
 .endif
 
-.if !defined(WITHOUT_PYGTK)
+.if ${PORT_OPTIONS:MGTK2}
 RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}dbus>=0.83:${PORTSDIR}/devel/py-dbus \
 		${PYTHON_PKGNAMEPREFIX}game>=1.8.1:${PORTSDIR}/devel/py-game \
 		${PYTHON_PKGNAMEPREFIX}notify>=0.1.1:${PORTSDIR}/devel/py-notify \
@@ -100,7 +101,7 @@ post-install:
 	${INSTALL_DATA} ${WRKSRC}/deluge/data/pixmaps/deluge.${file} \
 		${PREFIX}/share/pixmaps
 .endfor
-.if !defined(WITHOUT_PYGTK)
+.if ${PORT_OPTIONS:MGTK2}
 	if [ ! -d ${PREFIX}/share/applications ]; then \
 		${MKDIR} ${PREFIX}/share/applications ; \
 	fi
@@ -108,7 +109,7 @@ post-install:
 		${PREFIX}/share/applications
 	@-update-desktop-database
 .endif
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${DOCSDIR}
 .for i in ChangeLog README
 	${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}

Added: head/net-p2p/deluge/files/patch-deluge__core__torrent.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/deluge/files/patch-deluge__core__torrent.py	Sat Feb  2 13:03:04 2013	(r311424)
@@ -0,0 +1,60 @@
+--- ./deluge/core/torrent.py.orig	2012-04-10 05:53:16.000000000 +0400
++++ ./deluge/core/torrent.py	2013-02-02 13:09:08.000000000 +0400
+@@ -837,22 +837,30 @@
+         # Attempt to convert utf8 path to unicode
+         # Note: Inconsistent encoding for 'dest', needs future investigation
+         try:
+-           dest_u = unicode(dest, "utf-8")
++           dest = unicode(dest, "utf-8")
+         except TypeError:
+            # String is already unicode
+-           dest_u = dest
++           pass
+ 
+-        if not os.path.exists(dest_u):
++        if not os.path.exists(dest):
+             try:
+                 # Try to make the destination path if it doesn't exist
+-                os.makedirs(dest_u)
++                os.makedirs(dest)
+             except IOError, e:
+                 log.exception(e)
+-                log.error("Could not move storage for torrent %s since %s does not exist and could not create the directory.", self.torrent_id, dest_u)
++                log.error("Could not move storage for torrent %s since %s does not exist and could not create the directory.", self.torrent_id, dest)
+                 return False
++
++        dest_bytes = dest.encode('utf-8')
++
+         try:
+-            self.handle.move_storage(dest_u)
+-        except:
++            # libtorrent needs unicode object if wstrings are enabled, utf8 bytestring otherwise
++            try:
++                self.handle.move_storage(dest)
++            except TypeError:
++                self.handle.move_storage(dest_bytes)
++        except Exception, e:
++            log.error("Error calling libtorrent move_storage: %s" % e)
+             return False
+ 
+         return True
+@@ -928,8 +936,18 @@
+         """Renames files in the torrent. 'filenames' should be a list of
+         (index, filename) pairs."""
+         for index, filename in filenames:
++            # Make sure filename is a unicode object
++            try:
++                filename = unicode(filename, "utf-8")
++            except TypeError:
++                pass
+             filename = sanitize_filepath(filename)
+-            self.handle.rename_file(index, filename.encode("utf-8"))
++            # libtorrent needs unicode object if wstrings are enabled, utf8 bytestring otherwise
++            try:
++                self.handle.rename_file(index, filename)
++            except TypeError:
++                self.handle.rename_file(index, filename.encode("utf-8"))
++
+ 
+     def rename_folder(self, folder, new_folder):
+         """Renames a folder within a torrent.  This basically does a file rename

Added: head/net-p2p/deluge/files/patch-deluge__core__torrentmanager.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/deluge/files/patch-deluge__core__torrentmanager.py	Sat Feb  2 13:03:04 2013	(r311424)
@@ -0,0 +1,20 @@
+--- ./deluge/core/torrentmanager.py.orig	2012-04-10 05:53:16.000000000 +0400
++++ ./deluge/core/torrentmanager.py	2013-02-02 13:11:53.000000000 +0400
+@@ -419,9 +419,16 @@
+             # before adding to the session.
+             if options["mapped_files"]:
+                 for index, filename in options["mapped_files"].items():
++                    try:
++                        fname = unicode(fname, "utf-8")
++                    except TypeError:
++                        pass
+                     filename = deluge.core.torrent.sanitize_filepath(filename)
+                     log.debug("renaming file index %s to %s", index, filename)
+-                    torrent_info.rename_file(index, utf8_encoded(filename))
++                    try:
++                        torrent_info.rename_file(index, fname)
++                    except TypeError:
++                        torrent_info.rename_file(index, fname.encode("utf-8"))
+ 
+             add_torrent_params["ti"] = torrent_info
+             add_torrent_params["resume_data"] = ""

Added: head/net-p2p/deluge/files/patch-deluge__ui__gtkui__createtorrentdialog.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/deluge/files/patch-deluge__ui__gtkui__createtorrentdialog.py	Sat Feb  2 13:03:04 2013	(r311424)
@@ -0,0 +1,20 @@
+--- ./deluge/ui/gtkui/createtorrentdialog.py.orig	2012-04-10 05:53:16.000000000 +0400
++++ ./deluge/ui/gtkui/createtorrentdialog.py	2013-02-02 13:13:21.000000000 +0400
+@@ -159,7 +159,7 @@
+             chooser.destroy()
+             return
+ 
+-        path = result.decode('utf-8').encode(sys.getfilesystemencoding())
++        path = result.decode('utf-8')
+ 
+         self.files_treestore.clear()
+         self.files_treestore.append(None, [result, gtk.STOCK_FILE, deluge.common.get_path_size(path)])
+@@ -187,7 +187,7 @@
+             chooser.destroy()
+             return
+ 
+-        path = result.decode('utf-8').encode(sys.getfilesystemencoding())
++        path = result.decode('utf-8')
+ 
+         self.files_treestore.clear()
+         self.files_treestore.append(None, [result, gtk.STOCK_OPEN, deluge.common.get_path_size(path)])

Modified: head/net-p2p/deluge/pkg-descr
==============================================================================
--- head/net-p2p/deluge/pkg-descr	Sat Feb  2 12:06:36 2013	(r311423)
+++ head/net-p2p/deluge/pkg-descr	Sat Feb  2 13:03:04 2013	(r311424)
@@ -5,4 +5,4 @@ desktop environments such as Gnome and X
 Deluge uses Rasterbar's version of libtorrent as the main ingredient in its
 bittorrent protocol backend.
 
-WWW:	http://deluge-torrent.org/
+WWW: http://deluge-torrent.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302021303.r12D35Oe052021>