From 59038f9f35b30f13c9d7049428106147201ff9a2 Mon Sep 17 00:00:00 2001 From: randogoth Date: Wed, 14 Oct 2026 14:15:05 +0300 Subject: [PATCH] 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/. --- module.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/module.nix b/module.nix index 14359c4..e7204f5 100644 --- a/module.nix +++ b/module.nix @@ -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} "$@" '';