2014-04-10 18:31:14 +02:00
|
|
|
#!/bin/bash
|
2014-04-01 22:16:24 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2014-04-04 04:17:52 +02:00
|
|
|
copy_apks_into_repo() {
|
|
|
|
for f in `ls -1 ../../*/bin/*.apk`; do
|
|
|
|
name=$(basename $(dirname `dirname $f`))
|
|
|
|
echo "name $name"
|
2014-04-10 18:37:07 +02:00
|
|
|
apk=`aapt d badging "$f" | sed -n "s,^package: name='\(.*\)' versionCode='\([0-9][0-9]*\)' .*,\1_\2.apk,p"`
|
2014-04-04 04:17:52 +02:00
|
|
|
echo "apk $apk"
|
2014-04-10 18:37:07 +02:00
|
|
|
cp -f $f $1/repo/$apk
|
2014-04-04 04:17:52 +02:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-04-01 22:16:24 +02:00
|
|
|
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
|
2014-04-04 04:17:52 +02:00
|
|
|
copy_apks_into_repo $REPOROOT
|
|
|
|
$fdroid update -c
|
|
|
|
$fdroid update
|
2014-04-01 22:16:24 +02:00
|
|
|
|
|
|
|
|
2014-04-04 04:17:52 +02:00
|
|
|
#------------------------------------------------------------------------------#
|
|
|
|
# setup a new repo from scratch and generate a keystore
|
|
|
|
|
|
|
|
REPOROOT=`mktemp --directory --tmpdir=$WORKSPACE`
|
|
|
|
KEYSTORE=$REPOROOT/keystore.jks
|
|
|
|
cd $REPOROOT
|
|
|
|
$fdroid init --keystore $KEYSTORE
|
|
|
|
test -e $KEYSTORE
|
|
|
|
copy_apks_into_repo $REPOROOT
|
2014-04-01 22:16:24 +02:00
|
|
|
$fdroid update -c
|
|
|
|
$fdroid update
|
2014-04-04 04:17:52 +02:00
|
|
|
test -e repo/index.xml
|
|
|
|
test -e repo/index.jar
|
2014-04-04 06:05:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------#
|
|
|
|
# setup a new repo from scratch with a HSM/smartcard
|
|
|
|
|
|
|
|
REPOROOT=`mktemp --directory --tmpdir=$WORKSPACE`
|
|
|
|
cd $REPOROOT
|
|
|
|
$fdroid init --keystore NONE
|
|
|
|
test -e opensc-fdroid.cfg
|
|
|
|
test ! -e NONE
|