From 2f1a517a428849c0a252735bee1d5f59c8b13814 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Tue, 12 Feb 2019 20:17:15 +0100 Subject: [PATCH] Print a diff of the files when backup by ynh_backup_if_checksum_is_different --- data/helpers.d/filesystem | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/helpers.d/filesystem b/data/helpers.d/filesystem index 88d51750b..903f4b6a0 100644 --- a/data/helpers.d/filesystem +++ b/data/helpers.d/filesystem @@ -352,7 +352,8 @@ ynh_backup_if_checksum_is_different () { local backup_file="/home/yunohost.conf/backup/$file.backup.$(date '+%Y%m%d.%H%M%S')" sudo mkdir -p "$(dirname "$backup_file")" sudo cp -a "$file" "$backup_file" # Backup the current file - echo "File $file has been manually modified since the installation or last upgrade. So it has been duplicated in $backup_file" >&2 + ynh_print_info "File $file has been manually modified since the installation or last upgrade. So it has been duplicated in $backup_file" + ynh_print_info "$(git diff --no-index --patch-with-stat $backup_file $file)" echo "$backup_file" # Return the name of the backup file fi fi