]> git.notmuchmail.org Git - sup/commitdiff
minor tweaks and bugfixes
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 3 Jan 2007 06:40:17 +0000 (06:40 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 3 Jan 2007 06:40:17 +0000 (06:40 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@152 5c8cc53c-5e98-4d25-b20a-d8db53a31250

bin/sup-import
lib/sup/imap.rb
lib/sup/mbox/ssh-file.rb

index 0982aec5d893981d21719c3826174c3bb6634d87..9b27887172ae394a294ad24f5983d71ce73a9dfc 100644 (file)
@@ -95,7 +95,6 @@ def get_login_info uri, sources
   [username, password]
 end
 
-
 educate_user if ARGV.member? '--help'
 
 archive = ARGV.delete "--archive"
index 715a98e83215337bb0454c16eb2272645209e656..bd7dc824af00917bb2858e35a8e2b71ec6330474 100644 (file)
@@ -48,7 +48,7 @@ class IMAP < Source
     @ids = []
     @labels = [:unread]
     @labels << :inbox unless archived?
-    @labels << mailbox.intern unless mailbox =~ /inbox/i || mailbox.nil?
+    @labels << mailbox.intern unless mailbox =~ /inbox/i
     @mutex = Mutex.new
   end
 
@@ -122,7 +122,10 @@ class IMAP < Source
 
   def host; @parsed_uri.host; end
   def port; @parsed_uri.port || (ssl? ? 993 : 143); end
-  def mailbox; @parsed_uri.path[1..-1] || 'INBOX'; end
+  def mailbox
+    x = @parsed_uri.path[1..-1]
+    x.empty? ? 'INBOX' : x
+  end
   def ssl?; @parsed_uri.scheme == 'imaps' end
 
   def load_header id
index c2479a8b1a5b15ba13a6580301887dd68148dcf6..80211d050dff1a441da162ec5e373184aa4a090d 100644 (file)
@@ -171,10 +171,9 @@ private
     begin
       retries = 0
       connect
-      MBox::debug "sending command: #{cmd.inspect}"
+      MBox::debug "sending command: #{cmd.inspect}"
       begin
         result = @shell.send_command cmd
-        result = @shell.sync { @shell.send_command cmd }
         raise SSHFileError, "Failure during remote command #{cmd.inspect}: #{(result.stderr || result.stdout || "")[0 .. 100]}" unless result.status == 0
       rescue Net::SSH::Exception # these happen occasionally for no apparent reason. gotta love that nondeterminism!
         retry if (retries += 1) <= 3