From 0203a5aa0f26bb0ef334e09c8736f35275d06e8f Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Thu, 14 Jan 2016 14:02:21 +0100 Subject: [PATCH] zfs: use getopt_long for mount.zfs. --- srcpkgs/zfs/patches/getopt-musl.patch | 25 +++++++++++++++++++++++++ srcpkgs/zfs/template | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/zfs/patches/getopt-musl.patch diff --git a/srcpkgs/zfs/patches/getopt-musl.patch b/srcpkgs/zfs/patches/getopt-musl.patch new file mode 100644 index 00000000000..fe1d3bdc94d --- /dev/null +++ b/srcpkgs/zfs/patches/getopt-musl.patch @@ -0,0 +1,25 @@ +mount.zfs is called by convention (and util-linux) with arguments last, i.e. + % mount.zfs -o +Use getopt_long so musl will permute arguments. + +Passing 0 as long_opts is unspecified, but safe for glibc and musl getopt_long. + +--- a/cmd/mount_zfs/mount_zfs.c 2016-01-14 13:55:43.352951688 +0100 ++++ b/cmd/mount_zfs/mount_zfs.c 2016-01-14 13:53:35.685221569 +0100 +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + #define ZS_COMMENT 0x00000000 /* comment */ + #define ZS_ZFSUTIL 0x00000001 /* caller is zfs(8) */ +@@ -390,7 +391,7 @@ + opterr = 0; + + /* check options */ +- while ((c = getopt(argc, argv, "sfnvo:h?")) != -1) { ++ while ((c = getopt_long(argc, argv, "sfnvo:h?", 0, 0)) != -1) { + switch (c) { + case 's': + sloppy = 1; diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template index 91430736e02..1aa823d66c6 100644 --- a/srcpkgs/zfs/template +++ b/srcpkgs/zfs/template @@ -1,7 +1,7 @@ # Template file for 'zfs' pkgname=zfs version=0.6.5.4 -revision=3 +revision=4 patch_args="-Np1" wrksrc="${pkgname}-${pkgname}-${version/r/-}" build_style=gnu-configure