summaryrefslogtreecommitdiff
path: root/sys-fs/btrfs-progs
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-fs/btrfs-progs
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-fs/btrfs-progs')
-rw-r--r--sys-fs/btrfs-progs/Manifest9
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.14.2.ebuild62
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.16.2.ebuild63
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.17.3.ebuild63
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.18.2.ebuild63
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.19.1.ebuild80
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-4.0.1.ebuild80
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-4.0.ebuild80
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-4.1.2.ebuild81
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-4.1.ebuild81
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-9999.ebuild81
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-0.19-convert-remove-used-space-update.patch30
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-0.19-fix-underlinking.patch11
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-0.19-glibc212.patch17
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-3.12-defrag-sockets.patch78
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-3.12-fix-send-subvol-492776.patch111
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-3.14.1-arg_strtou64.patch146
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-3.14.2-install-man.patch13
-rw-r--r--sys-fs/btrfs-progs/metadata.xml15
19 files changed, 1164 insertions, 0 deletions
diff --git a/sys-fs/btrfs-progs/Manifest b/sys-fs/btrfs-progs/Manifest
new file mode 100644
index 00000000000..c4f414568d2
--- /dev/null
+++ b/sys-fs/btrfs-progs/Manifest
@@ -0,0 +1,9 @@
+DIST btrfs-progs-v3.14.2.tar.xz 275372 SHA256 70e1d0ca887bfa5062dc74cc5d4556c19adb08453fbfa57edae6802d9c917793 SHA512 02f0cf7581b41143707769e53debecfdd3f5a1dd717530c33d4a657b09feafd73bb43408516a58fb6d2754365803018673321c7c1898b81bb36194f05a0d8955 WHIRLPOOL 4561adf84b6570e165be04c8c7b014646f4be11b7f9840a5929103271cb7e121006b515645968f9a4b7cbaf8b0a407c2e74b82b91bd6688b7f58b06fedf70e95
+DIST btrfs-progs-v3.16.2.tar.xz 291604 SHA256 d4d62abe0c2b8e86888f96e4bd21ca7e25c2d53120a3b9e8c6f987344147732b SHA512 7dc0f2f8f0bbddbbf1d4d99854425341c4b3997334c65d7e936bcec1ee5ca880101b8b45498721502857b478edae6237a934c7d4acb735de43c6d8ff35efe53b WHIRLPOOL 19e1fadeefcd40bfecf1b957c37da3387351e1f6cae04add59fd689524338c165e3547b799520e74bacc351ef236eec2481c1043159b58358b77cd74cf3db281
+DIST btrfs-progs-v3.17.3.tar.xz 588424 SHA256 e7bd9ff8d95b515973d3a1255c17fd481bcd75e4420f00c6c9c99489d1ddac2c SHA512 faa9b0d5281f72777d4b64b96774dcb1d6f579fd84e3bac3c256e779bf6fd67ee17aaf8f904dd29a8a8592f504e3e8af0caf1ab261689457a30467d3c1fb6a71 WHIRLPOOL 6ce02a7b078a277b882a2249ea4b628ce7b5dd16572d618b8cb999f88115c84ac30c9c9928525754edd458f86a458c9cf5c1753cb293c49e0d000795fae31604
+DIST btrfs-progs-v3.18.2.tar.xz 1029228 SHA256 dd8ddb4d201e5ffd32a15ed0e1f33fbc2c8fb16383f1519a9fae136698c2dfec SHA512 7fd125eeedabd54178f5198ac09c364b6772125124adcdb2620515a51c331307205ae06ff81375a49ebc62650d537c6f9eed2b63bf1f7e97b9ff047cda8a2cc4 WHIRLPOOL e5df056188abc2f57941b92be2774208fd1409f580c9604242f81aeda78f4be6d95f4cacfcf39917db363a033fb3b11f1eb864c15cccf24491fc1b660fce3803
+DIST btrfs-progs-v3.19.1.tar.xz 1101168 SHA256 248862a7e7e06188bb495bbaa05d3e0e34628b61a10ef03234b3b00698ce88db SHA512 c8b1c348afe3e32f54a72fcf361700bd63c12272e34ab34774936a2eca338dbea568d452f494d6ddd3c7be75b37a6d400fec33500548ed9b6df008212613d7f5 WHIRLPOOL 75bb08fe5ab49711f264d6cd35ddac39ea722ef2bcd57c53ad0d483cdf329b1b1b89c0b70280dea161568fd78c44eae30c76fb574ee649200237a13b3df1d8d4
+DIST btrfs-progs-v4.0.1.tar.xz 1104340 SHA256 2c2e10e79edd16a92effe8619c527fd130bc272fbca67896e1705bb2ec0293cb SHA512 52e5165f2fdd0f27f9c2f099b774523c36ab442948a13ede03736297a139903af4c0c444c77abc14b05f3cf633b006eb9dbc29f2b127858698ee1b6ad517a53f WHIRLPOOL ad8d2280c9205537a1045a835bffb39d73684fea87841215cd0916fdc91285aa299dc5885446b3c3aa50fcc2ab562a4b58a33cc9537ede3f57df4bc566aacb47
+DIST btrfs-progs-v4.0.tar.xz 1102500 SHA256 179cf1acc1b0061548b8f1d9cf973a8338bf96f192cecad99ecdace9ae065a1f SHA512 895d6c27bd82c4b320c705c32613b28e601f316c0881080d8c376d0045162eaab6c91431dee73b391fc608e6d7c16f3a744ef6b9c85adb4beaa4376fbbe36d9a WHIRLPOOL cf71cc4ab6c85e8673143bb779c7b252caf1bfabc14fb2d7dd3477bd842b491ac3d7f121c3dcbecec023c5873c4b4400a5f2087e55bbee14217982f9712d5c2f
+DIST btrfs-progs-v4.1.2.tar.xz 1123080 SHA256 62db60c6a0868afb6302112cea54c756873bc30b826696b167ec03ecd61b2f12 SHA512 dd159bcc3adb65efd4f612d75f5a6b30df8ad9fa06ef952dd03dac965256de37eab26f4cc2fb3840178403ccbb7368cae11638e27eadb9b1835b636c4b126e2e WHIRLPOOL 819e6d61ecbb0f2d099abcda70ae9ab53b3311a28131fdedbbad7cc033c4984309a460f704d2f2ce7cf36cf0e034e82618c1b45002fdfbb5eced648883e12a29
+DIST btrfs-progs-v4.1.tar.xz 1119564 SHA256 abc6ff9dbbf948e7358edd34db32103cba8b86c5cb9e3ed7eb3b5630e2feb7e8 SHA512 0c596bab3276d1dc6de010ce94a1d7758c80fe21d540b2d4b3487e0a5cf0a63b27fdba3e1af42aa349447a0be459f2087f9b4ae03fdc0dfcc4f316e570893346 WHIRLPOOL 97ae77f578f162ec114e137899f195ec0e28097902e2f2ae5e1f37db359cd6c1bae2f0fb6641b0365df80defb844d58603623db27dc63c1576437efcaf19d3e6
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.14.2.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.14.2.ebuild
new file mode 100644
index 00000000000..3b97509798d
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.14.2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha amd64 arm ~ia64 ~mips ppc ppc64 ~sparc x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/mason/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ inherit git-2
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE=""
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ sys-fs/e2fsprogs:0=
+"
+DEPEND="${RDEPEND}
+ sys-apps/acl
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.14.2-install-man.patch"
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ BUILD_VERBOSE=1
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ prefix=/usr \
+ bindir=/sbin \
+ libdir=/usr/$(get_libdir) \
+ mandir=/usr/share/man
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.16.2.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.16.2.ebuild
new file mode 100644
index 00000000000..f0ff067c0de
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.16.2.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE=""
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ sys-fs/e2fsprogs:0=
+"
+DEPEND="${RDEPEND}
+ sys-apps/acl
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ BUILD_VERBOSE=1
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ prefix=/usr \
+ bindir=/sbin \
+ libdir=/usr/$(get_libdir) \
+ mandir=/usr/share/man
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.17.3.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.17.3.ebuild
new file mode 100644
index 00000000000..ea08de43e2d
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.17.3.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE=""
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ sys-fs/e2fsprogs:0=
+"
+DEPEND="${RDEPEND}
+ sys-apps/acl
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ BUILD_VERBOSE=1
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ prefix=/usr \
+ bindir=/sbin \
+ libdir=/usr/$(get_libdir) \
+ mandir=/usr/share/man
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.18.2.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.18.2.ebuild
new file mode 100644
index 00000000000..8ef9a0298c0
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.18.2.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE=""
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ sys-fs/e2fsprogs:0=
+"
+DEPEND="${RDEPEND}
+ sys-apps/acl
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ BUILD_VERBOSE=1
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ prefix=/usr \
+ bindir=/sbin \
+ libdir=/usr/$(get_libdir) \
+ mandir=/usr/share/man
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.19.1.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.19.1.ebuild
new file mode 100644
index 00000000000..1d85858c9f6
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.19.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.0.1.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.0.1.ebuild
new file mode 100644
index 00000000000..0bf8aaa7fe8
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-4.0.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha amd64 arm ~arm64 ~ia64 ~mips ppc ~ppc64 ~sparc x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.0.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.0.ebuild
new file mode 100644
index 00000000000..1d85858c9f6
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-4.0.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.1.2.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.1.2.ebuild
new file mode 100644
index 00000000000..4f0cc37e6cc
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-4.1.2.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+ EGIT_BRANCH="devel"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.1.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.1.ebuild
new file mode 100644
index 00000000000..4f0cc37e6cc
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-4.1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+ EGIT_BRANCH="devel"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild b/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild
new file mode 100644
index 00000000000..4f0cc37e6cc
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+ EGIT_BRANCH="devel"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-0.19-convert-remove-used-space-update.patch b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-convert-remove-used-space-update.patch
new file mode 100644
index 00000000000..e326f34af7e
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-convert-remove-used-space-update.patch
@@ -0,0 +1,30 @@
+--- /var/tmp/portage/sys-fs/btrfs-progs-0.19/work/btrfs-progs-0.19/convert.c 2009-06-11 10:56:15.000000000 -0600
++++ btrfs-progs-unstable/convert.c 2009-09-21 08:51:43.773575874 -0600
+@@ -370,7 +370,6 @@
+ struct btrfs_extent_item *ei;
+ u32 blocksize = root->sectorsize;
+ u64 nbytes;
+- u64 bytes_used;
+
+ if (disk_bytenr == 0) {
+ ret = btrfs_insert_file_extent(trans, root, objectid,
+@@ -432,9 +431,6 @@
+ nbytes = btrfs_stack_inode_nbytes(inode) + num_bytes;
+ btrfs_set_stack_inode_nbytes(inode, nbytes);
+
+- bytes_used = btrfs_root_used(&root->root_item);
+- btrfs_set_root_used(&root->root_item, bytes_used + num_bytes);
+-
+ btrfs_release_path(root, &path);
+
+ ins_key.objectid = disk_bytenr;
+@@ -454,9 +450,6 @@
+
+ btrfs_mark_buffer_dirty(leaf);
+
+- bytes_used = btrfs_super_bytes_used(&info->super_copy);
+- btrfs_set_super_bytes_used(&info->super_copy, bytes_used +
+- num_bytes);
+ ret = btrfs_update_block_group(trans, root, disk_bytenr,
+ num_bytes, 1, 0);
+ if (ret)
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-0.19-fix-underlinking.patch b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-fix-underlinking.patch
new file mode 100644
index 00000000000..38a0a18dbc6
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-fix-underlinking.patch
@@ -0,0 +1,11 @@
+--- btrfs-progs-0.19/Makefile~ 2011-06-05 10:21:04.000000000 -0600
++++ btrfs-progs-0.19/Makefile 2011-06-05 10:21:46.000000000 -0600
+@@ -75,7 +75,7 @@ quick-test: $(objects) quick-test.o
+ gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
+
+ convert: $(objects) convert.o
+- gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS)
++ gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs -lcom_err $(LDFLAGS) $(LIBS)
+
+ ioctl-test: $(objects) ioctl-test.o
+ gcc $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS)
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-0.19-glibc212.patch b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-glibc212.patch
new file mode 100644
index 00000000000..183fe2af3ea
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-glibc212.patch
@@ -0,0 +1,17 @@
+btrfsck.o: In function `maybe_free_inode_rec':
+btrfsck.c:(.text+0xce6): undefined reference to `S_ISDIR'
+btrfsck.c:(.text+0xd13): undefined reference to `S_ISREG'
+btrfsck.c:(.text+0xdc7): undefined reference to `S_ISREG'
+btrfsck.c:(.text+0xe2e): undefined reference to `S_ISLNK'
+btrfsck.c:(.text+0xe5b): undefined reference to `S_ISLNK'
+
+--- btrfsck.c
++++ btrfsck.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
++#include <sys/stat.h>
+ #include "kerncompat.h"
+ #include "ctree.h"
+ #include "disk-io.h"
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-3.12-defrag-sockets.patch b/sys-fs/btrfs-progs/files/btrfs-progs-3.12-defrag-sockets.patch
new file mode 100644
index 00000000000..e2feb0bdbef
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-3.12-defrag-sockets.patch
@@ -0,0 +1,78 @@
+From: Pascal VITOUX <vitoux.pascal@gmail.com>
+To: linux-btrfs@vger.kernel.org
+Cc: Pascal VITOUX <vitoux.pascal@gmail.com>
+Subject: [PATCH] btrfs-progs: skip non-regular files while defragmenting
+Date: Thu, 9 Jan 2014 23:47:14 +0100
+Message-Id: <1389307634-8226-1-git-send-email-vitoux.pascal@gmail.com>
+X-Mailer: git-send-email 1.8.5.2
+Sender: linux-btrfs-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-btrfs.vger.kernel.org>
+X-Mailing-List: linux-btrfs@vger.kernel.org
+
+Skip non-regular files to avoid ioctl errors while defragmenting.
+
+They are silently ignored in recursive mode but reported as errors when
+used as command-line arguments.
+
+Signed-off-by: Pascal VITOUX <vitoux.pascal@gmail.com>
+Gentoo-bug: https://bugs.gentoo.org/503514
+Reported-by: Antoine Lemoine
+---
+ cmds-filesystem.c | 26 ++++++++++++++++----------
+ 1 file changed, 16 insertions(+), 10 deletions(-)
+
+diff --git a/cmds-filesystem.c b/cmds-filesystem.c
+index 1c1926b..54fba10 100644
+--- a/cmds-filesystem.c
++++ b/cmds-filesystem.c
+@@ -646,7 +646,7 @@ static int defrag_callback(const char *fpath, const struct stat *sb,
+ int e = 0;
+ int fd = 0;
+
+- if (typeflag == FTW_F) {
++ if ((typeflag == FTW_F) && S_ISREG(sb->st_mode)) {
+ if (defrag_global_verbose)
+ printf("%s\n", fpath);
+ fd = open(fpath, O_RDWR);
+@@ -748,6 +748,7 @@ static int cmd_defrag(int argc, char **argv)
+ defrag_global_range.flags |= BTRFS_DEFRAG_RANGE_START_IO;
+
+ for (i = optind; i < argc; i++) {
++ struct stat st;
+ dirstream = NULL;
+ fd = open_file_or_dir(argv[i], &dirstream);
+ if (fd < 0) {
+@@ -757,16 +758,21 @@ static int cmd_defrag(int argc, char **argv)
+ close_file_or_dir(fd, dirstream);
+ continue;
+ }
++ if (fstat(fd, &st)) {
++ fprintf(stderr, "ERROR: failed to stat %s - %s\n",
++ argv[i], strerror(errno));
++ defrag_global_errors++;
++ close_file_or_dir(fd, dirstream);
++ continue;
++ }
++ if (!(S_ISDIR(st.st_mode) || S_ISREG(st.st_mode))) {
++ fprintf(stderr, "ERROR: %s is not a directory or a regular "
++ "file.\n", argv[i]);
++ defrag_global_errors++;
++ close_file_or_dir(fd, dirstream);
++ continue;
++ }
+ if (recursive) {
+- struct stat st;
+-
+- if (fstat(fd, &st)) {
+- fprintf(stderr, "ERROR: failed to stat %s - %s\n",
+- argv[i], strerror(errno));
+- defrag_global_errors++;
+- close_file_or_dir(fd, dirstream);
+- continue;
+- }
+ if (S_ISDIR(st.st_mode)) {
+ ret = nftw(argv[i], defrag_callback, 10,
+ FTW_MOUNT | FTW_PHYS);
+--
+1.8.5.2
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-3.12-fix-send-subvol-492776.patch b/sys-fs/btrfs-progs/files/btrfs-progs-3.12-fix-send-subvol-492776.patch
new file mode 100644
index 00000000000..8a2cc7883a1
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-3.12-fix-send-subvol-492776.patch
@@ -0,0 +1,111 @@
+Gentoo-bug: http://bugs.gentoo.org/492776
+
+From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
+
+Steps to reproduce:
+ # mkfs.btrfs -f /dev/sda
+ # mount /dev/sda /mnt
+ # btrfs subvolume create /mnt/foo
+ # umount /mnt
+ # mount -o subvol=foo /dev/sda /mnt
+ # btrfs sub snapshot -r /mnt /mnt/snap
+ # btrfs send /mnt/snap > /dev/null
+
+We will fail to send '/mnt/snap',this is because btrfs send try to
+open '/mnt/snap' by btrfs internal subvolume path 'foo/snap' rather
+than relative path based on mounted point, this will return us 'no
+such file or directory',this is not right, fix it.
+
+Reported-by: Thomas Scheiblauer <tom@sharkbay.at>
+Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
+---
+v1->v2:
+ code cleanups(thanks to Stefan)
+---
+ cmds-send.c | 34 ++++++----------------------------
+ 1 file changed, 6 insertions(+), 28 deletions(-)
+
+diff --git a/cmds-send.c b/cmds-send.c
+index 53e9a53..6fdfd7f 100644
+--- a/cmds-send.c
++++ b/cmds-send.c
+@@ -282,31 +282,21 @@ out:
+ return ERR_PTR(ret);
+ }
+
+-static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root_id,
+- int is_first_subvol, int is_last_subvol)
++static int do_send(struct btrfs_send *send, u64 parent_root_id,
++ int is_first_subvol, int is_last_subvol, char *subvol)
+ {
+ int ret;
+ pthread_t t_read;
+ pthread_attr_t t_attr;
+ struct btrfs_ioctl_send_args io_send;
+- struct subvol_info *si;
+ void *t_err = NULL;
+ int subvol_fd = -1;
+ int pipefd[2] = {-1, -1};
+
+- si = subvol_uuid_search(&send->sus, root_id, NULL, 0, NULL,
+- subvol_search_by_root_id);
+- if (!si) {
+- ret = -ENOENT;
+- fprintf(stderr, "ERROR: could not find subvol info for %llu",
+- root_id);
+- goto out;
+- }
+-
+- subvol_fd = openat(send->mnt_fd, si->path, O_RDONLY | O_NOATIME);
++ subvol_fd = openat(send->mnt_fd, subvol, O_RDONLY | O_NOATIME);
+ if (subvol_fd < 0) {
+ ret = -errno;
+- fprintf(stderr, "ERROR: open %s failed. %s\n", si->path,
++ fprintf(stderr, "ERROR: open %s failed. %s\n", subvol,
+ strerror(-ret));
+ goto out;
+ }
+@@ -385,10 +375,6 @@ out:
+ close(pipefd[0]);
+ if (pipefd[1] != -1)
+ close(pipefd[1]);
+- if (si) {
+- free(si->path);
+- free(si);
+- }
+ return ret;
+ }
+
+@@ -664,14 +650,6 @@ int cmd_send(int argc, char **argv)
+ goto out;
+ }
+
+- ret = get_root_id(&send, get_subvol_name(send.root_path, subvol),
+- &root_id);
+- if (ret < 0) {
+- fprintf(stderr, "ERROR: could not resolve root_id "
+- "for %s\n", subvol);
+- goto out;
+- }
+-
+ if (!full_send && !parent_root_id) {
+ ret = find_good_parent(&send, root_id, &parent_root_id);
+ if (ret < 0) {
+@@ -700,8 +678,8 @@ int cmd_send(int argc, char **argv)
+ is_first_subvol = 1;
+ is_last_subvol = 1;
+ }
+- ret = do_send(&send, root_id, parent_root_id,
+- is_first_subvol, is_last_subvol);
++ ret = do_send(&send, parent_root_id, is_first_subvol,
++ is_last_subvol, subvol);
+ if (ret < 0)
+ goto out;
+
+--
+1.8.4
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-3.14.1-arg_strtou64.patch b/sys-fs/btrfs-progs/files/btrfs-progs-3.14.1-arg_strtou64.patch
new file mode 100644
index 00000000000..a9cced815b2
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-3.14.1-arg_strtou64.patch
@@ -0,0 +1,146 @@
+From: David Sterba <dsterba@suse.cz>
+To: linux-btrfs@vger.kernel.org
+Subject: [PATCH v2] btrfs-progs: move arg_strtou64 to a separate file for library
+Date: Tue, 22 Apr 2014 17:49:01 +0200
+
+Linking with libbtrfs fails because arg_strtou64 is not defined and we
+cannot just add utils.o to library objects because it's not
+library-clean.
+
+Reported-by: Arvin Schnell <aschnell@suse.com>
+Reported-by: Anton Farygin <rider@altlinux.org>
+Signed-off-by: David Sterba <dsterba@suse.cz>
+---
+
+v2: (thanks to Hugo)
+- added missing line from comment
+- fixed typo
+- reformated comment paragraphs
+
+ Makefile | 5 +++--
+ utils-lib.c | 42 ++++++++++++++++++++++++++++++++++++++++++
+ utils.c | 33 ---------------------------------
+ 3 files changed, 45 insertions(+), 35 deletions(-)
+ create mode 100644 utils-lib.c
+
+diff --git a/Makefile b/Makefile
+index 51d53fadf5af..76565e8b2307 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,14 +9,15 @@ CFLAGS = -g -O1 -fno-strict-aliasing
+ objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
+ root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
+ extent-cache.o extent_io.o volumes.o utils.o repair.o \
+- qgroup.o raid6.o free-space-cache.o list_sort.o props.o
++ qgroup.o raid6.o free-space-cache.o list_sort.o props.o \
++ utils-lib.o
+ cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
+ cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
+ cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \
+ cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \
+ cmds-property.o
+ libbtrfs_objects = send-stream.o send-utils.o rbtree.o btrfs-list.o crc32c.o \
+- uuid-tree.o
++ uuid-tree.o utils-lib.o
+ libbtrfs_headers = send-stream.h send-utils.h send.h rbtree.h btrfs-list.h \
+ crc32c.h list.h kerncompat.h radix-tree.h extent-cache.h \
+ extent_io.h ioctl.h ctree.h btrfsck.h
+diff --git a/utils-lib.c b/utils-lib.c
+new file mode 100644
+index 000000000000..9d53c6e5c710
+--- /dev/null
++++ b/utils-lib.c
+@@ -0,0 +1,42 @@
++#define _GNU_SOURCE
++
++#include "kerncompat.h"
++#include <unistd.h>
++#include <stdlib.h>
++#include <limits.h>
++
++#if BTRFS_FLAT_INCLUDES
++#else
++#endif /* BTRFS_FLAT_INCLUDES */
++
++/*
++ * This function should be only used when parsing command arg, it won't return
++ * error to its caller and rather exit directly just like usage().
++ */
++u64 arg_strtou64(const char *str)
++{
++ u64 value;
++ char *ptr_parse_end = NULL;
++
++ value = strtoull(str, &ptr_parse_end, 0);
++ if (ptr_parse_end && *ptr_parse_end != '\0') {
++ fprintf(stderr, "ERROR: %s is not a valid numeric value.\n",
++ str);
++ exit(1);
++ }
++
++ /*
++ * if we pass a negative number to strtoull, it will return an
++ * unexpected number to us, so let's do the check ourselves.
++ */
++ if (str[0] == '-') {
++ fprintf(stderr, "ERROR: %s: negative value is invalid.\n",
++ str);
++ exit(1);
++ }
++ if (value == ULLONG_MAX) {
++ fprintf(stderr, "ERROR: %s is too large.\n", str);
++ exit(1);
++ }
++ return value;
++}
+diff --git a/utils.c b/utils.c
+index 29953d9dd2a9..e130849c7bb5 100644
+--- a/utils.c
++++ b/utils.c
+@@ -1538,39 +1538,6 @@ scan_again:
+ return 0;
+ }
+
+-/*
+- * This function should be only used when parsing
+- * command arg, it won't return error to it's
+- * caller and rather exit directly just like usage().
+- */
+-u64 arg_strtou64(const char *str)
+-{
+- u64 value;
+- char *ptr_parse_end = NULL;
+-
+- value = strtoull(str, &ptr_parse_end, 0);
+- if (ptr_parse_end && *ptr_parse_end != '\0') {
+- fprintf(stderr, "ERROR: %s is not a valid numeric value.\n",
+- str);
+- exit(1);
+- }
+- /*
+- * if we pass a negative number to strtoull,
+- * it will return an unexpected number to us,
+- * so let's do the check ourselves.
+- */
+- if (str[0] == '-') {
+- fprintf(stderr, "ERROR: %s: negative value is invalid.\n",
+- str);
+- exit(1);
+- }
+- if (value == ULLONG_MAX) {
+- fprintf(stderr, "ERROR: %s is too large.\n", str);
+- exit(1);
+- }
+- return value;
+-}
+-
+ u64 parse_size(char *s)
+ {
+ int i;
+--
+1.9.0
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-3.14.2-install-man.patch b/sys-fs/btrfs-progs/files/btrfs-progs-3.14.2-install-man.patch
new file mode 100644
index 00000000000..69e36aaadeb
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-3.14.2-install-man.patch
@@ -0,0 +1,13 @@
+diff --git a/Documentation/Makefile b/Documentation/Makefile
+index 034559e..f461bf2 100644
+--- a/Documentation/Makefile
++++ b/Documentation/Makefile
+@@ -75,7 +75,7 @@ install: install-man
+ install-man: man
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
+ $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
+- $(LNS) btrfs-check.8.gz $(DESTDIR)$(man8dir)
++ $(LNS) btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz
+
+ clean:
+ $(RM) *.xml *.xml+ *.8 *.8.gz
diff --git a/sys-fs/btrfs-progs/metadata.xml b/sys-fs/btrfs-progs/metadata.xml
new file mode 100644
index 00000000000..99f2c6f7db2
--- /dev/null
+++ b/sys-fs/btrfs-progs/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>
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <maintainer>
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
+ <use>
+ <flag name='convert'>Build ext2 conversion utility (btrfs-convert)</flag>
+ </use>
+</pkgmetadata>