]> arthur.barton.de Git - bup.git/commitdiff
xstst-cmd.py: test for _have_utimensat rather than _have_ns_fs_timestamps.
authorRob Browning <rlb@defaultvalue.org>
Sun, 27 Mar 2011 17:01:43 +0000 (12:01 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 8 May 2011 07:39:14 +0000 (03:39 -0400)
Test for _have_utimensat rather than _have_ns_fs_timestamps to decide
whether or not to print the atime and mtime, since the existence of
utimensat() is the real indicator, and since _have_ns_fs_timestamps is
going away.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
cmd/xstat-cmd.py

index b8e4200204d5b797126216f45d5255286368ee84..9d1f57530ff704ccd206e9d2b5635a7f74301771 100755 (executable)
@@ -6,7 +6,6 @@
 import sys, stat, errno
 from bup import metadata, options, xstat
 from bup.helpers import handle_ctrl_c, saved_errors, add_error, log
-from bup import _helpers
 
 
 def fstimestr(fstime):
@@ -98,17 +97,17 @@ for path in remainder:
     if 'group' in active_fields:
         print 'group:', m.group
     if 'atime' in active_fields:
-        # if we don't have_ns_fs_timestamps, that means we have to use
+        # If we don't have utimensat, that means we have to use
         # utime(), and utime() has no way to set the mtime/atime of a
-        # symlink.  Thus, the mtime/atime of a symlink is meaningless, so
-        # let's not report it.  (That way scripts comparing before/after
-        # won't trigger.)
-        if _helpers._have_ns_fs_timestamps or not stat.S_ISLNK(m.mode):
+        # symlink.  Thus, the mtime/atime of a symlink is meaningless,
+        # so let's not report it.  (That way scripts comparing
+        # before/after won't trigger.)
+        if xstat._have_utimensat or not stat.S_ISLNK(m.mode):
             print 'atime: ' + fstimestr(m.atime)
         else:
             print 'atime: 0'
     if 'mtime' in active_fields:
-        if _helpers._have_ns_fs_timestamps or not stat.S_ISLNK(m.mode):
+        if xstat._have_utimensat or not stat.S_ISLNK(m.mode):
             print 'mtime: ' + fstimestr(m.mtime)
         else:
             print 'mtime: 0'