Tracy Reed | 30 Nov 2011 23:16

before-pull hook etc.

As a sup newbie who has been trying to give sup a go for a month I actually
have several questions about sup but I'll start with the one in the subject:

I am running sup v0.12.1. I have a ~/.sup/hooks/before-pull.rb hook which
invokes offlineimap just as described in the wiki:

def offlineimap(*folders)
  cmd = "offlineimap -q -u Noninteractive.Basic"
    cmd << " -f #{folders * ','}" unless folders.compact.empty?
      `#{cmd} 2>&1`
      end

      def folder_names(sources)
        sources.map { |s| s.uri.split('/').last }
        end

        def inbox_sources(sources = Index.usual_sources)
          sources.find_all { |s| !s.archived? }.sort_by {|s| s.id }
          end

if ( <at> last_fetch || Time.at(0)) < Time.now - 120
  say "Running offlineimap..."
    # only check non-auto-archived sources on the first run
      log offlineimap( <at> last_fetch ? nil : folder_names(inbox_sources))
        say "Finished offlineimap run."
end
 <at> last_fetch = Time.now

I put this in place, restarted sup, hit P and nothing different seems to
happen. It returns immediately and never says "finished offlineimap run". I'm
(Continue reading)

Tracy Reed | 1 Dec 2011 01:48

maildir with spaces

I have an IMAP folder and therefore a Maildir (thanks to offlineimap) with a
space in the name. sup-add chokes on this as does sup-sync when it tries to
read the sources.yaml file.

$ sup-sync maildir:///home/treed/Maildir/mydomain/sent-mail/
/usr/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not URI?):
maildir:///home/treed/Maildir/mydomain/Sent Mail (URI::InvalidURIError)
from /usr/lib/ruby/1.8/uri/common.rb:485:in `parse'
from /usr/lib/ruby/1.8/uri/common.rb:608:in `URI'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:14:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/lib/sup.rb:35:in `new'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/lib/sup.rb:35:in `yaml_properties'
from /usr/lib/ruby/1.8/yaml.rb:133:in `call'
from /usr/lib/ruby/1.8/yaml.rb:133:in `transfer'
from /usr/lib/ruby/1.8/yaml.rb:133:in `node_import'
from /usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /usr/lib/ruby/1.8/yaml.rb:144:in `load_file'
from /usr/lib/ruby/1.8/yaml.rb:143:in `open'
from /usr/lib/ruby/1.8/yaml.rb:143:in `load_file'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/lib/sup.rb:136:in `load_yaml_obj'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/lib/sup/source.rb:205:in `load_sources'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `send'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/lib/sup/index.rb:92:in `load'
from /usr/lib/ruby/gems/1.8/gems/sup-0.12.1/bin/sup-sync:100
from /usr/bin/sup-sync:19:in `load'
from /usr/bin/sup-sync:19

I found this thread:
(Continue reading)

Scott Shook | 1 Dec 2011 14:54
Favicon

Re: maildir with spaces

I had this same problem and I ended up creating symlinks without a space
in the name. Keep the offlineimap config the same but change sup source
to the symlink'd folder.

I.E.
> maildir:///home/treed/Maildir/mydomain/Sent Mail (URI::InvalidURIError)
ln -s /home/treed/Maildir/mydomain/Sent\ Mail /home/treed/Maildir/mydomain/Sent

Scott
Tracy Reed | 1 Dec 2011 19:02

Re: before-pull hook etc.

On Wed, Nov 30, 2011 at 02:16:24PM -0800, Tracy Reed spake thusly:
> accept my sincere apologies. Please submit the contents of
> /home/treed/.sup/exception-log.txt and a brief report of the
> circumstances to http://masanjin.net/sup-bugs/ so that I might
> address this problem. Thank you!

I forgot to mention: I tried to submit these to the bug tracker mentioned in
the stack trace but the url 404's. I just realized perhaps I should be
submitting this stuff to sup-devel so I will subscribe there and will post some
of these questions and the stack traces over there.

--

-- 
Tracy Reed
_______________________________________________
sup-talk mailing list
sup-talk <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

Gmane