1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-05 18:50:09 +02:00

git mirror test requires git >= 2.3

This commit is contained in:
Hans-Christoph Steiner 2017-04-12 15:26:51 +02:00
parent fcb0634eaa
commit 31d92367ed

View File

@ -41,6 +41,11 @@ create_test_file() {
TMPDIR=$WORKSPACE/.testfiles mktemp
}
# the < is reverse since 0 means success in exit codes
have_git_2_3() {
python3 -c "import sys; from distutils.version import LooseVersion as V; sys.exit(V(sys.argv[3]) < V('2.3'))" `git --version`
}
#------------------------------------------------------------------------------#
# "main"
@ -602,6 +607,7 @@ echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
echo "binary_transparency_remote = '$GIT_REMOTE'" >> config.py
echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py
$fdroid update --verbose
if have_git_2_3; then
$fdroid server update --verbose
test -e repo/index.xml
test -e repo/index.jar
@ -611,6 +617,9 @@ cd binary_transparency
[ `git rev-list --count HEAD` == "2" ]
cd $GIT_REMOTE
[ `git rev-list --count HEAD` == "2" ]
else
echo "Skipping test, `git --version` older than 2.3"
fi
#------------------------------------------------------------------------------#
@ -683,7 +692,9 @@ BINARY_TRANSPARENCY_REMOTE=`create_test_dir`
SERVER_GIT_MIRROR=`create_test_dir`
cd $SERVER_GIT_MIRROR
git init
if have_git_2_3; then
git config receive.denyCurrentBranch updateInstead
fi
cd $OFFLINE_ROOT
$fdroid init --keystore $KEYSTORE --repo-keyalias=sova
@ -699,6 +710,7 @@ grep -F '<application id=' repo/index.xml > /dev/null
cd binary_transparency
[ `git rev-list --count HEAD` == "1" ]
cd ..
if have_git_2_3; then
$fdroid server update --verbose
grep -F '<application id=' $LOCAL_COPY_DIR/repo/index.xml > /dev/null
cd $ONLINE_ROOT
@ -713,6 +725,9 @@ cd $BINARY_TRANSPARENCY_REMOTE
[ `git rev-list --count HEAD` == "1" ]
cd $SERVER_GIT_MIRROR
[ `git rev-list --count HEAD` == "1" ]
else
echo "Skipping test, `git --version` older than 2.3"
fi
#------------------------------------------------------------------------------#