[Piuparts-devel] [Git][debian/piuparts][develop] 2 commits: Make the summary generation atomic

Nicolas Dandrimont gitlab at salsa.debian.org
Thu Apr 9 09:42:19 BST 2020



Nicolas Dandrimont pushed to branch develop at Debian / piuparts


Commits:
4f81106e by Julien Cristau at 2020-04-09T10:24:13+02:00
Make the summary generation atomic

- - - - -
093fc7c2 by Nicolas Dandrimont at 2020-04-09T08:42:16+00:00
Merge branch 'atomic-summary' into 'develop'

Make the summary generation atomic

See merge request debian/piuparts!28
- - - - -


1 changed file:

- piupartslib/pkgsummary.py


Changes:

=====================================
piupartslib/pkgsummary.py
=====================================
@@ -83,6 +83,7 @@ from __future__ import print_function
 import json
 import datetime
 from collections import namedtuple, defaultdict
+import os
 
 
 import six
@@ -221,8 +222,9 @@ def tooltip(summary, pkg):
 
 
 def write_summary(summary, fname):
-    with open(fname, 'w') as fl:
+    with open(fname + '.tmp', 'w') as fl:
         json.dump(summary, fl, sort_keys=True, indent=1)
+    os.rename(fname + '.tmp', fname)
 
 
 def read_summary(fname):



View it on GitLab: https://salsa.debian.org/debian/piuparts/-/compare/a72a824255b3ad9b8f4f6710a67740a9184bd08a...093fc7c21486510d325f05f76b6630f1d596e1a5

-- 
View it on GitLab: https://salsa.debian.org/debian/piuparts/-/compare/a72a824255b3ad9b8f4f6710a67740a9184bd08a...093fc7c21486510d325f05f76b6630f1d596e1a5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/piuparts-devel/attachments/20200409/b892aac3/attachment.html>


More information about the Piuparts-devel mailing list