summaryrefslogtreecommitdiff
path: root/sys-fs/btrfs-progs
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-04-25 23:59:45 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-04-25 23:59:45 +0100
commit6243676c91946098c06d42bc87b5eb99aac40bf0 (patch)
treee6de308ba22148b4898b67b049c7f017ece8fea2 /sys-fs/btrfs-progs
parentb987a550f067c3da93b0664cf1fdc8a624c0aa38 (diff)
gentoo auto-resync : 25:04:2024 - 23:59:45
Diffstat (limited to 'sys-fs/btrfs-progs')
-rw-r--r--sys-fs/btrfs-progs/Manifest3
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-6.8.ebuild3
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-6.8-musl-1.2.5.patch209
3 files changed, 214 insertions, 1 deletions
diff --git a/sys-fs/btrfs-progs/Manifest b/sys-fs/btrfs-progs/Manifest
index f4cad1015943..c07f2db7b07f 100644
--- a/sys-fs/btrfs-progs/Manifest
+++ b/sys-fs/btrfs-progs/Manifest
@@ -1,3 +1,4 @@
+AUX btrfs-progs-6.8-musl-1.2.5.patch 6548 BLAKE2B 6c49be6ca93f12772a98b109c13c70b66e52837f037a019d79aa56a3fc7863a8971319ee61215626873ec8e1704ddd69777922a53afe72577e1bd2e181747106 SHA512 d662d5d19bfa2458dc26c8b3fec3819b10a2f1192458f9ba036b50fad120da2ad3c65e85e69e8738d9d3747a65166b04548a0ad47ce8104f21925df5a00c5d7b
DIST btrfs-progs-v6.6.3.tar.sign 566 BLAKE2B 9f8a14405f78c8eb5a92d59f9ca776cd15bfd43bc323a0f5a98cc2d9a6f782e999a792ddb266fef4dfe189e1cb8eebbd021a12b615e22bdd4097a74bf3b277a9 SHA512 07f062cf66c0e5f0bd833f0a1c9901ec06ac4eb258acec8e96ffbb0b85007a67bdc992492b25f6039fcf603352131fca8c57162fa61007e8ccf1f4edf71dab97
DIST btrfs-progs-v6.6.3.tar.xz 2557216 BLAKE2B 274fad52bcab45bd0f6496c1bc10e1736e7b766f53b712790996a8a38f74eedcc570783599bed62cd4f84e5629f2216340a66941d9fbe0c7890f1c56ed66df8a SHA512 93e1defacf0f280fc02e10a20fd2bc3775c52956a0339e30b829cc3bef85629d565cf3f6a9af126e38bbb73e8e9b9a0069abbe0e57957a56ca1a8826f5de624a
DIST btrfs-progs-v6.7.1.tar.sign 566 BLAKE2B e5aba64e199f26cef84a8cbbb034c0a5c24572e43fef2fdce79f0dbd892b1609876f681bf79de53e6473345f3de8b8fee6aac2d33673e0b080ab33fb935bd32d SHA512 8fad1c2c47356a04434e12621c526603bf651bdcb0a08deb4022d83953d8c501b8aaa2da05cbf94e0bde43b48a4135fff78a5746423466036ff4899dd79b9589
@@ -6,6 +7,6 @@ DIST btrfs-progs-v6.8.tar.sign 566 BLAKE2B 2f063015b515980a88980d02ac359363506d8
DIST btrfs-progs-v6.8.tar.xz 2587804 BLAKE2B 0f4cc83fa896bc932fdcd34fffae72b0fad44424ac0b5e2b7bde44dd91fcef33f2fa2ef36eb77299de753e4d4b47794cabad5d84760b9d34a9b6765a834d15b7 SHA512 adce7c15ef5a19c4fc513f1743b4f65f2c72aa4490703d36c93230abb305c576bd69a32c4bcf19c2b58aee5b5755e0d54fb82fe649a5fe021366eb0d89af4261
EBUILD btrfs-progs-6.6.3.ebuild 4581 BLAKE2B c5fd9d72bfe270bf54838e0b0eff08cb9405711792cdd1775f21ff853a6202ba0f7ccff8a043f39da02d8cdcd36a253d03c53812ad293f64b6ce26df9e1c505e SHA512 a8af6e0941002d70cebef2fd96838c1bf630ad95bd4871e83097fd552ec5f01d253f675c05551f56c92871d5a40acae697c1f69e194c1cc9b915bb9acdb1cdc9
EBUILD btrfs-progs-6.7.1.ebuild 4581 BLAKE2B c5fd9d72bfe270bf54838e0b0eff08cb9405711792cdd1775f21ff853a6202ba0f7ccff8a043f39da02d8cdcd36a253d03c53812ad293f64b6ce26df9e1c505e SHA512 a8af6e0941002d70cebef2fd96838c1bf630ad95bd4871e83097fd552ec5f01d253f675c05551f56c92871d5a40acae697c1f69e194c1cc9b915bb9acdb1cdc9
-EBUILD btrfs-progs-6.8.ebuild 4587 BLAKE2B 56fdeba0f5693caac717e63dba5c5cc62068f4b0a013c07c5407b1c19c114c8a2697ded9bcd4974e8fddb87631c8d324150e076eb7e744e4ddb650eb4684ef40 SHA512 a71b38d90bb773e5beafadae60411815f18e33c561e31c5c089d574043e7332a28968486a35fcab24893876728bceb10006b0f772bd7fdc55776afc7c9484ba7
+EBUILD btrfs-progs-6.8.ebuild 4664 BLAKE2B 0b4ecbac2a6303d8d58434c438f585c2f429ee0ee73fa1dc3e1662bdb8197cdf9d24b31c246dbfbb2f2835398c12be332f8dfb264faa1e64b29858f5443ed731 SHA512 96aff43e2b197f568cf72e17eaa17b2289024804d1c2a5aef2cff4ffde92c6db8e20752df7de9cb53df1548b29e71eb7bb5d058ebd36868359d5bbb560f4a3b6
EBUILD btrfs-progs-9999.ebuild 4587 BLAKE2B 56fdeba0f5693caac717e63dba5c5cc62068f4b0a013c07c5407b1c19c114c8a2697ded9bcd4974e8fddb87631c8d324150e076eb7e744e4ddb650eb4684ef40 SHA512 a71b38d90bb773e5beafadae60411815f18e33c561e31c5c089d574043e7332a28968486a35fcab24893876728bceb10006b0f772bd7fdc55776afc7c9484ba7
MISC metadata.xml 610 BLAKE2B 70361c4d5434a98f73a3d38ed47d7be830783529db6217396f2235cdedd58744fc6e52e4de1994d28184fe9d8aa5d2982c433d47eda1868cfdb79edf0769a620 SHA512 8958c02574adb1395a9d21d9e9ad5db38570b82a1c7211752eb007eecbd0e541e880a060649641f40be877f167e14f278f14d5ef8775766ef9a6fa5d3843dc53
diff --git a/sys-fs/btrfs-progs/btrfs-progs-6.8.ebuild b/sys-fs/btrfs-progs/btrfs-progs-6.8.ebuild
index c9770f5998ae..1f531bde0013 100644
--- a/sys-fs/btrfs-progs/btrfs-progs-6.8.ebuild
+++ b/sys-fs/btrfs-progs/btrfs-progs-6.8.ebuild
@@ -122,6 +122,9 @@ src_unpack() {
src_prepare() {
default
+ # bug 926288
+ use elibc_musl && eapply "${FILESDIR}/${P}-musl-1.2.5.patch"
+
if [[ ${PV} == 9999 ]]; then
AT_M4DIR="m4" eautoreconf
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-6.8-musl-1.2.5.patch b/sys-fs/btrfs-progs/files/btrfs-progs-6.8-musl-1.2.5.patch
new file mode 100644
index 000000000000..19737515b616
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-6.8-musl-1.2.5.patch
@@ -0,0 +1,209 @@
+From 45ca77f9e4cfe5fd5814d553502ef99877c9e972 Mon Sep 17 00:00:00 2001
+From: David Sterba <dsterba@suse.com>
+Date: Thu, 18 Apr 2024 18:57:08 +0200
+Subject: [PATCH] btrfs-progs: add basename wrappers for unified semantics
+
+What basename(3) does with the argument depends on _GNU_SOURCE and
+inclusion of libgen.h. This is problematic on Musl (1.2.5) as reported.
+
+We want the GNU semantics that does not modify the argument. Common way
+to make it portable is to add own helper. This is now implemented in
+path_basename() that does not use the libc provided basename but preserves
+the semantics. The path_dirname() is just for parity, otherwise same as
+dirname().
+
+Sources:
+- https://bugs.gentoo.org/926288
+- https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Issue: #778
+Signed-off-by: David Sterba <dsterba@suse.com>
+---
+ cmds/subvolume.c | 26 +++++++++++++-------------
+ common/device-utils.c | 4 ++--
+ common/path-utils.c | 28 ++++++++++++++++++++++++++++
+ common/path-utils.h | 2 ++
+ 4 files changed, 45 insertions(+), 15 deletions(-)
+
+diff --git a/cmds/subvolume.c b/cmds/subvolume.c
+index 5d53efe6f..869d7077d 100644
+--- a/cmds/subvolume.c
++++ b/cmds/subvolume.c
+@@ -24,7 +24,6 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <errno.h>
+-#include <libgen.h>
+ #include <getopt.h>
+ #include <dirent.h>
+ #include <stdbool.h>
+@@ -149,7 +148,7 @@ static int create_one_subvolume(const char *dst, struct btrfs_qgroup_inherit *in
+ int fddst = -1;
+ char *dupname = NULL;
+ char *dupdir = NULL;
+- char *newname;
++ const char *newname;
+ char *dstdir;
+
+ ret = path_is_dir(dst);
+@@ -170,7 +169,7 @@ static int create_one_subvolume(const char *dst, struct btrfs_qgroup_inherit *in
+ ret = -ENOMEM;
+ goto out;
+ }
+- newname = basename(dupname);
++ newname = path_basename(dupname);
+
+ dupdir = strdup(dst);
+ if (!dupdir) {
+@@ -178,7 +177,7 @@ static int create_one_subvolume(const char *dst, struct btrfs_qgroup_inherit *in
+ ret = -ENOMEM;
+ goto out;
+ }
+- dstdir = dirname(dupdir);
++ dstdir = path_dirname(dupdir);
+
+ if (!test_issubvolname(newname)) {
+ error("invalid subvolume name: %s", newname);
+@@ -364,7 +363,8 @@ static int cmd_subvolume_delete(const struct cmd_struct *cmd, int argc, char **a
+ int res, ret = 0;
+ int cnt;
+ int fd = -1;
+- char *dname, *vname, *cpath;
++ char *dname, *cpath;
++ const char *vname;
+ char *dupdname = NULL;
+ char *dupvname = NULL;
+ char *path = NULL;
+@@ -482,9 +482,9 @@ static int cmd_subvolume_delete(const struct cmd_struct *cmd, int argc, char **a
+ goto out;
+ }
+ dupdname = strdup(cpath);
+- dname = dirname(dupdname);
++ dname = path_dirname(dupdname);
+ dupvname = strdup(cpath);
+- vname = basename(dupvname);
++ vname = path_basename(dupvname);
+ free(cpath);
+
+ /* When subvolid is passed, <path> will point to the mount point */
+@@ -670,7 +670,7 @@ static int cmd_subvolume_snapshot(const struct cmd_struct *cmd, int argc, char *
+ bool readonly = false;
+ char *dupname = NULL;
+ char *dupdir = NULL;
+- char *newname;
++ const char *newname;
+ char *dstdir;
+ enum btrfs_util_error err;
+ struct btrfs_ioctl_vol_args_v2 args;
+@@ -727,13 +727,13 @@ static int cmd_subvolume_snapshot(const struct cmd_struct *cmd, int argc, char *
+
+ if (res > 0) {
+ dupname = strdup(subvol);
+- newname = basename(dupname);
++ newname = path_basename(dupname);
+ dstdir = dst;
+ } else {
+ dupname = strdup(dst);
+- newname = basename(dupname);
++ newname = path_basename(dupname);
+ dupdir = strdup(dst);
+- dstdir = dirname(dupdir);
++ dstdir = path_dirname(dupdir);
+ }
+
+ if (!test_issubvolname(newname)) {
+@@ -1557,7 +1557,7 @@ static int cmd_subvolume_show(const struct cmd_struct *cmd, int argc, char **arg
+ struct btrfs_util_subvolume_iterator *iter;
+ struct btrfs_util_subvolume_info subvol;
+ char *subvol_path = NULL;
+- char *subvol_name = NULL;
++ const char *subvol_name = NULL;
+ enum btrfs_util_error err;
+ struct btrfs_qgroup_stats stats;
+ unsigned int unit_mode;
+@@ -1669,7 +1669,7 @@ static int cmd_subvolume_show(const struct cmd_struct *cmd, int argc, char **arg
+ subvol_path = strdup("/");
+ subvol_name = "<FS_TREE>";
+ } else {
+- subvol_name = basename(subvol_path);
++ subvol_name = path_basename(subvol_path);
+ }
+
+ if (bconf.output_format == CMD_FORMAT_JSON) {
+diff --git a/common/device-utils.c b/common/device-utils.c
+index 36108ec4e..d086e9ea2 100644
+--- a/common/device-utils.c
++++ b/common/device-utils.c
+@@ -343,14 +343,14 @@ static u64 device_get_partition_size_sysfs(const char *dev)
+ char path[PATH_MAX] = {};
+ char sysfs[PATH_MAX] = {};
+ char sizebuf[128] = {};
+- char *name = NULL;
++ const char *name = NULL;
+ int sysfd;
+ unsigned long long size = 0;
+
+ name = realpath(dev, path);
+ if (!name)
+ return 0;
+- name = basename(path);
++ name = path_basename(path);
+
+ ret = path_cat3_out(sysfs, "/sys/class/block", name, "size");
+ if (ret < 0)
+diff --git a/common/path-utils.c b/common/path-utils.c
+index 181737c4d..929e5c8fa 100644
+--- a/common/path-utils.c
++++ b/common/path-utils.c
+@@ -28,6 +28,11 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <ctype.h>
++/*
++ * For dirname() and basename(), but never use basename directly, there's
++ * path_basename() with unified GNU behaviour regardless of the includes and
++ * conditional defines. See basename(3) for more.
++ */
+ #include <libgen.h>
+ #include <limits.h>
+ #include "common/path-utils.h"
+@@ -482,3 +487,26 @@ int test_issubvolname(const char *name)
+ strcmp(name, ".") && strcmp(name, "..");
+ }
+
++/*
++ * Unified GNU semantics basename helper, never changing the argument. Always
++ * use this instead of basename().
++ */
++const char *path_basename(const char *path)
++{
++ const char *tmp = strrchr(path, '/');
++
++ /* Special case when the whole path is just "/". */
++ if (path[0] == '/' && path[1] == 0)
++ return path;
++
++ return tmp ? tmp + 1 : path;
++}
++
++/*
++ * Return dirname component of path, may change the argument.
++ * Own helper for parity with path_basename().
++ */
++char *path_dirname(char *path)
++{
++ return dirname(path);
++}
+diff --git a/common/path-utils.h b/common/path-utils.h
+index 08ae0ff10..697fa6b48 100644
+--- a/common/path-utils.h
++++ b/common/path-utils.h
+@@ -39,6 +39,8 @@ int path_is_dir(const char *path);
+ int is_same_loop_file(const char *a, const char *b);
+ int path_is_reg_or_block_device(const char *filename);
+ int path_is_in_dir(const char *parent, const char *path);
++const char *path_basename(const char *path);
++char *path_dirname(char *path);
+
+ int test_issubvolname(const char *name);
+