1 # Test clamping mtime GNU tar. -*- Autotest -*-
3 # Copyright 2016-2017 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)
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])
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
38 dir/c: Mod time differs
39 dir/d: Mod time differs