summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-08-19 23:29:56 -0500
committerDan McGee <dan@archlinux.org>2008-08-19 23:29:56 -0500
commit282eeadc68fec1da8651d0c65ad0dfebd11a9c7f (patch)
tree1d3cf24273b8514c8ffa67e6d7d8b90fc876eb99 /configure.ac
parent9609c0f1351a73e06edcfda1494a41d66c51dcb5 (diff)
downloadpacman-282eeadc68fec1da8651d0c65ad0dfebd11a9c7f.tar.xz
Factor shell script size command into configure script
Commit 149839c5391e9a93 introduced a small behavior regression as a drawback for a better portability. repo-add now includes the approximate size (to the nearest KB) rather than an exact size due to the switching of the du command to a more portable form. Instead of sacrificing the exact size, use configure to help us determine a valid command to acquire our filesize and place it in the sync database. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9f4209b2..20aa1807 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,18 +182,24 @@ GCC_VISIBILITY_CC
GCC_GNU89_INLINE_CC
# Host-dependant definitions
+SIZECMD="stat -c %s"
case "${host_os}" in
+ *bsd*)
+ SIZECMD="stat -f %z"
+ ;;
cygwin*)
host_os_cygwin=yes
CFLAGS="$CFLAGS -DCYGWIN"
;;
darwin*)
host_os_darwin=yes
+ SIZECMD="stat -f %z"
;;
esac
AM_CONDITIONAL([CYGWIN], test "x$host_os_cygwin" = "xyes")
AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes")
+AC_SUBST(SIZECMD)
# Check for architecture, used in default makepkg.conf
# (Note single space left after CARCHFLAGS)
@@ -365,6 +371,7 @@ ${PACKAGE_NAME}:
Architecture : ${CARCH}
Architecture flags : ${CARCHFLAGS}
Host Type : ${CHOST}
+ Filesize command : ${SIZECMD}
libalpm version : ${LIB_VERSION}
libalpm version info : ${LIB_VERSION_INFO}