summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-02-13 00:24:41 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-02-13 14:23:42 -0700
commitce03b96d7e542ce7019a35c544dfe9fa39b86904 (patch)
treee38414dfa0a98a395879617056c1377727b6343b /bin
parentae806b1bfae5d9f324106573204ec8beac848dbe (diff)
downloaddotfiles-ce03b96d7e542ce7019a35c544dfe9fa39b86904.tar.gz
nmbug: write tags out to a temporary file, not 'nmbug.index'
If more than nmbug process is running at once, then each will try to read and write the same file. Pending a proper fix upstream which ensures the temporary file gets deleted even if we exit with an error. Thanks to Kyle Meyer for input.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nmbug2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/nmbug b/bin/nmbug
index 043c1863..6580c31a 100755
--- a/bin/nmbug
+++ b/bin/nmbug
@@ -604,7 +604,7 @@ def get_status():
def _index_tags():
"Write notmuch tags to the nmbug.index."
- path = _os.path.join(NMBGIT, 'nmbug.index')
+ (_, path) = _tempfile.mkstemp(dir=NMBGIT, prefix="nmbug", suffix=".index")
query = ' '.join('tag:"{tag}"'.format(tag=tag) for tag in get_tags())
prefix = '+{0}'.format(_ENCODED_TAG_PREFIX)
_git(