summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-25 17:36:52 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-26 01:20:44 +0100
commitbb2d12326a03e8925104937569fdab0ebdc34ccb (patch)
tree193d2d4e6b0599597340e2a6d1a42a6179c97c69 /tests
parentd65bf48c36157b7197c6fabfdb3ee64b7e147682 (diff)
test suite: debchange: Work around faketime TZ bug
faketime's CLI does not permit correct unparsing of times in arbitrary timezones. So we must save and restore TZ. See #907264. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tstunt/debchange7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/tstunt/debchange b/tests/tstunt/debchange
index de324e9..e5ec4d8 100755
--- a/tests/tstunt/debchange
+++ b/tests/tstunt/debchange
@@ -4,6 +4,13 @@ set -e
spec=$(date --rfc-3339=seconds -d @"${GIT_AUTHOR_DATE% *}")
spec=${spec%+*}
+# The nonsense with TZ is to work around #907264
+tz_set=${TZ+set}
+if ! test "$tz_set"; then tz_undef=-u; fi
+
set -x
+
+env TZ=UTC \
faketime -f "$spec" \
+env $tz_undef TZ${tz_set:+=}"$TZ" \
"${DGIT_TEST_REAL_DEBCHANGE-debchange}" "$@"