view tests/fixtures/invalid_utf8.sh @ 1351:9d58ca6253a3

Added check for excessive .. entries which would go out of domain. This addresses possible problems with too many .. entries i.e. if the repo root is http://www.xample.org/repo/proj1 then ^/../proj2 is fine as is ^/../../repo2/p1 but ^/../../../www./Local is not as it doesn't make sense to have relative references that go to a different site.
author Steve Barnes (Home) <gadgetsteve@hotmail.com>
date Thu, 01 Jan 2015 16:40:41 +0000
parents 312f36a425f0
children
line wrap: on
line source

#!/bin/bash
#-*- coding: utf-8 -*-
#
# Generate invalid_utf8.svndump
#

#check svnadmin version, must be >= 1.7
SVNVERSION=$(svnadmin --version | head -n 1 | cut -d \  -f 3)
if [[ "$SVNVERSION" < '1.7' ]] ; then
    echo "You MUST have svn 1.7 or above to use this script"
    exit 1
fi

set -x

TMPDIR=$(mktemp -d)
WD=$(pwd)

cd $TMPDIR

svnadmin create failrepo
svn co file://$PWD/failrepo fail
(
   cd fail
   touch A
   svn add A
   svn ci -m blabargrod
)
svnadmin --pre-1.6-compatible create invalid_utf8
svnadmin dump failrepo | \
    sed "s/blabargrod/$(echo blåbærgrød | iconv -f utf-8 -t latin1)/g" | \
    svnadmin load --bypass-prop-validation invalid_utf8

tar cz -C invalid_utf8 -f "$WD"/invalid_utf8.tar.gz .