[pacman-dev] [PATCH v2] Make DUFLAGS be overrideable during configure
Not all du implementations on linux accept --apparent-size, so let the user configure the arguments passed to du if required. This fixes FS#47943. Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com> --- configure.ac | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index dd4ac04..40062f2 100644 --- a/configure.ac +++ b/configure.ac @@ -327,12 +327,12 @@ AC_CHECK_MEMBERS([struct statfs.f_flags],,,[[#include <sys/param.h> GCC_VISIBILITY_CC # Host-dependant definitions +DEFAULT_DUFLAGS=" -sk --apparent-size" INODECMD="stat -c '%i %n'" OWNERCMD="stat -c '%u:%g'" MODECMD="stat -c '%a'" SIZECMD="stat -c %s" SEDINPLACE="sed --follow-symlinks -i" -DUFLAGS="-sk --apparent-size" STRIP_BINARIES="--strip-all" STRIP_SHARED="--strip-unneeded" STRIP_STATIC="--strip-debug" @@ -343,7 +343,7 @@ case "${host_os}" in MODECMD="stat -f '%Lp'" SIZECMD="stat -f %z" SEDINPLACE="sed -i \"\"" - DUFLAGS="-sk" + DEFAULT_DUFLAGS=" -sk" ;; darwin*) host_os_darwin=yes @@ -352,13 +352,12 @@ case "${host_os}" in MODECMD="/usr/bin/stat -f '%Lp'" SIZECMD="/usr/bin/stat -f %z" SEDINPLACE="/usr/bin/sed -i ''" - DUFLAGS="-sk" + DEFAULT_DUFLAGS=" -sk" STRIP_BINARIES="" STRIP_SHARED="-S" STRIP_STATIC="-S" ;; esac - AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes") AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] ) AC_SUBST(INODECMD) @@ -366,11 +365,16 @@ AC_SUBST(OWNERCMD) AC_SUBST(MODECMD) AC_SUBST(SIZECMD) AC_SUBST(SEDINPLACE) -AC_SUBST(DUFLAGS) AC_SUBST(STRIP_BINARIES) AC_SUBST(STRIP_SHARED) AC_SUBST(STRIP_STATIC) +# Flags for du +if test "${DUFLAGS+set}" != "set"; then + DUFLAGS="${DEFAULT_DUFLAGS}" +fi +AC_ARG_VAR(DUFLAGS, [flags for du, overriding the default]) + # Variables plugged into makepkg.conf CARCH="${host%%-*}" CHOST="${host}" -- 2.9.3
On 20/08/16 06:52, Alastair Hughes wrote:
Not all du implementations on linux accept --apparent-size, so let the user configure the arguments passed to du if required.
This fixes FS#47943.
Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com> ---
Why this approach over the previous style of: DUFLAGS="${DUFLAGS- -sk}" ?
configure.ac | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac index dd4ac04..40062f2 100644 --- a/configure.ac +++ b/configure.ac @@ -327,12 +327,12 @@ AC_CHECK_MEMBERS([struct statfs.f_flags],,,[[#include <sys/param.h> GCC_VISIBILITY_CC
# Host-dependant definitions +DEFAULT_DUFLAGS=" -sk --apparent-size" INODECMD="stat -c '%i %n'" OWNERCMD="stat -c '%u:%g'" MODECMD="stat -c '%a'" SIZECMD="stat -c %s" SEDINPLACE="sed --follow-symlinks -i" -DUFLAGS="-sk --apparent-size" STRIP_BINARIES="--strip-all" STRIP_SHARED="--strip-unneeded" STRIP_STATIC="--strip-debug" @@ -343,7 +343,7 @@ case "${host_os}" in MODECMD="stat -f '%Lp'" SIZECMD="stat -f %z" SEDINPLACE="sed -i \"\"" - DUFLAGS="-sk" + DEFAULT_DUFLAGS=" -sk" ;; darwin*) host_os_darwin=yes @@ -352,13 +352,12 @@ case "${host_os}" in MODECMD="/usr/bin/stat -f '%Lp'" SIZECMD="/usr/bin/stat -f %z" SEDINPLACE="/usr/bin/sed -i ''" - DUFLAGS="-sk" + DEFAULT_DUFLAGS=" -sk" STRIP_BINARIES="" STRIP_SHARED="-S" STRIP_STATIC="-S" ;; esac - AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes") AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] ) AC_SUBST(INODECMD) @@ -366,11 +365,16 @@ AC_SUBST(OWNERCMD) AC_SUBST(MODECMD) AC_SUBST(SIZECMD) AC_SUBST(SEDINPLACE) -AC_SUBST(DUFLAGS) AC_SUBST(STRIP_BINARIES) AC_SUBST(STRIP_SHARED) AC_SUBST(STRIP_STATIC)
+# Flags for du +if test "${DUFLAGS+set}" != "set"; then + DUFLAGS="${DEFAULT_DUFLAGS}" +fi +AC_ARG_VAR(DUFLAGS, [flags for du, overriding the default]) + # Variables plugged into makepkg.conf CARCH="${host%%-*}" CHOST="${host}"
On 8/30/16, Allan McRae <allan@archlinux.org> wrote:
On 20/08/16 06:52, Alastair Hughes wrote:
Not all du implementations on linux accept --apparent-size, so let the user configure the arguments passed to du if required.
This fixes FS#47943.
Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com> ---
Why this approach over the previous style of:
DUFLAGS="${DUFLAGS- -sk}"
?
I decided that the prior approach was messy due to the new default in the case statement. I thought that it seemed less messy and more consistent to use the case statement to set a default and then use that only if DUFLAGS was not set. Looking at this again, I realize that I've moved some things around more than they should be. I apologize for the messiness :( - I'll try to be more careful. Thanks for looking at this! Alastair Hughes
On 8/20/16, Alastair Hughes <hobbitalastair@gmail.com> wrote:
Not all du implementations on linux accept --apparent-size, so let the user configure the arguments passed to du if required.
This fixes FS#47943.
Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com> --- configure.ac | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac index dd4ac04..40062f2 100644 --- a/configure.ac +++ b/configure.ac @@ -327,12 +327,12 @@ AC_CHECK_MEMBERS([struct statfs.f_flags],,,[[#include <sys/param.h> GCC_VISIBILITY_CC
# Host-dependant definitions +DEFAULT_DUFLAGS=" -sk --apparent-size" INODECMD="stat -c '%i %n'" OWNERCMD="stat -c '%u:%g'" MODECMD="stat -c '%a'" SIZECMD="stat -c %s" SEDINPLACE="sed --follow-symlinks -i" -DUFLAGS="-sk --apparent-size" STRIP_BINARIES="--strip-all" STRIP_SHARED="--strip-unneeded" STRIP_STATIC="--strip-debug" @@ -343,7 +343,7 @@ case "${host_os}" in MODECMD="stat -f '%Lp'" SIZECMD="stat -f %z" SEDINPLACE="sed -i \"\"" - DUFLAGS="-sk" + DEFAULT_DUFLAGS=" -sk" ;; darwin*) host_os_darwin=yes @@ -352,13 +352,12 @@ case "${host_os}" in MODECMD="/usr/bin/stat -f '%Lp'" SIZECMD="/usr/bin/stat -f %z" SEDINPLACE="/usr/bin/sed -i ''" - DUFLAGS="-sk" + DEFAULT_DUFLAGS=" -sk" STRIP_BINARIES="" STRIP_SHARED="-S" STRIP_STATIC="-S" ;; esac - AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes") AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] ) AC_SUBST(INODECMD) @@ -366,11 +365,16 @@ AC_SUBST(OWNERCMD) AC_SUBST(MODECMD) AC_SUBST(SIZECMD) AC_SUBST(SEDINPLACE) -AC_SUBST(DUFLAGS) AC_SUBST(STRIP_BINARIES) AC_SUBST(STRIP_SHARED) AC_SUBST(STRIP_STATIC)
+# Flags for du +if test "${DUFLAGS+set}" != "set"; then + DUFLAGS="${DEFAULT_DUFLAGS}" +fi +AC_ARG_VAR(DUFLAGS, [flags for du, overriding the default]) + # Variables plugged into makepkg.conf CARCH="${host%%-*}" CHOST="${host}" -- 2.9.3
Is there anything I need to change for this to be accepted? Alastair Hughes
On 28/10/16 12:56, Alastair Hughes wrote:
Is there anything I need to change for this to be accepted?
Alastair Hughes .
Not at a quick glance. It is just sitting in my patch queue waiting for me to have a good look at it... Hopefully I get time soon. A
On 20/08/16 06:52, Alastair Hughes wrote:
Not all du implementations on linux accept --apparent-size, so let the user configure the arguments passed to du if required.
This fixes FS#47943.
Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com> ---
Thanks, Allan
participants (2)
-
Alastair Hughes
-
Allan McRae