aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2014-07-30 15:44:00 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2014-07-30 15:44:00 +0200
commit32cbca3231fa46ccf05eb8ef94adb2f973292990 (patch)
tree15adff3ddf79cabc92ea1be5e529a6c1c2dd6c0a /main
parent0615b6c0b127285338934ef4d7b874a65225174e (diff)
downloadaports-32cbca3231fa46ccf05eb8ef94adb2f973292990.tar.bz2
aports-32cbca3231fa46ccf05eb8ef94adb2f973292990.tar.xz
main/btrfs-progs: musl compat
Diffstat (limited to 'main')
-rw-r--r--main/btrfs-progs/APKBUILD14
-rw-r--r--main/btrfs-progs/musl-compat.patch23
2 files changed, 32 insertions, 5 deletions
diff --git a/main/btrfs-progs/APKBUILD b/main/btrfs-progs/APKBUILD
index 3ba2349bb1..9ad8309361 100644
--- a/main/btrfs-progs/APKBUILD
+++ b/main/btrfs-progs/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=btrfs-progs
pkgver=3.14.2
-pkgrel=0
+pkgrel=1
pkgdesc="Tools for the btrfs"
url="https://btrfs.wiki.kernel.org/"
arch="all"
@@ -12,7 +12,8 @@ makedepends="util-linux-dev bash attr-dev acl-dev e2fsprogs-dev zlib-dev
install=
subpackages="$pkgname-doc $pkgname-dev"
source="https://www.kernel.org/pub/linux/kernel/people/mason/btrfs-progs/btrfs-progs-v${pkgver}.tar.xz
- includes.patch"
+ includes.patch
+ musl-compat.patch"
_builddir="$srcdir"/$pkgname-v$pkgver
prepare() {
@@ -40,8 +41,11 @@ dev() {
}
md5sums="18dadb86a668c3fe26b2bcb57bbdf59e btrfs-progs-v3.14.2.tar.xz
-e6e23724e95b3684631385c0f2898cad includes.patch"
+e6e23724e95b3684631385c0f2898cad includes.patch
+13aae8338d103c1bdfab26ee324cfe20 musl-compat.patch"
sha256sums="70e1d0ca887bfa5062dc74cc5d4556c19adb08453fbfa57edae6802d9c917793 btrfs-progs-v3.14.2.tar.xz
-e4a7f8b749f11e5b7074c014a169cee83c73a7a06f53e3f9ba18e3b7d433e027 includes.patch"
+e4a7f8b749f11e5b7074c014a169cee83c73a7a06f53e3f9ba18e3b7d433e027 includes.patch
+6ef4d5633aa715095610de3045187ba39daaf5518629eb4e6ef4e143fb486531 musl-compat.patch"
sha512sums="02f0cf7581b41143707769e53debecfdd3f5a1dd717530c33d4a657b09feafd73bb43408516a58fb6d2754365803018673321c7c1898b81bb36194f05a0d8955 btrfs-progs-v3.14.2.tar.xz
-64d9ae9dd3c080a69f80fcd2986f096b881bbfb7c415abfbf7538b334a926da440c4098014a3d8f87a862524c21bc6654a98b5afde3939cefd40b8b4708f9ca1 includes.patch"
+64d9ae9dd3c080a69f80fcd2986f096b881bbfb7c415abfbf7538b334a926da440c4098014a3d8f87a862524c21bc6654a98b5afde3939cefd40b8b4708f9ca1 includes.patch
+c7634159e591bf969dad8fa51d48668c999de8efc8cb6ff26b7a047b27a8cd18b1a93494dbf6d584afcbc6e3f40ae98ea3a33d188ee16b06ad7eb564efccde9a musl-compat.patch"
diff --git a/main/btrfs-progs/musl-compat.patch b/main/btrfs-progs/musl-compat.patch
new file mode 100644
index 0000000000..63e6220007
--- /dev/null
+++ b/main/btrfs-progs/musl-compat.patch
@@ -0,0 +1,23 @@
+--- a/utils.c
++++ b/utils.c
+@@ -833,13 +833,19 @@
+ {
+ int ret;
+ FILE *f;
++ struct stat stat_buf;
+ char fmt[20];
+ char p[PATH_MAX];
+ char real_loop_dev[PATH_MAX];
+
+ if (!realpath(loop_dev, real_loop_dev))
+ return -errno;
+- snprintf(p, PATH_MAX, "/sys/block/%s/loop/backing_file", strrchr(real_loop_dev, '/'));
++
++ if (stat(real_loop_dev, &stat_buf) || !S_ISBLK(stat_buf.st_mode))
++ return -errno;
++
++ snprintf(p, PATH_MAX, "/sys/dev/block/%d:%d/loop/backing_file",
++ major(stat_buf.st_rdev), minor(stat_buf.st_rdev));
+ if (!(f = fopen(p, "r")))
+ return -errno;
+