#------------------------------------------------------------------------------#
-echo_header 'rename apks with `fdroid update --rename-apks`'
+echo_header 'rename apks with `fdroid update --rename-apks`, --nosign for speed'
REPOROOT=`create_test_dir`
cd $REPOROOT
cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
test -d repo || mkdir repo
cp $WORKSPACE/tests/urzip.apk "repo/asdfiuhk urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234 ö.apk"
-$fdroid update --rename-apks
+$fdroid update --rename-apks --pretty --nosign
test -e repo/info.guardianproject.urzip_100.apk
+grep -F 'info.guardianproject.urzip_100.apk' repo/index-v1.json repo/index.xml
cp $WORKSPACE/tests/urzip-release.apk repo/
-$fdroid update --rename-apks
+$fdroid update --rename-apks --pretty --nosign
test -e repo/info.guardianproject.urzip_100.apk
test -e repo/info.guardianproject.urzip_100_b4964fd.apk
+grep -F 'info.guardianproject.urzip_100.apk' repo/index-v1.json repo/index.xml
+grep -F 'info.guardianproject.urzip_100_b4964fd.apk' repo/index-v1.json
+! grep -F 'info.guardianproject.urzip_100_b4964fd.apk' repo/index.xml
cp $WORKSPACE/tests/urzip-release.apk repo/
-$fdroid update --rename-apks
+$fdroid update --rename-apks --pretty --nosign
test -e repo/info.guardianproject.urzip_100.apk
test -e repo/info.guardianproject.urzip_100_b4964fd.apk
test -e duplicates/repo/info.guardianproject.urzip_100_b4964fd.apk
+grep -F 'info.guardianproject.urzip_100.apk' repo/index-v1.json repo/index.xml
+grep -F 'info.guardianproject.urzip_100_b4964fd.apk' repo/index-v1.json
+! grep -F 'info.guardianproject.urzip_100_b4964fd.apk' repo/index.xml
#------------------------------------------------------------------------------#
cp $WORKSPACE/tests/repo/obb.mainpatch.current_1619.apk $REPOROOT/repo/
cp $WORKSPACE/tests/repo/obb.mainpatch.current_1619_another-release-key.apk $REPOROOT/repo/
$fdroid update --pretty
-grep -F 'obb.mainpatch.current_1619.apk' repo/index.xml
-grep -F 'obb.mainpatch.current_1619_another-release-key.apk' repo/index.xml
+grep -F 'obb.mainpatch.current_1619.apk' repo/index.xml repo/index-v1.json
+grep -F 'obb.mainpatch.current_1619_another-release-key.apk' repo/index-v1.json
+! grep -F 'obb.mainpatch.current_1619_another-release-key.apk' repo/index.xml
# die if there are exact duplicates
cp $WORKSPACE/tests/repo/obb.mainpatch.current_1619.apk $REPOROOT/repo/duplicate.apk
! $fdroid update