autotools: added the stat command to the automagically replaced ones
authorintrigeri <intrigeri@boum.org>
Fri, 25 Dec 2009 03:09:29 +0000 (04:09 +0100)
committerintrigeri <intrigeri@boum.org>
Fri, 25 Dec 2009 03:09:29 +0000 (04:09 +0100)
... hoping it will help supporting *BSD some day.

ChangeLog
configure.in
src/Makefile.am
src/backupninja.in

index 97d435333070e721f27e131983e7d1a2984a6e1a..d0f70115b871b20d30a9c851dde9444bf347e5ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,9 @@ version 0.9.7 -- UNRELEASED
        dup:
         . Fixed bandwidthlimit syntax error. Thanks to Ian Beckwith for
           the patch.
+    autotools
+        . Added the stat command to the automagically replaced ones, hoping it
+          will help supporting *BSD some day.
 
 version 0.9.6 -- July 21, 2008
     backupninja changes
index 26e95be3041089b0cf80a6ae044b109a6bbfcf98..174399ddc4a3454a34d7866c0b44f5d5da7277e3 100644 (file)
@@ -36,6 +36,13 @@ if test x$MKTEMPT = "xno"; then
     AC_MSG_ERROR([mktemp is required])
 fi
 
+AC_PATH_PROGS(STAT, stat, "no")
+if test x$STAT = "xno"; then
+    AC_MSG_ERROR([stat is required])
+else
+   export STAT
+fi
+
 AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no")
 if test "x$ac_cv_have_rpm" = "xyes"; then
         rpm --define '_topdir /tmp' > /dev/null 2>&1
index 3d5bdb8d630e443cd99b7d23cd80939a6f3951b3..5694e9af651c76509ddfe8ec97686a98830abf1d 100644 (file)
@@ -11,6 +11,7 @@ edit = sed \
     -e "s,@BASH\@,$(BASH),g" \
     -e "s,@AWK\@,$(AWK),g" \
     -e "s,@SED\@,$(SED),g" \
+    -e "s,@STAT\@,$(STAT),g" \
     -e 's,@datadir\@,$(pkgdatadir),g' \
     -e "s,@libdir\@,$(pkglibdir),g" \
     -e 's,@localstatedir\@,$(localstatedir),g' \
index a158715d1dd6e4f78235f479d3ef7b8ea8feb4ba..a991f58808fa8cbfd5b5ed523c2257873fbb544c 100755 (executable)
@@ -143,14 +143,14 @@ function check_perms() {
    local perms
    local owners
 
-   perms=($(stat -L --format='%A' $file))
+   perms=($(@STAT@ -L --format='%A' $file))
    debug "perms: $perms"
    local gperm=${perms:4:3}
    debug "gperm: $gperm"
    local wperm=${perms:7:3}
    debug "wperm: $wperm"
 
-   owners=($(stat -L --format='%g %G %u %U' $file))
+   owners=($(@STAT@ -L --format='%g %G %u %U' $file))
    local gid=${owners[0]}
    local group=${owners[1]}
    local owner=${owners[2]}