From 6c52d1dc53c05db0c05f5dc45f5bd9f4247a0a0f Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Sun, 5 Mar 2023 17:53:00 +0100 Subject: [PATCH] rsync zenity awk --- functions/ToolScripts/emuDeckMigration.sh | 6 ++++-- rsync.awk | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 rsync.awk diff --git a/functions/ToolScripts/emuDeckMigration.sh b/functions/ToolScripts/emuDeckMigration.sh index edd5ab44..06932e63 100644 --- a/functions/ToolScripts/emuDeckMigration.sh +++ b/functions/ToolScripts/emuDeckMigration.sh @@ -28,8 +28,10 @@ Migration_init(){ Migration_move(){ origin=$1 destination=$2 - rsync --dry-run -avzh "$origin" "$destination" && Migration_updatePaths "$origin" "$destination" | \ - stdbuf -i0 -o0 -e0 tr '\r' '\n' | stdbuf -i0 -o0 -e0 awk -W interactive '/^ /{ print int(+$2); fflush(); next}$0{ print "# " $0}' | zenity --progress --width=400 --text="Moving...." --auto-close --title="Migrating your installation" + rsync -av --progress --dry-run "$origin" "$destination" | + awk -f $HOME/.config/EmuDeck/backend/rsync.awk | + zenity --progress --title "Migrating your installation to $destination" \ + --text="Scanning..." --width=400 --percentage=0 --auto-kill } diff --git a/rsync.awk b/rsync.awk new file mode 100644 index 00000000..9949c8f9 --- /dev/null +++ b/rsync.awk @@ -0,0 +1,14 @@ +{ + if (index($0, "to-check=") > 0) + { + split($0, pieces, "to-check=") + split(pieces[2], term, ")"); + split(term[1], division, "/"); + print (1-(division[1]/division[2]))*100"%" + } + else + { + print "#"$0; + } + fflush(); +} \ No newline at end of file