diff options
author | Ruslan Makhmatkhanov <rm@FreeBSD.org> | 2013-02-02 13:03:04 +0000 |
---|---|---|
committer | Ruslan Makhmatkhanov <rm@FreeBSD.org> | 2013-02-02 13:03:04 +0000 |
commit | 5056ca05bab5ff160138e08e122a2331274a7413 (patch) | |
tree | 23b54b528009cdc532d95f86c1ab6083c0dd5ac9 | |
parent | 0fa2d15d76a98c25515743159c341d6fefbc5a4f (diff) | |
download | ports-5056ca05bab5ff160138e08e122a2331274a7413.tar.gz ports-5056ca05bab5ff160138e08e122a2331274a7413.zip |
Notes
-rw-r--r-- | net-p2p/deluge/Makefile | 13 | ||||
-rw-r--r-- | net-p2p/deluge/files/patch-deluge__core__torrent.py | 60 | ||||
-rw-r--r-- | net-p2p/deluge/files/patch-deluge__core__torrentmanager.py | 20 | ||||
-rw-r--r-- | net-p2p/deluge/files/patch-deluge__ui__gtkui__createtorrentdialog.py | 20 | ||||
-rw-r--r-- | net-p2p/deluge/pkg-descr | 2 |
5 files changed, 108 insertions, 7 deletions
diff --git a/net-p2p/deluge/Makefile b/net-p2p/deluge/Makefile index 9e7e194ac095..3109f69b28b0 100644 --- a/net-p2p/deluge/Makefile +++ b/net-p2p/deluge/Makefile @@ -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, GTK+2, and libtorrent-rasterbar 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;${LOCALBASE}/;;}/${file} .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} diff --git a/net-p2p/deluge/files/patch-deluge__core__torrent.py b/net-p2p/deluge/files/patch-deluge__core__torrent.py new file mode 100644 index 000000000000..133d36830a27 --- /dev/null +++ b/net-p2p/deluge/files/patch-deluge__core__torrent.py @@ -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 diff --git a/net-p2p/deluge/files/patch-deluge__core__torrentmanager.py b/net-p2p/deluge/files/patch-deluge__core__torrentmanager.py new file mode 100644 index 000000000000..846ccf5fefff --- /dev/null +++ b/net-p2p/deluge/files/patch-deluge__core__torrentmanager.py @@ -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"] = "" diff --git a/net-p2p/deluge/files/patch-deluge__ui__gtkui__createtorrentdialog.py b/net-p2p/deluge/files/patch-deluge__ui__gtkui__createtorrentdialog.py new file mode 100644 index 000000000000..9c3e6b1afe04 --- /dev/null +++ b/net-p2p/deluge/files/patch-deluge__ui__gtkui__createtorrentdialog.py @@ -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)]) diff --git a/net-p2p/deluge/pkg-descr b/net-p2p/deluge/pkg-descr index c954200bb930..fc985d391ad1 100644 --- a/net-p2p/deluge/pkg-descr +++ b/net-p2p/deluge/pkg-descr @@ -5,4 +5,4 @@ desktop environments such as Gnome and XFCE. 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/ |