exit with error if duplicate metadata file is found

In order to prevent confusion caused by multiple metadata files for a given
app, fdroid will exit with an error if it finds any app metadata file with
the same package ID as one that has already been parsed.
This commit is contained in:
Hans-Christoph Steiner 2015-08-05 12:53:17 +02:00
parent 6f334558df
commit 8d6e0aebb9
6 changed files with 82 additions and 17 deletions

View file

@ -109,6 +109,44 @@ cd $WORKSPACE/docs
./gendocs.sh -o html --email admin@f-droid.org fdroid "F-Droid Server Manual"
#------------------------------------------------------------------------------#
echo_header "test metadata checks"
REPOROOT=`create_test_dir`
cd $REPOROOT
touch config.py
mkdir repo
cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
set +e
$fdroid build
if [ $? -eq 0 ]; then
echo "This should have failed because there is no metadata!"
exit 1
else
echo "testing metadata checks passed"
fi
set -e
mkdir $REPOROOT/metadata/
cp $WORKSPACE/tests/metadata/org.smssecure.smssecure.txt $REPOROOT/metadata/
$fdroid readmeta
# now make a fake duplicate
touch $REPOROOT/metadata/org.smssecure.smssecure.yaml
set +e
$fdroid readmeta
if [ $? -eq 0 ]; then
echo "This should have failed because there is a duplicate metadata file!"
exit 1
else
echo "testing duplicate metadata checks passed"
fi
set -e
#------------------------------------------------------------------------------#
echo_header "create a source tarball and use that to build a repo"