#!/bin/sh # fdroidserver-ipfs entrypoint. # # Mirrors the upstream image's behavior — sources bsenv.sh, runs # ${fdroidserver}/fdroid with the given args — then automatically invokes # fdroidserver-ipfs-rehash after a successful `fdroid update` so callers # don't have to remember the second step. set -eu . /etc/profile.d/bsenv.sh # Pre-update cleanup: sweep hashed index files left by the prior rehash run. # Otherwise fdroidserver's scan_repo_files() picks them up as installable # items (their .json extension passes is_repo_file(), since the hashed name # isn't in its ignore list) and a bogus "index-v2-" package shows up # in the index. We check every arg (not just $1) so global flags before the # subcommand (e.g. `-v update`) still trigger this. for arg in "$@"; do if [ "$arg" = "update" ]; then for repodir in repo archive; do if [ -d "$repodir" ]; then rm -f "$repodir"/index-v2-*.json "$repodir"/index-v2-*.json.asc fi done break fi done GRADLE_USER_HOME="${home_vagrant}/.gradle" "${fdroidserver}/fdroid" "$@" # Auto-rehash after a successful update. for arg in "$@"; do if [ "$arg" = "update" ]; then fdroidserver-ipfs-rehash break fi done