whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit 181921e: production location for the database
Date Sun, 10 Jan 2016 20:01:03 GMT
Commit 181921eb544b176fdbcd2f73d32e90413289eafc:
    production location for the database


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/secmail/config.rb                                        | + -
www/secmail/parsemail.rb                                     | ++ ----
------------------------------------------------------------
8 changes: 3 additions, 5 deletions.
------------------------------------------------------------


diff --git a/www/secmail/config.rb b/www/secmail/config.rb
index 39d6199..2e83339 100644
--- a/www/secmail/config.rb
+++ b/www/secmail/config.rb
@@ -8,5 +8,5 @@
 # Where to save the archive locally
 #
 
-ARCHIVE = File.basename(SOURCE)
+ARCHIVE = (Dir.exist?('/srv/mail') ? '/srv/mail' : File.basename(SOURCE))
 
diff --git a/www/secmail/parsemail.rb b/www/secmail/parsemail.rb
index a426593..a501f37 100644
--- a/www/secmail/parsemail.rb
+++ b/www/secmail/parsemail.rb
@@ -12,8 +12,6 @@
 
 require_relative 'models/mailbox'
 
-database = File.basename(SOURCE)
-
 Dir.chdir File.dirname(File.expand_path(__FILE__))
 
 if ARGV.include? '--fetch1'
@@ -26,13 +24,13 @@
   Mailbox.fetch months
 elsif ARGV.include? '--fetch1'
   Mailbox.fetch Time.now.strftime('%Y%m')
-elsif ARGV.include? '--fetch' or not Dir.exist? database
+elsif ARGV.include? '--fetch' or not Dir.exist? ARCHIVE
   Mailbox.fetch
 end
 
 # scan each mailbox for updates
 width = 0
-Dir[File.join(database, '2*')].sort.each do |name|
+Dir[File.join(ARCHIVE, '2*')].sort.each do |name|
   # skip YAML files, update output showing latest file being processed
   next if name.end_with? '.yml' or name.end_with? '.mail'
   next if ARGV.any? {|arg| arg =~ /^\d{6}$/} and

Mime
View raw message