head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.6 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.4 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.2 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.2.0.2 pkgsrc-2011Q3-base:1.2 pkgsrc-2011Q2:1.1.0.8 pkgsrc-2011Q2-base:1.1 pkgsrc-2011Q1:1.1.0.6 pkgsrc-2011Q1-base:1.1 pkgsrc-2010Q4:1.1.0.4 pkgsrc-2010Q4-base:1.1 pkgsrc-2010Q3:1.1.0.2 pkgsrc-2010Q3-base:1.1; locks; strict; comment @# @; 1.3 date 2011.10.19.18.32.50; author ryoon; state dead; branches; next 1.2; 1.2 date 2011.09.12.16.27.18; author taca; state Exp; branches; next 1.1; 1.1 date 2010.10.06.12.29.42; author taca; state Exp; branches; next ; desc @@ 1.3 log @Update to 6.4 * Remove included patches. Changelog: Mew 6.4 stable release (2011/10/19) * cmew falls back to getModificationTime on Windows. Masamichi HOSODA * Supporting Ruby 1.9. Takahiro Kambe Mew 6.4 release candidate 1 (2011/09/06) * A bug of rescan is fixed finally! * mewl avoids causing error if a folder does not exist. Masamichi HOSODA * Catching up to stunnel 4.39. Ryo ONODERA * Supporting text/csv. Tetsuya Toda Mew 6.3.51 (2011/06/29) * A hack for calling browser on Unix. "Diogo F. S. Ramos" and Tatsuya Kinoshita * Bug fixes for hankaku. and Tatsuya Kinoshita * Avoiding broken end-of-line for quoted-printable. * Multibyte hack for Emacs 23 and 24. * Supporting GBK. * Fixing excel and powerpoint on Unix. Kan Sasaki * pdftotext support for Windows. Shuichi KITAGUCHI * &rest to mew-user-agent-compose for Emacs 24. Harald Hanche-Olsen * More gentle for broken Multipart/Signed. Eisaku YAMAGUCHI * Improving the documentation of mew-draft-use-format-flowed. Christophe TROESTLER * varsx hack. * Fixing regex of time. Christophe TROESTLER * Fixing major mode hooks. Hayashi Masahiro * Inline display of PDF with "pdftotext". Hideyuki SHIRAI Harumitsu YOSHITAKE * Text/Pdf for Thunderbird Christophe TROESTLER * Removing warnings for Emacs 23.3 Yu-ji Hosokawa * Killing stunnel with -KILL since the spec of stunnel changed. * The -b option for mewest. "Diogo F. S. Ramos" Mew 6.3.50 (2010/08/31) * Defining mew-draft-use-format-flowed. Christophe TROESTLER * Making use of mew-save-dir. * Fixing the hash-vs-array problem of cmew. Masamichi HOSODA * Making cmew safer in the case where mewest works at the same time. Masamichi HOSODA * Hack for mew-time-rfc-to-sortkey. Hideyuki SHIRAI * A patch for unzip. Yu-ji Hosokawa * Supporting unzip. * Bug fix for PGP/MIME of binary encryption. Shoichi Kurosaka * Both cmew and smew in Haskell works well finally! Shuichi KITAGUCHI * Fixing info/Makefile. Yasuhiro KIMURA * Guarding mew-addrbook-clean-up. Hideyuki SHIRAI * A bug fix of mew-mime-content-type. Yu-ji Hosokawa * Setting split-width-threshold to nil in mew-summary-reply. * "b" in Summary saves the buffer of Message mode to a file. * header-only now can work for M-x mew. * Bold of font can be specified on Emacs 23. * Deleting " " from global-mode-string. Christophe TROESTLER * Correcting the -P option of stunnel3. Kendall Shaw * Define mew-sumsym-encode-folder and mew-sumsym-decode-folder. * set-buffer -> with-current-buffer. * Making mew-mime-image() safer. Hideyuki SHIRAI @ text @$NetBSD: patch-ac,v 1.2 2011/09/12 16:27:18 taca Exp $ * Portability with Ruby 1.9 and later: Use own class to get mail header instead of using mailread. * Two fixes for cmew problem: http://www.mew.org/pipermail/mew-dist/2010-August/028963.html http://www.mew.org/pipermail/mew-dist/2010-August/028962.html --- bin/cmew.orig 2009-09-09 00:57:27.000000000 +0000 +++ bin/cmew @@@@ -13,7 +13,31 @@@@ require 'sqlite3' require 'time' require 'fileutils' require 'find' -require 'mailread' + +################################################################ +## +## mail_header +## +## Get header from mail message. If multiple header field +## exists, last one will be used. +## +def mail_header(path) + @@header = {} + value = nil + File.open(path) do |f| + while l = f.gets.chomp + next if /^From / =~ l + break if /^$/ =~ l + if /^\s+/ !~ l + (name, value) = l.split(/:\s+/, 2) + @@header[name.downcase] = value + else + value << $' + end + end + end + return @@header +end ################################################################ ## @@@@ -127,6 +151,8 @@@@ def register(db, maildir, ignore_regex, deleted = 0 skipdir = '' +begin + Find.find(target) do |fpath| if fpath =~ ignore_regex if FileTest.directory?(fpath) @@@@ -135,7 +161,7 @@@@ def register(db, maildir, ignore_regex, end # next else - st = File.lstat(fpath) + st = File.lstat(fpath) rescue next if st.symlink? if FileTest.directory?(fpath) print fpath, " (ignored)\n" @@@@ -159,14 +185,14 @@@@ def register(db, maildir, ignore_regex, elsif st.file? and fpath =~ /\/[0-9]+(\.mew)?$/ next if File.dirname(fpath) == skipdir next if last_mod > st.ctime.tv_sec - m = Mail.new(fpath) + m = mail_header(fpath) rescue next id = get_id(m) parid = get_parid(m) date = get_date(m) path = get_path(fpath) newpath = true if last_mod > 0 - get_entry.execute!(id) do |row| + get_entry.execute(id).each do |row| past_path = row['path'] unless File.exist?(past_path) del_entry.execute(id, past_path) @@@@ -183,10 +209,16 @@@@ def register(db, maildir, ignore_regex, end end end + +ensure + add_entry.close get_entry.close del_entry.close print 'Registered: ', registred, ', deleted: ', deleted, "\n" + +end + end ################################################################ @@@@ -209,7 +241,7 @@@@ OptionParser.new {|opt| db_file = ARGV[0] || File.expand_path('~/Mail/id.db') maildir = ARGV[1] || File.expand_path('~/Mail') -ignore_regex = Regexp.new(ARGV[2] || '^\./casket$|^\./casket/|/\.') +ignore_regex = Regexp.new(ARGV[2] || '^\./casket$|^\./casket/|^\./casket_replica$|^\./casket_replica/|/\.') target = if ARGV[3]; './' + ARGV[3] else '.' end have_target = if ARGV[3]; true else false end fullupdate = opts[:f] == true @ 1.2 log @Make cmew command usable with ruby19. pkgsrc change: add comments to patch files. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.1 2010/10/06 12:29:42 taca Exp $ @ 1.1 log @Two fixes for cmew problem from mew-dist mailing list. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD$ d3 5 a7 1 Two fixes for cmew problem: d14 34 a47 1 @@@@ -127,6 +127,8 @@@@ def register(db, maildir, ignore_regex, d56 1 a56 1 @@@@ -135,7 +137,7 @@@@ def register(db, maildir, ignore_regex, d65 1 a65 1 @@@@ -159,14 +161,14 @@@@ def register(db, maildir, ignore_regex, d70 1 a70 1 + m = Mail.new(fpath) rescue next d82 1 a82 1 @@@@ -183,10 +185,16 @@@@ def register(db, maildir, ignore_regex, d99 1 a99 1 @@@@ -209,7 +217,7 @@@@ OptionParser.new {|opt| @