* [gentoo-commits] repo/gentoo:master commit in: net-p2p/tremc/files/, net-p2p/tremc/
@ 2020-04-15 19:09 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2020-04-15 19:09 UTC (permalink / raw
To: gentoo-commits
commit: 8f786fdd9d3cb6865cb58fda63822861d950c035
Author: John Helmert III <jchelmertt3 <AT> gmail <DOT> com>
AuthorDate: Tue Apr 14 03:04:23 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Apr 15 19:09:18 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f786fdd
net-p2p/tremc: New package
transmission-remote-cli is dead and Python 2 only. This is a fork of it
that supports Python 3.
Signed-off-by: John Helmert III <jchelmertt3 <AT> gmail.com>
Bug: https://bugs.gentoo.org/713518
Closes: https://github.com/gentoo/gentoo/pull/15340
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
net-p2p/tremc/Manifest | 1 +
net-p2p/tremc/files/0.9.1-fix-startup-crash.patch | 62 +++++++++++++++++++++++
net-p2p/tremc/metadata.xml | 15 ++++++
net-p2p/tremc/tremc-0.9.1.ebuild | 41 +++++++++++++++
4 files changed, 119 insertions(+)
diff --git a/net-p2p/tremc/Manifest b/net-p2p/tremc/Manifest
new file mode 100644
index 00000000000..5304ec87b78
--- /dev/null
+++ b/net-p2p/tremc/Manifest
@@ -0,0 +1 @@
+DIST tremc-0.9.1.tar.gz 315482 BLAKE2B c4e94ef13cc9d716cdbcbff061b1956d17c6babe765e192d675d08ad5d76a22cf171a4fb3f5f2952b971f59a16a2768ccd360d10df5b0f3325fd63ff9716f209 SHA512 ed16080c6544ce9019e6a0c4d660310992cae0f139a2a78e9eaa51841e293cefb22160a105794b5f03a4bfd47a2c50402879f2a17302a96265a9c9acb3174c39
diff --git a/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch b/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch
new file mode 100644
index 00000000000..5e67e5d3155
--- /dev/null
+++ b/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch
@@ -0,0 +1,62 @@
+From 0cb919b446eeda41aea8578ae26796ae92a973e5 Mon Sep 17 00:00:00 2001
+From: George Angelopoulos <george@usermod.net>
+Date: Mon, 2 Jul 2018 17:55:38 +0200
+Subject: [PATCH] fix addch ERR crash when starting with no torrents
+
+There was a bug introduced by commit e06d08d:
+ scale_bytes: Simplify this function
+
+tremc would crash when started against a transmission-daemon with no
+torrents.
+
+This was because scale_bytes(0) used to return 0K but now it returns
+0.0K. The expected width of 2 was hardcoded. The new width of 4 causes
+addch() to return ERR because it tries to draw outside the window.
+
+Hardcoding the new width to 4 would resolve this issue. Instead,
+this patch dynamically sets the width returned by scale_bytes().
+This should make the code a tiny bit more readable and maybe avoid this
+issue in the future.
+
+There is one more magic number involved here which I don't see a good
+way of getting rid of. So I made an illustrative comment.
+
+Resolves #15
+---
+ tremc | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tremc b/tremc
+index 36ae67b..ed898fb 100755
+--- a/tremc
++++ b/tremc
+@@ -883,7 +883,7 @@ class Interface(object):
+ self.focus = -1 # -1: nothing focused; 0: top of list; <# of torrents>-1: bottom of list
+ self.scrollpos = 0 # start of torrentlist
+ self.torrents_per_page = 0 # will be set by manage_layout()
+- self.rateDownload_width = self.rateUpload_width = 2
++ self.rateDownload_width = self.rateUpload_width = len(scale_bytes())
+
+ self.details_category_focus = 0 # overview/files/peers/tracker in details
+ self.focus_detaillist = -1 # same as focus but for details
+@@ -2667,6 +2667,8 @@ class Interface(object):
+ pass
+
+ def draw_global_rates(self):
++ # ↑1.2K ↓3.4M
++ # ^ ^^ => +3
+ rates_width = self.rateDownload_width + self.rateUpload_width + 3
+
+ if self.stats['alt-speed-enabled']:
+@@ -3373,7 +3375,7 @@ def timestamp(timestamp, format="%x %X"):
+ return "%s (%s)" % (absolute, relative)
+
+
+-def scale_bytes(bytes, type='short'):
++def scale_bytes(bytes=0, type='short'):
+ if bytes >= 1099511627776:
+ scaled_bytes = round((bytes / 1099511627776.0), 1)
+ unit = 'T'
+--
+2.26.0
+
diff --git a/net-p2p/tremc/metadata.xml b/net-p2p/tremc/metadata.xml
new file mode 100644
index 00000000000..8e79439699d
--- /dev/null
+++ b/net-p2p/tremc/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>jchelmertt3@gmail.com</email>
+ <name>John Helmert III</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">tremc/tremc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/tremc/tremc-0.9.1.ebuild b/net-p2p/tremc/tremc-0.9.1.ebuild
new file mode 100644
index 00000000000..8306b1e2dfa
--- /dev/null
+++ b/net-p2p/tremc/tremc-0.9.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+PYTHON_REQ_USE="ncurses"
+inherit bash-completion-r1 python-single-r1
+
+DESCRIPTION="Ncurses interface for the Transmission BitTorrent client"
+HOMEPAGE="https://github.com/tremc/tremc"
+SRC_URI="https://github.com/tremc/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="geoip"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ $(python_gen_cond_dep '
+ geoip? ( dev-python/geoip-python[${PYTHON_USEDEP}] )
+ ')
+"
+
+# This fixes a crash when starting that was committed after 0.9.1
+PATCHES=( "${FILESDIR}/${PV}-fix-startup-crash.patch" )
+
+# Specify a no-op src_compile so upstream's broken Makefile doesn't get used
+src_compile() {
+ :
+}
+
+src_install() {
+ python_doscript tremc
+ newbashcomp completion/bash/tremc.sh tremc
+ insinto /usr/share/zsh/site-functions
+ doins completion/zsh/_tremc
+ doman tremc.1
+ dodoc NEWS README.md
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-p2p/tremc/files/, net-p2p/tremc/
@ 2020-06-29 6:09 Joonas Niilola
0 siblings, 0 replies; 2+ messages in thread
From: Joonas Niilola @ 2020-06-29 6:09 UTC (permalink / raw
To: gentoo-commits
commit: e1ee7c8b1aac3a2359a41a528cfc5733a181fb89
Author: John Helmert III <jchelmert3 <AT> posteo <DOT> net>
AuthorDate: Wed Jun 17 19:27:38 2020 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Mon Jun 29 06:08:57 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1ee7c8b
net-p2p/tremc: Drop old
Package-Manager: Portage-2.3.101, Repoman-2.3.22
Signed-off-by: John Helmert III <jchelmert3 <AT> posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/16303
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
net-p2p/tremc/Manifest | 1 -
net-p2p/tremc/files/0.9.1-fix-startup-crash.patch | 62 -----------------------
net-p2p/tremc/tremc-0.9.1.ebuild | 41 ---------------
3 files changed, 104 deletions(-)
diff --git a/net-p2p/tremc/Manifest b/net-p2p/tremc/Manifest
index 57e343bbe67..7e7b6b1bb16 100644
--- a/net-p2p/tremc/Manifest
+++ b/net-p2p/tremc/Manifest
@@ -1,2 +1 @@
-DIST tremc-0.9.1.tar.gz 315482 BLAKE2B c4e94ef13cc9d716cdbcbff061b1956d17c6babe765e192d675d08ad5d76a22cf171a4fb3f5f2952b971f59a16a2768ccd360d10df5b0f3325fd63ff9716f209 SHA512 ed16080c6544ce9019e6a0c4d660310992cae0f139a2a78e9eaa51841e293cefb22160a105794b5f03a4bfd47a2c50402879f2a17302a96265a9c9acb3174c39
DIST tremc-0.9.2.tar.gz 315631 BLAKE2B f5ed154fbfcbdb3e77b678a5827d3f68a6be4033530d6d4e451d57808d43cd5737fff32cf62445d246bfce4d8f02e4cac0c1156603e220e228e61b725d6deaf8 SHA512 d6d6d155ddac918d329226d5c3b53c63fd4fa0b98e30f1eb2cd2226ea598bd7dd81d72f747dc11f4a508bcc0453d90d774c1d8db6dac05ae1ecbc217290b7db3
diff --git a/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch b/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch
deleted file mode 100644
index 5e67e5d3155..00000000000
--- a/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 0cb919b446eeda41aea8578ae26796ae92a973e5 Mon Sep 17 00:00:00 2001
-From: George Angelopoulos <george@usermod.net>
-Date: Mon, 2 Jul 2018 17:55:38 +0200
-Subject: [PATCH] fix addch ERR crash when starting with no torrents
-
-There was a bug introduced by commit e06d08d:
- scale_bytes: Simplify this function
-
-tremc would crash when started against a transmission-daemon with no
-torrents.
-
-This was because scale_bytes(0) used to return 0K but now it returns
-0.0K. The expected width of 2 was hardcoded. The new width of 4 causes
-addch() to return ERR because it tries to draw outside the window.
-
-Hardcoding the new width to 4 would resolve this issue. Instead,
-this patch dynamically sets the width returned by scale_bytes().
-This should make the code a tiny bit more readable and maybe avoid this
-issue in the future.
-
-There is one more magic number involved here which I don't see a good
-way of getting rid of. So I made an illustrative comment.
-
-Resolves #15
----
- tremc | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/tremc b/tremc
-index 36ae67b..ed898fb 100755
---- a/tremc
-+++ b/tremc
-@@ -883,7 +883,7 @@ class Interface(object):
- self.focus = -1 # -1: nothing focused; 0: top of list; <# of torrents>-1: bottom of list
- self.scrollpos = 0 # start of torrentlist
- self.torrents_per_page = 0 # will be set by manage_layout()
-- self.rateDownload_width = self.rateUpload_width = 2
-+ self.rateDownload_width = self.rateUpload_width = len(scale_bytes())
-
- self.details_category_focus = 0 # overview/files/peers/tracker in details
- self.focus_detaillist = -1 # same as focus but for details
-@@ -2667,6 +2667,8 @@ class Interface(object):
- pass
-
- def draw_global_rates(self):
-+ # ↑1.2K ↓3.4M
-+ # ^ ^^ => +3
- rates_width = self.rateDownload_width + self.rateUpload_width + 3
-
- if self.stats['alt-speed-enabled']:
-@@ -3373,7 +3375,7 @@ def timestamp(timestamp, format="%x %X"):
- return "%s (%s)" % (absolute, relative)
-
-
--def scale_bytes(bytes, type='short'):
-+def scale_bytes(bytes=0, type='short'):
- if bytes >= 1099511627776:
- scaled_bytes = round((bytes / 1099511627776.0), 1)
- unit = 'T'
---
-2.26.0
-
diff --git a/net-p2p/tremc/tremc-0.9.1.ebuild b/net-p2p/tremc/tremc-0.9.1.ebuild
deleted file mode 100644
index 8306b1e2dfa..00000000000
--- a/net-p2p/tremc/tremc-0.9.1.ebuild
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{6,7,8} )
-PYTHON_REQ_USE="ncurses"
-inherit bash-completion-r1 python-single-r1
-
-DESCRIPTION="Ncurses interface for the Transmission BitTorrent client"
-HOMEPAGE="https://github.com/tremc/tremc"
-SRC_URI="https://github.com/tremc/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="geoip"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="${PYTHON_DEPS}
- $(python_gen_cond_dep '
- geoip? ( dev-python/geoip-python[${PYTHON_USEDEP}] )
- ')
-"
-
-# This fixes a crash when starting that was committed after 0.9.1
-PATCHES=( "${FILESDIR}/${PV}-fix-startup-crash.patch" )
-
-# Specify a no-op src_compile so upstream's broken Makefile doesn't get used
-src_compile() {
- :
-}
-
-src_install() {
- python_doscript tremc
- newbashcomp completion/bash/tremc.sh tremc
- insinto /usr/share/zsh/site-functions
- doins completion/zsh/_tremc
- doman tremc.1
- dodoc NEWS README.md
-}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-29 6:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-29 6:09 [gentoo-commits] repo/gentoo:master commit in: net-p2p/tremc/files/, net-p2p/tremc/ Joonas Niilola
-- strict thread matches above, loose matches on Subject: below --
2020-04-15 19:09 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox