This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new e7105284 Avoid reparsing generated pathname
e7105284 is described below

commit e7105284ba00048f85de0c38dfdbaa88acd5a49d
Author: Sebb <[email protected]>
AuthorDate: Tue Apr 12 17:02:24 2022 +0100

    Avoid reparsing generated pathname
---
 tools/deliver.rb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/deliver.rb b/tools/deliver.rb
index 1473a1f1..2be71300 100644
--- a/tools/deliver.rb
+++ b/tools/deliver.rb
@@ -32,9 +32,10 @@ month = Time.now.strftime('%Y%m')
 hash = Digest::SHA1.hexdigest(getmid(hdrs) || mail)[0..9]
 
 # build file name
-file = File.join(MAIL_ROOT,list, month, hash)
+filedir = File.join(MAIL_ROOT, list, month)
+file = File.join(filedir, hash)
 
-File.umask 0002
-FileUtils.mkdir_p File.dirname(file)
+File.umask 0o002
+FileUtils.mkdir_p filedir
 File.write file, mail, encoding: Encoding::BINARY
-File.chmod 0644, file
+File.chmod 0o644, file

Reply via email to