1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00
fdroidserver/tests/run-tests.sh
Hans-Christoph Steiner bfa21fb630 add script to do a test run of creating a new repo
This tests/ folder can then be used for all sorts of tests, including
standard python tests.
2014-04-02 17:49:07 -04:00

35 lines
731 B
Bash
Executable File

#!/bin/sh
set -e
set -x
if [ -z $WORKSPACE ]; then
WORKSPACE=`dirname $(pwd)`
echo "Setting Workspace to $WORKSPACE"
fi
# allow the location of the script to be overridden
if [ -z $fdroid ]; then
fdroid="$WORKSPACE/fdroid"
fi
#------------------------------------------------------------------------------#
# setup a new repo from scratch
REPOROOT=`mktemp --directory --tmpdir=$WORKSPACE`
cd $REPOROOT
$fdroid init
for f in `ls -1 ../../*/bin/*.apk`; do
name=$(basename $(dirname `dirname $f`))
echo "name $name"
apk=${name}_`basename $f`
echo "apk $apk"
cp $f $REPOROOT/repo/$apk
done
# delete any 'unaligned' duplicates
rm -f $REPOROOT/repo/*unaligned*.apk
$fdroid update -c
$fdroid update