Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[autopatch] TEST BEFORE MERGE ynh_setup_source --full_replace=1 #185

Open
wants to merge 1 commit into
base: testing
Choose a base branch
from

Conversation

Salamandar
Copy link
Member

This is an automatic PR

This is an automated patch to potentially fix a bug in the upgrade script.

ynh_setup_source doesn't overwrite the destination directory, but rather extracts the source in the existing directory.

This might lead to weird cases where legacy source files aren't deleted.

The command has an argument --full_replace=1 that fixes this behaviour.

BE CAREFUL because this change might lead to data losses! You should check that all the patches calls to ynh_setup_source
do exactly what you expect to do and don't delete user data.

If you want exclude some files from being overwritten/deleted, use the --keep argument, just like that:

ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config/config.yaml"

@nicofrand
Copy link
Collaborator

nicofrand commented Mar 21, 2024

This might lead to weird cases where legacy source files aren't deleted.

I remember it did indeed. See 2e00fbf
This was removed in 2c288cc#diff-57aeb84da86cb7420dfedd8e49bc644fb799d5413d01927a0417bde753e8922f :/

So, this MR is probably useful indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants