Subject: Re: [sup-talk] sent mail

From: Neil Stewart <[email-masked]>
Date: Thu, 8 Apr 2010 13:54:01 +0100 (BST)

Hi Richard,

> Not sure if this helps but you really don't want to be using ruby 1.9.0
> the latest is ruby-1.9.1-p376. If you want to install using Debian
> packages they are in testing.
>
>    apt-get install rubygems1.9.1 ruby1.9.1-dev rdoc1.9.1 irb1.9.1
>
> should see you right.

Thanks for the pointers. I've got the right ruby packages now.

# dpkg -l | grep ruby
ii  libreadline-ruby1.9.1                1.9.1.378-1                Readline interface for Ruby 1.9.1
ii  libruby1.9.1                         1.9.1.378-1                Libraries necessary to run Ruby 1.9.1
ii  ruby1.9.1                            1.9.1.378-1                Interpreter of object-oriented scripting lan
ii  ruby1.9.1-dev                        1.9.1.378-1                Header files for compiling extension modules
ii  rubygems1.9.1                        1.3.5-2                    package management framework for Ruby librar

> "gem install sup" will put a script in /usr/bin so you should be able to
> simply type sup. If you have multiple versions of ruby you might have
> problems but if you invoke it thus: /path/to/ruby /usr/bin/sup you
> should be right.

"gem install sup" seems to be failing on ncurses.

# gem install sup
Building native extensions.  This could take a while...
ERROR:  Error installing sup:
         ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
checking for unistd.h... yes
checking for ncurses.h... yes
checking for wmove() in -lncurses... yes
checking for newscr()... yes
checking for TABSIZE()... yes
checking for ESCDELAY()... yes
checking for keybound()... yes
checking for curses_version()... yes
[SNIP]
checking for new_form() in -lform... yes
creating Makefile

make
Makefile:158: warning: overriding commands for target
`/var/lib/gems/1.9.1/gems/ncurses-0.9.1/lib'
Makefile:156: warning: ignoring old commands for target
`/var/lib/gems/1.9.1/gems/ncurses-0.9.1/lib'
cc -I. -I/usr/include/ruby-1.9.1/x86_64-linux
-I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.
-DHAVE_UNISTD_H -DHAVE_NCURSES_H -DHAVE_NEWSCR -DHAVE_TABSIZE
-DHAVE_ESCDELAY -DHAVE_KEYBOUND -DHAVE_CURSES_VERSION -DHAVE_TIGETSTR
-DHAVE_GETWIN -DHAVE_PUTWIN -DHAVE_UNGETMOUSE -DHAVE_MOUSEMASK
-DHAVE_WENCLOSE -DHAVE_MOUSEINTERVAL -DHAVE_WMOUSE_TRAFO -DHAVE_MCPRINT
-DHAVE_HAS_KEY -DHAVE_DELSCREEN -DHAVE_DEFINE_KEY -DHAVE_KEYOK
-DHAVE_RESIZETERM -DHAVE_USE_DEFAULT_COLORS -DHAVE_USE_EXTENDED_NAMES
-DHAVE_WRESIZE -DHAVE_ATTR_ON -DHAVE_ATTR_OFF -DHAVE_ATTR_SET -DHAVE_CHGAT
-DHAVE_COLOR_SET -DHAVE_FILTER -DHAVE_INTRFLUSH -DHAVE_MVCHGAT
-DHAVE_MVHLINE -DHAVE_MVVLINE -DHAVE_MVWCHGAT -DHAVE_MVWHLINE
-DHAVE_MVWVLINE -DHAVE_NOQIFLUSH -DHAVE_PUTP -DHAVE_QIFLUSH -DHAVE_SCR_DUMP
-DHAVE_SCR_INIT -DHAVE_SCR_RESTORE -DHAVE_SCR_SET -DHAVE_SLK_ATTR
-DHAVE_SLK_ATTR_SET -DHAVE_SLK_COLOR -DHAVE_TIGETFLAG -DHAVE_TIGETNUM
-DHAVE_USE_ENV -DHAVE_VIDATTR -DHAVE_WATTR_ON -DHAVE_WATTR_OFF
-DHAVE_WATTR_SET -DHAVE_WCHGAT -DHAVE_WCOLOR_SET -DHAVE_GETATTRS
-DHAVE_ASSUME_DEFAULT_COLORS -DHAVE_ATTR_GET -DHAVE_PANEL_H -DHAVE_FORM_H
-fPIC -fno-strict-aliasing -g -g -O2 -O2 -g -Wall -Wno-parentheses  -fPIC -g
-o form_wrap.o -c form_wrap.c
form_wrap.c: In function 'rbncurs_m_new_form':
form_wrap.c:395: error: 'struct RArray' has no member named 'len'
form_wrap.c: In function 'rbncurs_c_set_field_type':
form_wrap.c:619: error: 'struct RArray' has no member named 'len'
form_wrap.c: In function 'rbncurs_c_set_form_fields':
form_wrap.c:778: error: 'struct RArray' has no member named 'len'
form_wrap.c: In function 'make_arg':
form_wrap.c:1126: error: 'struct RArray' has no member named 'len'
make: *** [form_wrap.o] Error 1

Gem files will remain installed in /var/lib/gems/1.9.1/gems/ncurses-0.9.1
for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ncurses-0.9.1/gem_make.out

I get pretty much identical output from "gem install ncurses", so I suspect
the problem is not even a sup issue. Am I doing something terribly wrong?
All comments most welcome.

Best,
Neil.

_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Rich Lane <[email-masked]>
Date: Fri, 09 Apr 2010 18:09:56 -0400

I switched the dependency back to plain ncurses because ncursesw was
failing to compile on unusual platforms (because of its wide
characterness). I guess this calls for a ncurses-new gem based on the
same upstream code as ncursesw but without the wide character support.
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Neil Stewart <[email-masked]>
Date: Thu, 8 Apr 2010 11:08:31 +0100 (BST)

Hi Michael,

> Are you sure about that? mbox files can easily get very large and it's a
> pain to parse/handle them. I would really recommend maildir, you can use
> mb2md to convert an existing mbox file to a maildir folder.

I shall give this a serious look. Thanks for the tip.

> In sup 0.11, sent mail does not get the inbox label anymore (AFAIK). Are you
> using 0.11?

I'm using 0.10.2-1 from Debian testing. I've had a go at getting 0.11, but
it's not available in Debian. I've failed to compile it several times using
"gems install sup". I finally got it to work using ruby1.9, but can't work
out how to run sup. I tried

# /var/lib/gems/1.9.0/bin/sup
/var/lib/gems/1.9.0/gems/sup-0.11/lib/sup/util.rb:2:in `require': /var/lib/gems/1.9.0/gems/lockfile-1.4.3/lib/lockfile.rb:454: syntax error, unexpected ']' (SyntaxError)
/var/lib/gems/1.9.0/gems/lockfile-1.4.3/lib/lockfile.rb:564: syntax error, unexpected $end, expecting keyword_end
         from /var/lib/gems/1.9.0/gems/sup-0.11/lib/sup/util.rb:2:in `<top (required)>'
         from /var/lib/gems/1.9.0/gems/sup-0.11/lib/sup.rb:277:in `require'
         from /var/lib/gems/1.9.0/gems/sup-0.11/lib/sup.rb:277:in `<top (required)>'
         from /var/lib/gems/1.9.0/gems/sup-0.11/bin/sup:15:in `require'
         from /var/lib/gems/1.9.0/gems/sup-0.11/bin/sup:15:in `<top (required)>'
         from /var/lib/gems/1.9.0/bin/sup:19:in `load'
         from /var/lib/gems/1.9.0/bin/sup:19:in `<main>'

which fails and

# /var/lib/gems/1.9.0/gems/sup-0.11/bin/sup
/usr/bin/env: ruby: No such file or directory

which fails.

I was going to try rubyforge, but it only lists 0.10.2 and earlier.

Being new to ruby is not helping! I'll have a go at compiling the
development version from the git repository.

Thank you for your help.

Best,
Neil.

---

From: Richard Heycock <[email-masked]>
Date: Thu, 08 Apr 2010 23:27:28 +1000

> All comments most welcome.

You are right it's not a sup issue. Ruby ncurses hasn't been ported to
1.9 so I just used ncursesw which seems to work quite well. Since you
are using gem to install sup you will need to untar the gem file modify
the metadata, tar it all up and reinstall. Something along the lines of:

cd /var/lib/gems/1.9.1/gems/cache/
mkdir tmp; cd tmp
tar xf ../sup-0.11.gem (ignore any timestamp errors)
vi metadata (make sure you use vim which will deal with the compression)
tar cf ../sup-0.11.gem .
cd ..
gem install sup-0.11.gem
rm -r tmp (assuming it works)

If you have problems working out which line to change in the metadata
you could unzip it and apply the following patch:

--- metadata.old        2010-04-08 23:10:27.363603950 +1000
+++ metadata.new        2010-04-08 23:11:09.479559396 +1000
@@ -32,7 +32,7 @@
   type: :runtime
   version_requirements: *id001
 - !ruby/object:Gem::Dependency 
-  name: ncurses
+  name: ncursesw
   prerelease: false
   requirement: &id002 !ruby/object:Gem::Requirement 
     requirements: 

And that should do you.

Or you could download a modified gem from http://stuff.roughage.com.au/sup-0.11.gem.
That gem was built from git and works (on my machine!).

William, is there any reason you are using ncurses and not ncursesw?

rgh

-- 
Richard Heycock

http://topikality.com

+61 (0) 410 646 369
[e]:  [email-masked]
[im]: [email-masked]

---

From: Neil Stewart <[email-masked]>
Date: Thu, 8 Apr 2010 22:44:30 +0100 (BST)

>> out how to run sup. I tried

Here is some more information on sent mail appearing in the inbox. First, it
was discussed a while ago. Apologies for missing it.

http://www.mail-archive.com/[email-masked]/msg03227.html

Second, I've downloaded the development sup from the gitorious.org and built and
installed a sup gem. Using this, sent mail does get the inbox tag and appear
in the inbox after sending. I've found that by changing line 52 in sent.rb
from

   def labels; [:inbox, :sent]; end

to

   def labels; [:sent]; end

this behaviour can be disabled, so sent mail goes straight into the archive
and is not included in the inbox.

I've not used ruby before, but I've added an option

:sent_appears_in_inbox: true

to config.yaml.

So the critical lines in sent.rb are now

   if $config[:sent_appears_in_inbox] then
         def labels; [:inbox, :sent]; end
   else
         def labels; [:sent]; end

and I added

     :sent_appears_in_inbox => true

to the bit of sup.pl that writes the default config.yaml.

So the default is the current behaviour---sent appearing in the inbox, but
one can turn this off by altering the default config.yaml.

I've attached trivial patches for sup.rb and sent.rb if these are of any
use.

Best,
Neil.

---

From: Neil Stewart <[email-masked]>
Date: Fri, 9 Apr 2010 22:37:28 +0100 (BST)

Just a further note on the resolultion of the ncurses issue.

>> +++ metadata.new        2010-04-08 23:11:09.479559396 +1000

I'm making my sup gem using ruby1.9.1 and the latest code from gitorious.
The code compiles a gem without complaint, but the gem doesn't install and
gives the above error. When the Rakefile is updated to refer to ncursesw not
ncurses, the gem compiles, installs, and runs without a problem.

Best,
Neil.

---

From: William Morgan <[email-masked]>
Date: Wed, 14 Apr 2010 09:06:22 -0400

> same upstream code as ncursesw but without the wide character support.

Welcome to hell.
-- 
William <[email-masked]>
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Richard Heycock <[email-masked]>
Date: Thu, 08 Apr 2010 22:01:27 +1000

should see you right.

rgh
-- 
Richard Heycock

http://topikality.com

+61 (0) 410 646 369
[e]:  [email-masked]
[im]: [email-masked]