summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxsmile2017-03-16 01:07:09 +0100
committerxsmile2017-03-16 01:07:09 +0100
commita4dc2af7c732e8aaef000436b0bdd7b4cfe06b90 (patch)
tree1482ad7fe83e37b42d30bcf224e9c48676c94aa9
parent66566742bf2075e09f17e0f7cb4a3bf9ff69673a (diff)
downloadaur-a4dc2af7c732e8aaef000436b0bdd7b4cfe06b90.tar.gz
new version scheme, update
-rw-r--r--PKGBUILD21
-rw-r--r--lt-ps-honor_system_file_allocate_all.patch64
2 files changed, 79 insertions, 6 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7a9bd76159bf..d5ffd0dba299 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,8 @@
_pkgname=libtorrent
pkgname=libtorrent-ps
-pkgver=0.13.6
+_pkgver=0.13.6
+pkgver=1.0.r26.gcb78fc3
pkgrel=1
pkgdesc='BitTorrent library written in C++'
url='https://github.com/rakshasa/libtorrent'
@@ -11,16 +12,24 @@ arch=('any')
depends=('openssl')
provides=('libtorrent')
conflicts=('libtorrent' 'libtorrent-git' 'libtorrent-ipv6' 'libtorrent-ps-git' 'libtorrent-pyro' 'libtorrent-pyro-git')
-source=("https://github.com/rakshasa/$_pkgname/archive/$pkgver.tar.gz")
-md5sums=('8c8eaa9fa03bd113967c68eea26493e7')
+source=("https://github.com/rakshasa/$_pkgname/archive/$_pkgver.tar.gz"
+ 'lt-ps-honor_system_file_allocate_all.patch')
+md5sums=('8c8eaa9fa03bd113967c68eea26493e7'
+ '8d7f8fe5ad412bd42f2ea66131a8ce6b')
prepare() {
- cd "$srcdir/$_pkgname-$pkgver"
+ cd "$srcdir/$_pkgname-$_pkgver"
+
+ # Patch libtorrent
+ for corepatch in $srcdir/lt-ps-*_{${_pkgver},all}.patch; do
+ test ! -e "$corepatch" || { msg2 "$(basename $corepatch)"; patch -uNp1 -i "$corepatch"; }
+ done
+
./autogen.sh
}
build() {
- cd "$srcdir/$_pkgname-$pkgver"
+ cd "$srcdir/$_pkgname-$_pkgver"
./configure \
--prefix=/usr \
@@ -30,6 +39,6 @@ build() {
}
package() {
- cd "$srcdir/$_pkgname-$pkgver"
+ cd "$srcdir/$_pkgname-$_pkgver"
make DESTDIR="$pkgdir" install
}
diff --git a/lt-ps-honor_system_file_allocate_all.patch b/lt-ps-honor_system_file_allocate_all.patch
new file mode 100644
index 000000000000..bf466e3683bf
--- /dev/null
+++ b/lt-ps-honor_system_file_allocate_all.patch
@@ -0,0 +1,64 @@
+--- release/src/download/download_wrapper.cc 2015-08-08 16:01:49.000000000 +0100
++++ patched/src/download/download_wrapper.cc 2016-08-23 18:06:34.346151049 +0100
+@@ -343,6 +343,8 @@ DownloadWrapper::receive_update_prioriti
+ data()->mutable_high_priority()->insert((*itr)->range().first, (*itr)->range().second);
+ break;
+ default:
++ // Unset fallocate flag if priority of a file is Off.
++ (*itr)->unset_flags(File::flag_fallocate);
+ break;
+ }
+ }
+--- release/src/torrent/data/file.cc 2015-08-08 16:01:49.000000000 +0100
++++ patched/src/torrent/data/file.cc 2016-08-23 12:59:32.115952838 +0100
+@@ -168,13 +168,14 @@ File::resize_file() {
+ if (m_size == SocketFile(m_fd).size())
+ return true;
+
+- // For now make it so that the fallocate flag indicates if we want
+- // to do potentially blocking allocation, while FS supported
+- // non-blocking allocation is done always.
+- int flags = SocketFile::flag_fallocate;
++ int flags = 0;
+
+- if (m_flags & flag_fallocate)
++ // Set FS supported non-blocking allocation flag and potentially
++ // blocking allocation flag if fallocate flag is set.
++ if (m_flags & flag_fallocate) {
++ flags |= SocketFile::flag_fallocate;
+ flags |= SocketFile::flag_fallocate_blocking;
++ }
+
+ return SocketFile(m_fd).set_size(m_size, flags);
+ }
+--- release/src/torrent/data/file_list.cc 2015-08-08 16:01:32.000000000 +0100
++++ patched/src/torrent/data/file_list.cc 2016-08-23 17:17:19.248826853 +0100
+@@ -580,7 +580,12 @@ FileList::open_file(File* node, const Pa
+ return false;
+ }
+
+- return node->prepare(MemoryChunk::prot_read, 0);
++ // File allocation will be done if fallocate flag is set,
++ // create zero-length file otherwise.
++ if (node->has_flags(File::flag_fallocate))
++ return node->prepare(MemoryChunk::prot_write, 0);
++ else
++ return node->prepare(MemoryChunk::prot_read, 0);
+ }
+
+ MemoryChunk
+--- release/src/torrent/download.cc 2015-08-08 16:01:49.000000000 +0100
++++ patched/src/torrent/download.cc 2016-08-23 18:14:20.843623816 +0100
+@@ -131,9 +131,9 @@ Download::start(int flags) {
+
+ // file_list()->open(flags);
+
+- // If the FileList::open_no_create flag was not set, our new
+- // behavior is to create all zero-length files with
+- // flag_queued_create set.
++ // If the open_enable_fallocate or the FileList::open_no_create
++ // flag was not set, then create all zero-length files with
++ // flag_create_queued set.
+ file_list()->open(flags & ~FileList::open_no_create);
+
+ if (m_ptr->connection_type() == CONNECTION_INITIAL_SEED) {