Fix the repo icon path to avoid copying the file onto itself

fdroidserver's legacy index builder copies repo_icon into repo/icons/ by
its basename; pointing repo_icon at that destination made the copy a
same-file no-op that shutil.copyfile refuses, crashing every index
rebuild. The icon source now lives outside repo/icons/.
This commit is contained in:
randogoth 2026-10-14 14:15:05 +03:00
parent e6fa02e7eb
commit 59038f9f35

View file

@ -34,11 +34,13 @@ let
repo_name: ${cfg.repoName}
repo_description: ${cfg.repoDescription}
repo_keyalias: ${cfg.keyAlias}
# fdroidserver checks this path for existence relative to the cwd `fdroid
# update` runs in (stateDir), then copies it into repo/icons/ under its
# own basename — so this is deliberately already that destination path,
# which the sync script keeps populated before every run.
repo_icon: repo/icons/icon.png
# fdroidserver's legacy index builder checks this path for existence
# relative to the cwd `fdroid update` runs in (stateDir) and then
# `shutil.copyfile`s it into repo/icons/ under its own basename — which
# raises SameFileError if source and destination are the same path. So
# this has to name a *source* file outside repo/icons/, kept at
# ${cfg.stateDir}/icon.png by the sync script below.
repo_icon: icon.png
keystore: ${cfg.keystoreFile}
keystorepass: {env: FDROID_KEYSTORE_PASS}
keypass: {env: FDROID_KEY_PASS}
@ -76,7 +78,9 @@ let
install -m 0600 ${repoConfig} ${cfg.stateDir}/config.yml
# Kept populated every run rather than once, so an icon change here
# propagates on the next sync without anyone having to touch the server.
install -D -m 0644 ${cfg.repoIcon} ${cfg.stateDir}/repo/icons/icon.png
# Lives next to repo/, not inside repo/icons/ itself — see repo_icon
# above for why that distinction matters.
install -m 0644 ${cfg.repoIcon} ${cfg.stateDir}/icon.png
exec ${pythonEnv}/bin/python3 ${./fdroid-sync.py} ${syncConfig} "$@"
'';