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:
parent
e6fa02e7eb
commit
59038f9f35
1 changed files with 10 additions and 6 deletions
16
module.nix
16
module.nix
|
|
@ -34,11 +34,13 @@ let
|
||||||
repo_name: ${cfg.repoName}
|
repo_name: ${cfg.repoName}
|
||||||
repo_description: ${cfg.repoDescription}
|
repo_description: ${cfg.repoDescription}
|
||||||
repo_keyalias: ${cfg.keyAlias}
|
repo_keyalias: ${cfg.keyAlias}
|
||||||
# fdroidserver checks this path for existence relative to the cwd `fdroid
|
# fdroidserver's legacy index builder checks this path for existence
|
||||||
# update` runs in (stateDir), then copies it into repo/icons/ under its
|
# relative to the cwd `fdroid update` runs in (stateDir) and then
|
||||||
# own basename — so this is deliberately already that destination path,
|
# `shutil.copyfile`s it into repo/icons/ under its own basename — which
|
||||||
# which the sync script keeps populated before every run.
|
# raises SameFileError if source and destination are the same path. So
|
||||||
repo_icon: repo/icons/icon.png
|
# 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}
|
keystore: ${cfg.keystoreFile}
|
||||||
keystorepass: {env: FDROID_KEYSTORE_PASS}
|
keystorepass: {env: FDROID_KEYSTORE_PASS}
|
||||||
keypass: {env: FDROID_KEY_PASS}
|
keypass: {env: FDROID_KEY_PASS}
|
||||||
|
|
@ -76,7 +78,9 @@ let
|
||||||
install -m 0600 ${repoConfig} ${cfg.stateDir}/config.yml
|
install -m 0600 ${repoConfig} ${cfg.stateDir}/config.yml
|
||||||
# Kept populated every run rather than once, so an icon change here
|
# Kept populated every run rather than once, so an icon change here
|
||||||
# propagates on the next sync without anyone having to touch the server.
|
# 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} "$@"
|
exec ${pythonEnv}/bin/python3 ${./fdroid-sync.py} ${syncConfig} "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue