[pacman-dev] [PATCH] Do not dereference symlinks when calculating size

Allan McRae allan at archlinux.org
Fri Feb 24 07:04:19 EST 2012


Passing the "-L" flag to stat means we get the size of the file
being pointed to for symlinks instead of the size of the symlink.

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 configure.ac |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index cfd3340..12a6e65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -256,14 +256,14 @@ GCC_VISIBILITY_CC
 GCC_GNU89_INLINE_CC
 
 # Host-dependant definitions
-SIZECMD="stat -L -c %s"
+SIZECMD="stat -c %s"
 SEDINPLACE="sed -i"
 STRIP_BINARIES="--strip-all"
 STRIP_SHARED="--strip-unneeded"
 STRIP_STATIC="--strip-debug"
 case "${host_os}" in
 	*bsd*)
-		SIZECMD="stat -L -f %z"
+		SIZECMD="stat -f %z"
 		SEDINPLACE="sed -i \"\""
 		;;
 	cygwin*)
@@ -272,7 +272,7 @@ case "${host_os}" in
 		;;
 	darwin*)
 		host_os_darwin=yes
-		SIZECMD="/usr/bin/stat -L -f %z"
+		SIZECMD="/usr/bin/stat -f %z"
 		SEDINPLACE="/usr/bin/sed -i ''"
 		STRIP_BINARIES=""
 		STRIP_SHARED="-S"
-- 
1.7.9.2



More information about the pacman-dev mailing list