~ubuntu-branches/ubuntu/vivid/sup-mail/vivid

« back to all changes in this revision

Viewing changes to bin/sup-add

  • Committer: Bazaar Package Importer
  • Author(s): Decklin Foster
  • Date: 2009-10-12 16:47:08 UTC
  • mfrom: (1.1.4 upstream) (4.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091012164708-9fk9h4i1y6v5ofgm
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
 
77
77
$terminal.wrap_at = :auto
78
78
Redwood::start
79
 
index = Redwood::Index.new
 
79
index = Redwood::Index.init
80
80
 
81
 
index.lock_or_die
 
81
index.lock_interactively or exit
82
82
 
83
83
begin
84
 
  index.load_sources
 
84
  Redwood::SourceManager.load_sources
85
85
 
86
86
  ARGV.each do |uri|
87
87
    labels = $opts[:labels] ? $opts[:labels].split(/\s*,\s*/).uniq : []
88
88
 
89
 
    if !$opts[:force_new] && index.source_for(uri) 
 
89
    if !$opts[:force_new] && Redwood::SourceManager.source_for(uri)
90
90
      say "Already know about #{uri}; skipping."
91
91
      next
92
92
    end
98
98
      when "mbox+ssh"
99
99
        say "For SSH connections, if you will use public key authentication, you may leave the username and password blank."
100
100
        say ""
101
 
        username, password = get_login_info uri, index.sources
 
101
        username, password = get_login_info uri, Redwood::SourceManager.sources
102
102
        Redwood::MBox::SSHLoader.new uri, username, password, nil, !$opts[:unusual], $opts[:archive], nil, labels
103
103
      when "imap", "imaps"
104
 
        username, password = get_login_info uri, index.sources
 
104
        username, password = get_login_info uri, Redwood::SourceManager.sources
105
105
        Redwood::IMAP.new uri, username, password, nil, !$opts[:unusual], $opts[:archive], nil, labels
106
106
      when "maildir"
107
107
        Redwood::Maildir.new uri, nil, !$opts[:unusual], $opts[:archive], nil, labels
113
113
        Trollop::die "Unknown source type #{parsed_uri.scheme.inspect}"      
114
114
      end
115
115
    say "Adding #{source}..."
116
 
    index.add_source source
 
116
    Redwood::SourceManager.add_source source
117
117
  end
118
118
ensure
119
119
  index.save