1
0
mirror of https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git synced 2023-10-10 11:37:40 +00:00

Add dryrun option

This commit is contained in:
Jan Schneider
2017-06-16 22:18:28 +02:00
parent 565c8c0139
commit 2ef7169ed5
3 changed files with 23 additions and 4 deletions

View File

@@ -208,9 +208,13 @@ proc ::rmupdate::check_sizes {image} {
write_log "Sizes of filesystems checked successfully."
}
proc ::rmupdate::update_filesystems {image} {
proc ::rmupdate::update_filesystems {image {dryrun 0}} {
variable mnt_new
variable mnt_cur
set extra_args ""
if {$dryrun != 0} {
set extra_args "--dry-run"
}
write_log "Updating filesystems."
@@ -224,7 +228,7 @@ proc ::rmupdate::update_filesystems {image} {
mount_system_partition $partition $mnt_cur
write_log "Rsyncing filesystem of partition ${partition}."
set data [exec rsync --progress --archive --delete "${mnt_new}/" "${mnt_cur}"]
set data [exec rsync ${extra_args} --progress --archive --delete "${mnt_new}/" "${mnt_cur}"]
write_log "Rsync finished."
umount $mnt_new