summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Zhong2024-03-26 00:22:14 +0900
committerAllen Zhong2024-03-26 00:22:14 +0900
commitc5be1069c0ea71bc0fc70ab97d5ddc68d56ff3ef (patch)
tree8f5d0c95e63c0e2cc90f57c478984cfc25f6049c
parentd53e16fc66e4e4c022368d72984646dd65501a59 (diff)
downloadaur-c5be1069c0ea71bc0fc70ab97d5ddc68d56ff3ef.tar.gz
apply patch from track-ipv6 branch
-rw-r--r--.SRCINFO6
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD9
-rw-r--r--tracker-ipv6.patch123
4 files changed, 134 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index eae0f1664d4b..7e755ee59bc3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -10,7 +10,9 @@ pkgbase = rtorrent-ipv6
depends = xmlrpc-c
provides = rtorrent
conflicts = rtorrent
- source = rtorrent::git+https://github.com/rakshasa/rtorrent.git#commit=45bec061a4b97fa5945bb45b10682849d874fa80
- sha256sums = SKIP
+ source = rtorrent::git+https://github.com/rakshasa/rtorrent.git#commit=1da0e3476dcabbf74b2e836d6b4c37b4d96bde09
+ source = tracker-ipv6.patch
+ sha256sums = 8cdeba8958f9a035f5d6a5015dc43bcbefa1a2cb6b585fe0e1d598a5bdec9720
+ sha256sums = e8209b8ed89a1f7b40d2d0c5616be44c6fe072995c8420b17f5fa3dd4e3bcad1
pkgname = rtorrent-ipv6
diff --git a/.gitignore b/.gitignore
index e322796389d2..fca0e6a16ead 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,4 @@ cookies
*.log
rtorrent/
+tmp/
diff --git a/PKGBUILD b/PKGBUILD
index 1f7ab26fa2d0..4fdc6b1998f3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,4 @@
-# Maintainer: Allen Zhong <moeallenz@gmail.com>
+# Maintainer: Allen Zhong <pdev@zhoal.pw>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Daenyth <Daenyth [at] gmail [dot] com>
# Contributor: Jeff Mickey <jeff@archlinux.org>
@@ -16,11 +16,14 @@ depends=('libtorrent-ipv6=0.13.8' 'xmlrpc-c')
makedepends=('git')
conflicts=("${_pkgname}")
provides=("${_pkgname}")
-source=("$_pkgname::git+https://github.com/rakshasa/${_pkgname}.git#commit=45bec061a4b97fa5945bb45b10682849d874fa80")
-sha256sums=('SKIP')
+source=("$_pkgname::git+https://github.com/rakshasa/${_pkgname}.git#commit=1da0e3476dcabbf74b2e836d6b4c37b4d96bde09"
+ tracker-ipv6.patch)
+sha256sums=('8cdeba8958f9a035f5d6a5015dc43bcbefa1a2cb6b585fe0e1d598a5bdec9720'
+ 'e8209b8ed89a1f7b40d2d0c5616be44c6fe072995c8420b17f5fa3dd4e3bcad1')
prepare() {
cd "${srcdir}/${_pkgname}"
+ patch -Np1 -i ../tracker-ipv6.patch
sed '/PKG_CHECK_EXISTS/d' -i scripts/ax_with_curses.m4
aclocal -I ./scripts -I .
autoheader
diff --git a/tracker-ipv6.patch b/tracker-ipv6.patch
new file mode 100644
index 000000000000..a267fd0906fa
--- /dev/null
+++ b/tracker-ipv6.patch
@@ -0,0 +1,123 @@
+diff --git a/configure.ac b/configure.ac
+index b6cc7c1..2a8c2fb 100755
+--- a/configure.ac
++++ b/configure.ac
+@@ -18,6 +18,8 @@ RAK_ENABLE_DEBUG
+ RAK_ENABLE_EXTRA_DEBUG
+ RAK_ENABLE_WERROR
+
++AX_CXX_COMPILE_STDCXX(14, noext, mandatory)
++
+ TORRENT_DISABLE_IPV6
+
+ TORRENT_ENABLE_ARCH
+diff --git a/scripts/ax_cxx_compile_stdcxx.m4 b/scripts/ax_cxx_compile_stdcxx.m4
+old mode 100755
+new mode 100644
+diff --git a/src/command_download.cc b/src/command_download.cc
+index 25db01e..33e3b9d 100644
+--- a/src/command_download.cc
++++ b/src/command_download.cc
+@@ -435,9 +435,9 @@ t_multicall(core::Download* download, const torrent::Object::list_type& args) {
+
+ for (torrent::Object::list_const_iterator cItr = ++args.begin(); cItr != args.end(); cItr++) {
+ const std::string& cmd = cItr->as_string();
+- torrent::Tracker* t = download->tracker_list()->at(itr);
++ auto t = download->tracker_list()->at(itr);
+
+- row.push_back(rpc::parse_command(rpc::make_target(t), cmd.c_str(), cmd.c_str() + cmd.size()).first);
++ row.push_back(rpc::parse_command(rpc::make_target(t.get()), cmd.c_str(), cmd.c_str() + cmd.size()).first);
+ }
+ }
+
+diff --git a/src/command_network.cc b/src/command_network.cc
+index 0e53f17..b346bd8 100644
+--- a/src/command_network.cc
++++ b/src/command_network.cc
+@@ -5,12 +5,12 @@
+ // it under the terms of the GNU General Public License as published by
+ // the Free Software Foundation; either version 2 of the License, or
+ // (at your option) any later version.
+-//
++//
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ // GNU General Public License for more details.
+-//
++//
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+@@ -108,7 +108,7 @@ xmlrpc_find_tracker(core::Download* download, uint32_t index) {
+ if (index >= download->tracker_list()->size())
+ return NULL;
+
+- return download->tracker_list()->at(index);
++ return download->tracker_list()->at(index).get();
+ }
+
+ torrent::Peer*
+diff --git a/src/command_tracker.cc b/src/command_tracker.cc
+index 47d8f18..00a71f6 100644
+--- a/src/command_tracker.cc
++++ b/src/command_tracker.cc
+@@ -98,12 +98,12 @@ apply_dht_add_node(const std::string& arg) {
+
+ torrent::Object
+ apply_enable_trackers(int64_t arg) {
+- for (core::Manager::DListItr itr = control->core()->download_list()->begin(), last = control->core()->download_list()->end(); itr != last; ++itr) {
+- std::for_each((*itr)->tracker_list()->begin(), (*itr)->tracker_list()->end(),
+- arg ? std::mem_fun(&torrent::Tracker::enable) : std::mem_fun(&torrent::Tracker::disable));
++ for (auto&& itr : *control->core()->download_list()) {
++ std::for_each(itr->tracker_list()->begin(), itr->tracker_list()->end(),
++ [arg](auto& v){ return arg ? v->enable() : v->disable(); });
+
+ if (arg && !rpc::call_command_value("trackers.use_udp"))
+- (*itr)->enable_udp_trackers(false);
++ itr->enable_udp_trackers(false);
+ }
+
+ return torrent::Object();
+diff --git a/src/display/utils.cc b/src/display/utils.cc
+index 5a5ae8f..62a392d 100644
+--- a/src/display/utils.cc
++++ b/src/display/utils.cc
+@@ -197,9 +197,8 @@ print_download_status(char* first, char* last, core::Download* d) {
+ (d->download()->chunks_hashed() * 100) / d->download()->file_list()->size_chunks());
+
+ } else if (d->tracker_list()->has_active_not_scrape()) {
+- torrent::TrackerList::iterator itr =
+- std::find_if(d->tracker_list()->begin(), d->tracker_list()->end(),
+- std::mem_fun(&torrent::Tracker::is_busy_not_scrape));
++ auto itr = std::find_if(d->tracker_list()->begin(), d->tracker_list()->end(), [](auto& v){ return v->is_busy_not_scrape(); });
++
+ char status[128];
+
+ (*itr)->get_status(status, sizeof(status));
+diff --git a/src/display/window_tracker_list.cc b/src/display/window_tracker_list.cc
+index 66a3457..2d6178b 100644
+--- a/src/display/window_tracker_list.cc
++++ b/src/display/window_tracker_list.cc
+@@ -81,7 +81,7 @@ WindowTrackerList::redraw() {
+ unsigned int group = tl->at(range.first)->group();
+
+ while (range.first != range.second) {
+- torrent::Tracker* tracker = tl->at(range.first);
++ auto tracker = tl->at(range.first);
+
+ if (tracker->group() == group)
+ m_canvas->print(0, pos, "%2i:", group++);
+diff --git a/src/ui/element_tracker_list.cc b/src/ui/element_tracker_list.cc
+index c048165..2d0a069 100644
+--- a/src/ui/element_tracker_list.cc
++++ b/src/ui/element_tracker_list.cc
+@@ -103,7 +103,7 @@ ElementTrackerList::receive_disable() {
+ if (m_window == NULL)
+ throw torrent::internal_error("ui::ElementTrackerList::receive_disable(...) called on a disabled object");
+
+- torrent::Tracker* t = m_download->download()->tracker_list()->at(m_focus);
++ auto t = m_download->download()->tracker_list()->at(m_focus);
+
+ if (t->is_enabled())
+ t->disable();