Fewer macros in xheader.c
[tar.git] / tests / time02.at
blobb28e878abee35bb8c4b56c1e6b9da8997a8c89b8
1 # Test clamping mtime GNU tar.  -*- Autotest -*-
3 # Copyright 2016-2024 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
8 # any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 # written by Daniel Kahn Gillmor
20 AT_SETUP([time: clamping mtime])
21 AT_KEYWORDS([time time02])
23 AT_TAR_CHECK([
24 AT_SORT_PREREQ
25 export TZ=UTC0
26 mkdir dir
28 touch -d 2015-12-01T00:00:00 dir/a >/dev/null 2>&1 || AT_SKIP_TEST
29 touch -d 2016-01-01T00:00:00 dir/b >/dev/null 2>&1 || AT_SKIP_TEST
30 touch -d 2016-02-01T00:00:00 dir/c >/dev/null 2>&1 || AT_SKIP_TEST
31 touch -d 2038-01-01T00:00:00 dir/d >/dev/null 2>&1 || AT_SKIP_TEST
33 tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir
34 tar -d -f archive.tar dir|sort
36 [0],
38 dir/c: Mod time differs
39 dir/d: Mod time differs
40 ], [], [], [],
41 [pax])
43 AT_CLEANUP