init: switch to config.yml as the default format

This commit is contained in:
Hans-Christoph Steiner 2020-10-22 23:34:47 +02:00
parent 4bbbf35511
commit a9fdb5b401
17 changed files with 344 additions and 240 deletions

View file

@ -61,8 +61,8 @@ fdroid_init_with_prebuilt_keystore() {
keystore="$1"
fi
$fdroid init --keystore $keystore --repo-keyalias=sova
echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
echo 'keystorepass: r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=' >> config.yml
echo 'keypass: r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=' >> config.yml
}
# the < is reverse since 0 means success in exit codes
@ -170,10 +170,10 @@ if which zipalign || ls -1 $ANDROID_HOME/build-tools/*/zipalign; then
cd $REPOROOT
cp $WORKSPACE/tests/keystore.jks $REPOROOT/
$fdroid init --keystore keystore.jks --repo-keyalias=sova
echo 'make_current_version_link = True' >> config.py
echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
echo 'keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.py
echo 'make_current_version_link: true' >> config.yml
echo 'keystorepass: r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=' >> config.yml
echo 'keypass: r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=' >> config.yml
echo 'keydname: "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.yml
test -d archive || mkdir archive
test -d metadata || mkdir metadata
cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
@ -199,8 +199,8 @@ REPOROOT=`create_test_dir`
cd $REPOROOT
fdroid_init_with_prebuilt_keystore
$sed -i.tmp 's,^ *repo_description.*,repo_description = """获取已安装在您的设备上的应用的,' config.py
echo "mirrors = ('https://foo.bar/fdroid', 'http://secret.onion/fdroid')" >> config.py
$sed -i.tmp 's,^ *repo_description.*,repo_description: |\n 获取已安装在您的设备上的应用的,' config.yml
echo "mirrors: ['https://foo.bar/fdroid', 'http://secret.onion/fdroid']" >> config.yml
mkdir metadata
cp $WORKSPACE/tests/urzip.apk $WORKSPACE/tests/bad-unicode*.apk repo/
cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
@ -258,11 +258,11 @@ fdroid_init_with_prebuilt_keystore
cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/
cp -a $WORKSPACE/tests/gnupghome $GNUPGHOME
chmod 0700 $GNUPGHOME
echo "install_list = 'org.adaway'" >> config.py
echo "uninstall_list = ('com.android.vending', 'com.facebook.orca',)" >> config.py
echo "gpghome = '$GNUPGHOME'" >> config.py
echo "gpgkey = 'CE71F7FB'" >> config.py
echo "mirrors = ('http://foobarfoobarfoobar.onion/fdroid','https://foo.bar/fdroid',)" >> config.py
echo "install_list: org.adaway" >> config.yml
echo "uninstall_list: [com.android.vending, com.facebook.orca]" >> config.yml
echo "gpghome: $GNUPGHOME" >> config.yml
echo "gpgkey: CE71F7FB" >> config.yml
echo "mirrors: ['http://foobarfoobarfoobar.onion/fdroid', 'https://foo.bar/fdroid']" >> config.yml
$fdroid update --verbose --pretty
test -e repo/index.xml
test -e repo/index.jar
@ -298,7 +298,7 @@ echo_header 'test moving lots of APKs to the archive'
REPOROOT=`create_test_dir`
cd $REPOROOT
fdroid_init_with_prebuilt_keystore
$sed -i.tmp '/allow_disabled_algorithms/d' config.py
$sed -i.tmp '/allow_disabled_algorithms/d' config.yml
test -d metadata || mkdir metadata
cp $WORKSPACE/tests/metadata/*.yml metadata/
echo 'Summary: good test version of urzip' > metadata/info.guardianproject.urzip.yml
@ -310,7 +310,7 @@ cp $WORKSPACE/tests/urzip.apk \
$WORKSPACE/tests/repo/com.politedroid_[0-9].apk \
$WORKSPACE/tests/repo/obb.main.twoversions_110161[357].apk \
repo/
$sed -i.tmp 's,archive_older = [0-9],archive_older = 3,' config.py
$sed -i.tmp 's,archive_older: [0-9],archive_older: 3,' config.yml
$fdroid update --pretty --nosign
if which apksigner; then
@ -333,7 +333,7 @@ if ! which apksigner; then
cp $WORKSPACE/tests/metadata/com.politedroid.yml metadata/
test -d repo || mkdir repo
cp $WORKSPACE/tests/repo/com.politedroid_[0-9].apk repo/
$sed -i.tmp 's,archive_older = [0-9],archive_older = 3,' config.py
$sed -i.tmp 's,archive_older: [0-9],archive_older: 3,' config.yml
$fdroid update --pretty --nosign
test `grep '<package>' archive/index.xml | wc -l` -eq 0
@ -419,7 +419,7 @@ cp $WORKSPACE/tests/metadata/com.politedroid.yml metadata/
$sed -i.tmp '/ArchivePolicy:/d' metadata/com.politedroid.yml
test -d repo || mkdir repo
cp $WORKSPACE/tests/repo/com.politedroid_[0-9].apk repo/
$sed -i.tmp 's,archive_older = [0-9],archive_older = 3,' config.py
$sed -i.tmp 's,archive_older: [0-9],archive_older: 3,' config.yml
$fdroid update --pretty --nosign
test `grep '<package>' archive/index.xml | wc -l` -eq 1
@ -433,7 +433,7 @@ test -e repo/com.politedroid_4.apk
test -e repo/com.politedroid_5.apk
test -e repo/com.politedroid_6.apk
$sed -i.tmp 's,archive_older = 3,archive_older = 1,' config.py
$sed -i.tmp 's,archive_older: 3,archive_older: 1,' config.yml
$fdroid update --pretty --nosign
test `grep '<package>' archive/index.xml | wc -l` -eq 3
test `grep '<package>' repo/index.xml | wc -l` -eq 1
@ -494,8 +494,8 @@ echo_header 'test allowing disabled signatures in repo and archive'
REPOROOT=`create_test_dir`
cd $REPOROOT
fdroid_init_with_prebuilt_keystore
echo 'allow_disabled_algorithms = True' >> config.py
$sed -i.tmp 's,archive_older = [0-9],archive_older = 3,' config.py
echo 'allow_disabled_algorithms: true' >> config.yml
$sed -i.tmp 's,archive_older: [0-9],archive_older: 3,' config.yml
test -d metadata || mkdir metadata
cp $WORKSPACE/tests/metadata/com.politedroid.yml metadata/
echo 'Summary: good test version of urzip' > metadata/info.guardianproject.urzip.yml
@ -531,7 +531,7 @@ test -e repo/org.bitbucket.tickytacky.mirrormirror_4.apk
test -e archive/urzip-badsig.apk
if ! which apksigner; then
$sed -i.tmp '/allow_disabled_algorithms/d' config.py
$sed -i.tmp '/allow_disabled_algorithms/d' config.yml
$fdroid update --pretty --nosign
test `grep '<package>' archive/index.xml | wc -l` -eq 5
test `grep '<package>' repo/index.xml | wc -l` -eq 3
@ -557,7 +557,7 @@ if ! which apksigner; then
fi
# test unarchiving when disabled_algorithms are allowed again
echo 'allow_disabled_algorithms = True' >> config.py
echo 'allow_disabled_algorithms: true' >> config.yml
$fdroid update --pretty --nosign
test `grep '<package>' archive/index.xml | wc -l` -eq 2
test `grep '<package>' repo/index.xml | wc -l` -eq 6
@ -587,7 +587,7 @@ echo_header 'rename apks with `fdroid update --rename-apks`, --nosign for speed'
REPOROOT=`create_test_dir`
cd $REPOROOT
fdroid_init_with_prebuilt_keystore
echo 'keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.py
echo 'keydname: "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.yml
test -d metadata || mkdir metadata
cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
test -d repo || mkdir repo
@ -684,11 +684,11 @@ echo "Description: |" >> metadata/fake.yml
echo " this is fake" >> metadata/fake.yml
# fake that no JDKs are available
echo 'java_paths = {}' > config.py
echo 'java_paths: {}' > config.yml
LOCAL_COPY_DIR=`create_test_dir`/fdroid
mkdir -p $LOCAL_COPY_DIR/repo
echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
echo "local_copy_dir: $LOCAL_COPY_DIR" >> config.yml
$fdroid checkupdates --allow-dirty
which gpg && $fdroid gpgsign
@ -775,7 +775,7 @@ $fdroid deploy --local-copy-dir=$LOCALCOPYDIR
NEWREPOROOT=`create_test_dir`
cd $NEWREPOROOT
fdroid_init_with_prebuilt_keystore
echo "sync_from_local_copy_dir = True" >> config.py
echo "sync_from_local_copy_dir: true" >> config.yml
$fdroid deploy --local-copy-dir=$LOCALCOPYDIR
@ -844,7 +844,7 @@ KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT
$fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
set +e
grep $FAKE_ANDROID_HOME $REPOROOT/config.py
grep $FAKE_ANDROID_HOME $REPOROOT/config.yml
if [ $? -ne 0 ]; then
echo "the value set in --android-home '$FAKE_ANDROID_HOME' should override ANDROID_HOME '$ANDROID_HOME'"
exit 1
@ -1023,10 +1023,10 @@ set -e
# now set up fake, non-working keystore setup
touch $KEYSTORE
echo "keystore = \"$KEYSTORE\"" >> config.py
echo 'repo_keyalias = "foo"' >> config.py
echo 'keystorepass = "foo"' >> config.py
echo 'keypass = "foo"' >> config.py
echo "keystore: $KEYSTORE" >> config.yml
echo 'repo_keyalias: foo' >> config.yml
echo 'keystorepass: foo' >> config.yml
echo 'keypass: foo' >> config.yml
set +e
$fdroid update --create-metadata --verbose
if [ $? -eq 0 ]; then
@ -1047,7 +1047,7 @@ GNUPGHOME=$REPOROOT/gnupghome
cd $REPOROOT
fdroid_init_with_prebuilt_keystore
cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/
echo "binary_transparency_remote = '$GIT_REMOTE'" >> config.py
echo "binary_transparency_remote: $GIT_REMOTE" >> config.yml
$fdroid update --verbose
if have_git_2_3; then
$fdroid deploy --verbose
@ -1084,7 +1084,7 @@ test -e tmp/apkcache.json
grep -F '<application id=' repo/index.xml > /dev/null
# now set fake repo_keyalias
$sed -i.tmp 's,^ *repo_keyalias.*,repo_keyalias = "fake",' $REPOROOT/config.py
$sed -i.tmp 's,^ *repo_keyalias.*,repo_keyalias: fake,' $REPOROOT/config.yml
set +e
$fdroid update
if [ $? -eq 0 ]; then
@ -1127,7 +1127,7 @@ REPOROOT=`create_test_dir`
GIT_MIRROR=$REPOROOT/git-mirror
cd $REPOROOT
fdroid_init_with_prebuilt_keystore
echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py
echo "servergitmirrors: $SERVER_GIT_MIRROR" >> config.yml
cp $WORKSPACE/tests/repo/com.politedroid_[345].apk repo/
$fdroid update --create-metadata
@ -1155,7 +1155,7 @@ test -e $SERVER_GIT_MIRROR/fdroid/repo/com.politedroid_5.apk
test -e $SERVER_GIT_MIRROR/fdroid/repo/com.politedroid_6.apk
before=`du -s --bytes $GIT_MIRROR/.git/ | awk '{print $1}'`
echo "git_mirror_size_limit = '60kb'" >> config.py
echo "git_mirror_size_limit: 60kb" >> config.yml
$fdroid update
$fdroid deploy
test -e $REPOROOT/archive/com.politedroid_3.apk
@ -1197,9 +1197,9 @@ if have_git_2_3; then
fdroid_init_with_prebuilt_keystore
cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $OFFLINE_ROOT/
echo "mirrors = ['http://foo.bar/fdroid', 'http://asdflkdsfjafdsdfhkjh.onion/fdroid']" >> config.py
echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py
echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
echo "mirrors: ['http://foo.bar/fdroid', 'http://asdflkdsfjafdsdfhkjh.onion/fdroid']" >> config.yml
echo "servergitmirrors: $SERVER_GIT_MIRROR" >> config.yml
echo "local_copy_dir: $LOCAL_COPY_DIR" >> config.yml
$fdroid update --pretty
grep -F '<application id=' repo/index.xml > /dev/null
grep -F '/fdroid/repo</mirror>' repo/index.xml
@ -1212,12 +1212,12 @@ if have_git_2_3; then
$fdroid deploy --verbose
grep -F '<application id=' $LOCAL_COPY_DIR/repo/index.xml > /dev/null
cd $ONLINE_ROOT
echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
echo "sync_from_local_copy_dir = True" >> config.py
echo "serverwebroots = '$SERVERWEBROOT'" >> config.py
echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py
echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
echo "binary_transparency_remote = '$BINARY_TRANSPARENCY_REMOTE'" >> config.py
echo "local_copy_dir: $LOCAL_COPY_DIR" >> config.yml
echo "sync_from_local_copy_dir: True" >> config.yml
echo "serverwebroots: $SERVERWEBROOT" >> config.yml
echo "servergitmirrors: $SERVER_GIT_MIRROR" >> config.yml
echo "local_copy_dir: $LOCAL_COPY_DIR" >> config.yml
echo "binary_transparency_remote: $BINARY_TRANSPARENCY_REMOTE" >> config.yml
$fdroid deploy --verbose
cd $BINARY_TRANSPARENCY_REMOTE
[ `git rev-list --count HEAD` == "1" ]
@ -1232,7 +1232,7 @@ echo_header 'test extracting and publishing with developer signature'
REPOROOT=`create_test_dir`
cd $REPOROOT
fdroid_init_with_prebuilt_keystore
echo 'keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.py
echo 'keydname: "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.yml
test -d metadata || mkdir metadata
cp $WORKSPACE/tests/metadata/com.politedroid.yml metadata/
test -d repo || mkdir repo