[projects/pld-builder.new] ftp, notifyq: write .desc files atomically
arekm
arekm at pld-linux.org
Mon Oct 26 17:17:06 CET 2026
commit 11b56bca1df48027f501be5328761030608278e0
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Oct 24 14:44:10 2026 +0200
ftp, notifyq: write .desc files atomically
A .desc cut short has no END line, so its file was never sent.
PLD_Builder/ftp.py | 4 +---
PLD_Builder/notifyq.py | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/PLD_Builder/ftp.py b/PLD_Builder/ftp.py
index 41f7238..6106398 100644
--- a/PLD_Builder/ftp.py
+++ b/PLD_Builder/ftp.py
@@ -47,9 +47,7 @@ END
""" % (self.url, l['name'], config.builder, time.time(), l['type'], self.requester_email)
for l in self.queue:
- f = open(path.ftp_queue_dir + '/' + l['id'] + ".desc", "w")
- f.write(desc(l))
- f.close()
+ util.write_atomic(path.ftp_queue_dir + '/' + l['id'] + ".desc", desc(l))
queue = FTP_Queue()
diff --git a/PLD_Builder/notifyq.py b/PLD_Builder/notifyq.py
index 0092596..503b594 100644
--- a/PLD_Builder/notifyq.py
+++ b/PLD_Builder/notifyq.py
@@ -33,9 +33,7 @@ END
""" % (self.notify_url, l['id'], config.builder, time.time(), self.requester_email)
for l in self.queue:
- f = open(path.notify_queue_dir + '/' + l['id'] + ".desc", "w")
- f.write(desc(l))
- f.close()
+ util.write_atomic(path.notify_queue_dir + '/' + l['id'] + ".desc", desc(l))
queue = Notify_Queue()
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/ce9feb3c796ed049b6dd260a50d94d80feb1656d
More information about the pld-cvs-commit
mailing list