Skip to content

Clean up diff update temporary resources - #34070

Open
luojiyin1987 wants to merge 1 commit into
uBlockOrigin:masterfrom
luojiyin1987:agent/cleanup-update-diffpatches-temp
Open

Clean up diff update temporary resources#34070
luojiyin1987 wants to merge 1 commit into
uBlockOrigin:masterfrom
luojiyin1987:agent/cleanup-update-diffpatches-temp

Conversation

@luojiyin1987

Copy link
Copy Markdown

Part of #34067.

Summary

Register an EXIT trap for temporary files and clone directories.
Track every path returned by mktemp.
Remove the normal-path file cleanup at the end.

Root cause

The script only removed its two files after the loop completed.
Failures and interruptions could bypass those commands.
A failed clone also skipped the existing directory cleanup.

Impact

The script removes temporary files on every exit path.
It also removes directories from failed clone attempts.
Diff patch generation behavior stays unchanged.

Checks

  • bash -n tools/update-diffpatches.sh
  • git diff --check
  • A failed clone leaves its directory with the original script.
  • The updated script removes both files and the clone directory.

@luojiyin1987
luojiyin1987 marked this pull request as ready for review August 11, 2026 16:25
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.

1 participant