summaryrefslogtreecommitdiff
path: root/tests/time02.at
blob: be0360debe258c7d0f2e21b71905540ba582b7df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Test clamping mtime GNU tar.  -*- Autotest -*-
#
# Copyright 2016 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# written by Daniel Kahn Gillmor

AT_SETUP([time: clamping mtime])
AT_KEYWORDS([time time02])

AT_TAR_CHECK([
AT_SORT_PREREQ
export TZ=UTC0
mkdir dir

touch -d 2015-12-01T00:00:00 dir/a >/dev/null 2>&1 || AT_SKIP_TEST
touch -d 2016-01-01T00:00:00 dir/b >/dev/null 2>&1 || AT_SKIP_TEST
touch -d 2016-02-01T00:00:00 dir/c >/dev/null 2>&1 || AT_SKIP_TEST
touch -d 2038-01-01T00:00:00 dir/d >/dev/null 2>&1 || AT_SKIP_TEST

tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir
tar -d -f archive.tar dir|sort
],
[0],
[
dir/c: Mod time differs
dir/d: Mod time differs
], [], [], [],
[pax])

AT_CLEANUP