index: ensure index.xml timestamp is in UTC, closes #481

use verbose but safe syntax so this works with all versions of sed, e.g. osx
This commit is contained in:
Hans-Christoph Steiner 2018-04-25 14:20:19 +02:00
parent 8fbe0738ec
commit 74c6555c71
2 changed files with 6 additions and 2 deletions

View file

@ -258,6 +258,10 @@ if [ "$TRAVIS_OS_NAME" != "osx" ]; then
! test -e repo/index.xml.asc
fi
v0timestamp=`$sed -n -e 's,.*timestamp="\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\)".*,\1,p' repo/index.xml`
v1timestamp=`$sed -n -e 's,.*"timestamp": \([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*,\1,p' repo/index-v1.json`
test $v0timestamp -eq $v1timestamp
# we can't easily reproduce the timestamps for things, so just hardcode them
$sed -i.tmp -e 's,timestamp="[0-9]*",timestamp="1480431575",' repo/index.xml
diff -uw $WORKSPACE/tests/repo/index.xml repo/index.xml