Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,7 @@ winetricks_selfupdate()
w_try cp "$0" "${_W_rollback_file}"
w_try chmod -x "${_W_rollback_file}"

# Uses mv to avoid race condition in overwriting running shell script. Do not replace with cp or other non-atomic writes!
w_try mv "${_W_update_file}" "$0"
w_try chmod +x "$0"

Expand All @@ -1471,6 +1472,7 @@ winetricks_selfupdate_rollback()
_W_rollback_file="${0}.bak"

if test -f "${_W_rollback_file}"; then
# Uses mv to avoid race condition in overwriting running shell script. Do not replace with cp or other non-atomic writes!
w_try mv "${_W_rollback_file}" "$0"
w_try chmod +x "$0"
w_warn "Rollback finished! The current version is $($0 -V)."
Expand Down