Index: head/UPDATING =================================================================== --- head/UPDATING (revision 117566) +++ head/UPDATING (revision 117567) @@ -1,686 +1,697 @@ This file documents some of the problems you may encounter when upgrading your ports. We try our best to minimize these disruptions, but sometimes they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20040829: + AFFECTS: users of mail/mutt-devel + AUTHOR: udo.schweigert@siemens.com + + The defaults of the port have been changed from WITH_MUTT_NCURSES to + WITH_MUTT_SLANG to be in sync with the mail/mutt port. If you really have + problems with slang (which should be a very rare case) be sure to have set + COLORTERM=yes and COLORFGBG="color1;color2" in your environment, or recompile + the port with the WITH_MUTT_NCURSES knob set (e.g. by adding + WITH_MUTT_NCURSES=yes to your /etc/make.conf). + 20040828: AFFECTS: users of security/samba-vscan AUTHOR: jmelo@freebsdbrasil.com.br The default location of the configuration files has been changed from /etc/ to /usr/local/etc and from /etc/samba/ to /usr/local/etc/samba-vscan/; the default location of the data files has been changed from /var/run/clamd to /var/run/clamav/clamd and from /var/opt/f-secure/fsav/databases to /var/db/fsav/databases. 20040820: AFFECTS: users of japanese/ptex-tetex, japanese/xdvik, and japanese/dvipsk AUTHOR: hrs@FreeBSD.org japanese/ptex-tetex, japanese/xdvik, and japanese/dvipsk now look for the texmf.cnf file in $TEXMF/web2c-ptex/texmf.cnf first, while some utilities included in the original teTeX distribution such as kpsepath(1) look for the file in $TEXMF/web2c/texmf.cnf first. This is for separating the pTeX's texmf.cnf and the original TeX's texmf.cnf, and you do not have to copy or link the file $TEXMF/web2c-ptex/texmf.cnf to $TEXMF/web2c/. To lookup pTeX path by using kpsepath(1) and so on, please set TEXMFCNF environment variable as described in $TEXMF/web2c-ptex/texmf.cnf. For more detail, see $TEXMF/web2c-ptex/texmf.cnf and $TEXMF/web2c/texmf.cnf. 20040820: AFFECTS: users of japanese/platex209-* AUTHOR: hrs@FreeBSD.org japanese/platex209-* are renamed to japanese/platex209 and now depend on japanese/ptex-tetex. While EUC-JP and JIS encoding can be used by default, but Shift JIS is no longer supported because it makes very difficult to maintain other pTeX related ports. However, "ptex --kanji=sjis" still works, so it can be used if all of macro files under share/texmf are converted to Shift JIS encoding manually. 20040820: AFFECTS: users of japanese/dvipsk-vflib AUTHOR: hrs@FreeBSD.org japanese/dvipsk-vflib has been removed because it is not maintained for a long time. While japanese/dvipsk itself has no support to rendering vector fonts, this and Ghostscript give almost the same functionality. 20040820: AFFECTS: users of japanese/xdvik-vflib AUTHOR: hrs@FreeBSD.org japanese/xdvik-vflib has been renamed to japanese/xdvik because it has nothing to do with VFLib now. It depends on and uses FreeType2 to render vector fonts. 20040817: AFFECTS: users of www/apache2 AUTHOR: clement@FreeBSD.org Summary of recent changes: - Access to filesystem is denied by default. - mod_proxy* are no longer built by default - Now ${PREFIX}/etc/apache2/Includes/*.conf can be used to store local configuration or sample configurations. - Makefile.modules.3rd contains modules selection for apache 2.x and 1.3.x 20040815: AFFECTS: users of net/openldap22{,-sasl}-server AUTHOR: eik@FreeBSD.org The start/stop script has moved to ${PREFIX}/etc/rc.d. Users on 5.x who want to start the daemon early can set WITH_RCORDER=yes. Setting WITH_ODBC_TYPE is not sufficient to enable SQL backend support, WITH_ODBC=yes is required. 20040813: AFFECTS: users of x11/kdebase3 (kdm) AUTHOR: kde@freebsd.org If you are unable to login to X via kdm after portupgrading to the latest kdebase port and you're getting these or similar messages on the console /kernel: Aug 13 17:12:10 kiste kdm: :0[447]: Can't execute "/usr/local/share/config/kdm/Xstartup": No such file or directory /kernel: Aug 13 17:12:10 kiste kdm: :0[432]: Cannot execute startup script "/usr/local/share/config/kdm/Xstartup" /kernel: Aug 13 17:12:10 kiste kdm: :0[448]: Can't execute "/usr/local/share/config/kdm/Xreset": No such file or directory /kernel: Aug 13 17:12:12 kiste kdm: :0[458]: Can't execute "/usr/local/share/config/kdm/Xsetup": No such file or directory please do the following: 1.) Copy /usr/local/share/config/kdm/kdmrc away to a safe place, for example your home directory ( cp /usr/local/share/config/kdm/kdmrc ~/ ) 2.) Run, as root: genkdmconf --no-old 3.) Put your copy of kdmrc back to /usr/local/share/config/kdm/kdmrc (cp ~/kdmrc /usr/local/share/config/kdm/ ) Optional step 4.) Run, as root: genkdmconf (without any options) to update your kdmrc to the lastest configfile format Note for advanced users: Substitute /usr/local with your custom PREFIX if you're using one. 20040730: AFFECTS: users of lang/perl5.8 AUTHOR: tobez@FreeBSD.org, mat@FreeBSD.org, marcus@FreeBSD.org lang/perl5.8 has been updated to 5.8.5. you should update everything depending on perl, that is: * first, upgrade your perl5.8 installation. * run "use.perl port", so that the system knows you have 5.8.5. * now, run some magic incantations to upgrade all ports depending on perl, that is run something like : portupgrade -f `(pkg_info -R perl-5.8.5 |tail +4; \ find /usr/local/lib/perl5/site_perl/5.8.[124] -type f -print0 \ | xargs -0 pkg_which -fv | sed -e '/: ?/d' -e 's/.*: //')|sort -u` This is likely to fail for a few ports, you'll have to upgrade them afterwards. Please note, that this last step is, strictly speaking, not necessary, if you are upgrading from 5.8.4. But it is cleaner to do so anyway. 20040726: AFFECTS: users of devel/apache-ant AUTHOR: glewis@FreeBSD.org The update to Ant 1.6.2 introduces the following changes which may break older environments, according to the 1.6.2 release notes: . The import task used the canonical version of a file path. This has been changed to use the absolute path. Bugzilla 28505. . ant-xalan2.jar has been removed since the only class contained in it didn't depend on Xalan-J 2 at all. Its sole dependency has always been TraX and so it has been merged into ant-trax.jar. . All exceptions thrown by tasks are now wrapped in a buildexception giving the location in the buildfile of the task. . Nested elements for namespaced tasks and types may belong to the Ant default namespace as well as the task's or type's namespace. . will very likely no longer work with Xalan-J 1. 20040724: AFFECTS: users for xorg and GNOME AUTHOR: gnome@FreeBSD.org After migrating from XFree86 to X.Org, you must rebuild x11-toolkits/libwnck and x11/libxklavier for full GNOME functionality to be restored. If you receive an XKB initialization error when starting GNOME, edit your XF86Config or xorg.conf, and remove the line: Option "XkbRules" "xfree86" 20040723: AFFECTS: users of FreeBSD-current, users of xorg AUTHOR: anholt@FreeBSD.org The XFREE86_VERSION variable is deprecated and has been replaced by the X_WINDOW_SYSTEM variable. X_WINDOW_SYSTEM may be set to xorg, xfree86-4, or xfree86-3. X_WINDOW_SYSTEM defaults to xorg on FreeBSD-current. If you are switching to xorg, you should follow this set of commands to cleanly upgrade: pkg_delete -f /var/db/pkg/imake-4* /var/db/pkg/XFree86-* cd /usr/ports/x11/xorg && make install pkgdb -F Users of -stable or older -current can switch to X.Org by setting X_WINDOW_SYSTEM=xorg in make.conf and following the same process. Alternately, portupgrade can be used with packages: cd /var/db/pkg portupgrade -o devel/imake-6 imake-4* portupgrade -o x11/xorg-libraries XFree86-libraries portupgrade -o x11/xorg-clients XFree86-clients portupgrade -o x11/xorg-manpages XFree86-manuals portupgrade -o x11/xorg-documents XFree86-documents portupgrade -o x11-fonts/xorg-fonts-truetype XFree86-fontScalable portupgrade -o x11-fonts/xorg-fonts-100dpi XFree86-font100dpi portupgrade -o x11-fonts/xorg-fonts-75dpi XFree86-font75dpi portupgrade -o x11-fonts/xorg-fonts-type1 XFree86-fontDefaultBitmaps portupgrade -o x11-fonts/xorg-fonts-cyrillic XFree86-fontCyrillic portupgrade -o x11-fonts/xorg-fonts-encodings XFree86-fontEncodings portupgrade -o x11-servers/xorg-server XFree86-Server portupgrade -o x11/xorg -f XFree86 20040719: AFFECTS: users of PHP AUTHOR: ale@FreeBSD.org The old lang/php4 and lang/php5 ports have been splitted into 'base' PHP, PEAR, and shared extensions to allow more flexibility and add new features. Upgrading your current PHP installation will result in a 'base' PHP installation (no PEAR and no extensions). PEAR can be found in the new devel/php4-pear and devel/php5-pear ports, while the set of PHP extensions to install can be choosen via the meta-ports lang/php4-extensions and lang/php5-extensions, or installing singular extensions individually. If you have a previous php.ini configuration file, be sure to comment out the extension_dir parameter, since the correct path is statically compiled into the PHP binary. For an overview of the modules used with the old PHP binary, use the command "php -m". 20040717: AFFECTS: users of net/openldap21{,-sasl}-client AUTHOR: eik@FreeBSD.org OpenLDAP version 2.2 is now the default. To upgrade all ports do portupgrade -rfo net/openldap22-client openldap-client (or a similar command for the SASL variant). If you do not want to upgrade, add the line `WANT_OPENLDAP_VER?=21' to /etc/make.conf Note that when you want to upgrade openldap21{,sasl}-server, you have to use slapcat/slapadd to migrate the database, since the internal format is not binary compatible. Simply upgrading the server without doing a slapcat first can corrupt your database. 20040717: AFFECTS: users of mail/exim on FreeBSD 5.x AUTHOR: eik@FreeBSD.org The default location of the startup script has been changed to ${PREFIX}/etc/rc.d. When you depend on the previous behaviour, build the port with WITH_RCORDER=yes. Setting WITH_OPENLDAP_VER and WITH_MYSQL_VER do not automatically imply the corresponding WITH_ varibale. The use of these options is discouraged, use the global settings (WANT_OPENLDAP_VER and DEFAULT_MYSQL_VER) to set system wide defaults. 20040709: AFFECTS: users of mail/sender-milter AUTHOR: vs@FreeBSD.org Milter-sender version 0.58 released. When updating to version 0.58, beware if you have a personalised configuration file (milter-sender.cf). The meaning of the MxAcceptsAllAction variable has changed and its default has changed from 4 to 6. If this variable is not updated, greylisting might be more aggressive than expected. 20040708: AFFECTS: users of www/opera AUTHOR: osa@FreeBSD.org Opera 7.52 released. The file search.ini has been changed to ensure correct default addresses for dictionary and encyclopedia searches. Existing versions will be overwritten on upgrade. Users who have a customized search.ini file that they would like to keep, should edit its version number to 4 before upgrading. Note that you have to edit the search.ini file located in the /.opera folder. [Version] File Version=4 Other changes you are may find in changelog, its available at http://www.opera.com/freebsd/changelogs/752/ 20040706: AFFECTS: users of Python bindings for textproc/lib{xml2,xslt} libraries AUTHOR: gnome@FreeBSD.org Python bindings for libxml2 and libxslt libraries were moved out into separate slave ports. Please install textproc/py-libxml2 and textproc/py-libxslt to get bindings back to your system. 20040703: AFFECTS: users of net/netatalk-devel AUTHOR: marcus@FreeBSD.org Netatalk-devel has been converted to use RCng. That means all of the netatalk daemons must be enabled in /etc/rc.conf before they will start (previously, all netatalk daemons would start by default). The following variables are used by the new netatalk.sh script: atalkd_enable cnid_metad_enable papd_enable afpd_enable timelord_enable See the netatalk.sh script for more details. 20040701: AFFECTS: users of security/portaudit AUTHOR: eik@FreeBSD.org The preference file format, as well as the periodic(8) names have changed. If you use the default settings, no modifications are necessary. new settings in /usr/local/etc/portaudit.conf: portaudit_fetch_env="HTTP_PROXY=" portaudit_fetch_cmd="fetch -1amp" portaudit_sites="http://www.FreeBSD.org/ports/" new settings in periodic.conf(5): daily_status_security_portaudit_enable="YES" daily_status_security_portaudit_expiry="2" daily_status_security_portaudit_user="nobody" 20040629: AFFECTS: users of net/daapd AUTHOR: lth@FreeBSD.org Daapd must now be enabled in rc.conf. Add this to your /etc/rc.conf: daapd_enable="YES" 20040626: AFFECTS: users of php4 and php5 with the PDFlib extension AUTHOR: ale@FreeBSD.org The PDFlib extension has been removed from the archive and moved to PECL. Consequently to enable it you have to install print/pecl-pdflib. Alternatively you may want to try the experimental print/pecl-panda. 20040625: AFFECTS: users of ftp/pure-ftpd AUTHOR: pav@FreeBSD.org Pure-ftpd must be enabled in rc.conf now. Add this to your /etc/rc.conf: pureftpd_enable="YES" 20040622: AFFECTS: users of net/openslp AUTHOR: kuriyama@FreeBSD.org The openslp port must now be enabled / disabled and configured in rc.conf. See the script for details. 20040619: AFFECTS: users of sysutils/webmin and sysutils/usermin AUTHOR: olgeni@FreeBSD.org The webmin and usermin ports must now be enabled in rc.conf. See the pkg-message or script for details. 20040618: AFFECTS: users of japanese/ptex-tetex AUTHOR: hrs@FreeBSD.org The texmf.cnf file for pTeX is now installed in texmf/web2c-ptex. 20040618: AFFECTS: users of japanese/ptex-pkfonts* AUTHOR: hrs@FreeBSD.org The japanese/ptex-pkfonts* has been removed because pkfonts are already included in the teTeX distribution. 20040618: AFFECTS: users of japanese/xdvik-vflib* AUTHOR: hrs@FreeBSD.org The japanese/xdvik-vflib no longer supports VFlib2, and now depends on print/freetype2. For the configuration details, see vfontmap file which installed as texmf/xdvi/vfontmap. japanese/kochi-ttfonts is used for min and goth by default. xdvik-vflib-pk* variants has been removed because pkfonts are already included in the teTeX distribution. 20040618: AFFECTS: users of print/teTeX AUTHOR: hrs@FreeBSD.org The print/teTeX has been split into print/teTeX-base and print/teTeX-texmf, and print/teTeX is now a meta-port for the two and print/dvipsk-tetex and print/xdvik. print/teTeX installs dvips and xdvi by default again (via print/dvipsk-tetex and print/xdvik). For people who want to use teTeX, simply install print/teTeX with options set by default. print/teTeX-base has additional options for adding xdvi and dvips included in the teTeX distribution itself, but use of them are not recommended if you do not understand what you are trying to do. Especially, when the options are set by yourself, do not install ports that match *xdvi* and *dvips* because they break the installed print/teTeX-base's dviware and such conflicts will not be detected. In most cases, a combination of print/teTeX-base + print/dvipsk-tetex + print/xdvik (which are installed by print/teTeX by default) will be sufficient. 20040615: AFFECTS: users of www/firefox AUTHOR: gnome@FreeBSD.org The firefox-0.9 update has a special requirement before you can run it. You must first run firefox as root before running it as another user. The best way to do this is to su - to root or log in as root (i.e. do not su -m to root). After becoming root, simply run ``firefox''. You can then quit the browser, then run it as any other user. If you do not run firefox as root first, the browser window will not appear. 20040608: AFFECTS: users of net/haproxy AUTHOR: clement@FreeBSD.org The haproxy port must now be enabled / disabled and configured in rc.conf. See the pkg-message or script for details. 20040605: AFFECTS: users of www/apache2 AUTHOR: clement@FreeBSD.org The apache2 port must now be enabled / disabled and configured in rc.conf. See the pkg-message or script for details. 20040602: AFFECTS: users of sysutils/mkisofs and sysutils/mkisofs-devel AUTHOR: netchild@FreeBSD.org, marius@FreeBSD.org sysutils/mkisofs and sysutils/mkisofs-devel were merged into sysutils/cdrtools and sysutils/cdrtools-devel respectively. To update them generate ("make index") or fetch ("make fetchindex") a new INDEX/INDEX-5. Run "pkgdb -F" and unregister the mkisofs/-devel port. Then forcefully update the cdrtools port and all of its dependencies (e.g. "portupgrade -rf cdrtools"). After the update it may be necessary to rerun "pkgdb -F" and resolve a stale dependency to cdrtools. 20040531: AFFECTS: users of lang/perl5.8 AUTHOR: mat@FreeBSD.org, marcus@FreeBSD.org lang/perl5.8 has been updated to 5.8.4. you should update everything depending on perl, that is : * first, upgrade your perl5.8 installation. * run "use.perl port", so that the system knows you have 5.8.4. * now, run some magic incantations to upgrade all ports depending on perl, that is run something like : portupgrade -f `(pkg_info -R perl-5.8.4 |tail +4; \ find /usr/local/lib/perl5/site_perl/5.8.2 -type f -print0 \ | xargs -0 pkg_which -fv | sed -e '/: ?/d' -e 's/.*: //')|sort -u` This is likely to fail for a few ports, you'll have to upgrade them afterward. 20040529: AFFECTS: users of mail/mailman and japanese/mailman AUTHOR: nork@FreeBSD.org In Mailman 2.1.5, some significant changes have been made to the file formats for qfiles and the pendings database. See $PREFIX/share/doc/mailman/UPGRADING for details (if you define NOPORTDOCS, refer relevant file in an archive). 20040527: AFFECTS: users of net/openldap22-client AUTHOR: eik@FreeBSD.org The OpenLDAP library soname has changed, requiring a recompilation of all dependent ports: portupgrade -rf net/openldap22-client 20040525: AFFECTS: users of databases/postgresql-client AUTHOR: mat@FreeBSD.org This port was removed because of dependencies problem. If you still want to have it, install databases/postgresql7 with -DWITHOUT_SERVER 20040521: AFFECTS: users of irc/ircd-hybrid-ru AUTHOR: krion@FreeBSD.org UID/GID were changed from 6667 to 555, please manually delete old entries from /etc/passwd /etc/master.passwd and /etc/group 20040514: AFFECTS: users of audio/faad AUTHOR: pav@FreeBSD.org If the compilation of faad fails, please manually delete older installed version of faad and reinstall from port. 20040512: AFFECTS: users of print/teTeX AUTHOR: hrs@FreeBSD.org The print/teTeX no longer installs dvipsk by default. To build and install dvipsk, you have to specify WITH_DVIPSK, or the dvipsk utility in the print/teTeX is also available print/dvipsk-tetex separately. This change is to resolve conflicts between various versions of dvips. 20040504: AFFECTS: users of mail/drac AUTHOR: nork@FreeBSD.org The "drac_flags" rc.conf(5) variable has been renamed to "dracd_flags". See the pkg-message or script for details. 20040501: AFFECTS: users of www/apache13 AUTHOR: nork@FreeBSD.org The apache13 port must now be enabled / disabled and configured in rc.conf. See the pkg-message or script for details. 20040429: AFFECTS: users of sysutils/smartmontools AUTHOR: nork@FreeBSD.org The smartmontools port must now be enabled / disabled and configured in rc.conf. See the pkg-message or script for details. 20040420: AFFECTS: users of sysutils/cdrtools AUTHOR: netchild@FreeBSD.org The cdrecord program now uses ${PREFIX}/etc (e.g. /usr/local/etc) instead of /etc/default as the location of the global configuration file. If you created such a configuration file you need to copy it over to the new location. 20040420: AFFECTS: users of x11/kdebase3 AUTHOR: kde@FreeBSD.org If you update KDE from version 3.2.1 or earlier to version 3.2.2 while running a KDE session, newly opened instances of Konqueror might hang or crash, depending on how far the update has progressed. If this happens, it is necessary to restart your KDE session in order to restore proper operations. 20040404: AFFECTS: GNOME desktop users AUTHOR: gnome@FreeBSD.org GNOME has been updated to 2.6. Simply portupgrading will cause serious problems if you are using the desktop itself. If you are a GNOME desktop user, you should carefully read the instructions at: http://www.freebsd.org/gnome/docs/faq26.html And use the gnome_upgrade.sh script to properly upgrade to GNOME 2.6. If you are just a casual user of some of the GNOME libraries, portupgrade should be sufficient to update your ports. 20040316: AFFECTS: users of net/isc-dhcp3-* AUTHOR: des@FreeBSD.org The isc-dhcp3-* ports must now be enabled / disabled and configured in rc.conf. See the pkg-message for details. 20040313: AFFECTS: users of textproc/expat2 AUTHOR: marcus@FreeBSD.org Users of expat2 (and its many dependencies) should do the following to properly update expat2 and all of its dependencies: portupgrade -rf textproc/expat2 20040311: AFFECTS: users of databases/postgresql7 AUTHOR: osa@FreeBSD.org PostgreSQL 7.4.2 Released and release notes available at http://www.postgresql.org/news/173.html NOTICE: unlike most minor versions, this version does require some updates to the pg_* system tables. Full instructions for how to do this are included in the full HISTORY file. DO NOT UPGRADE WITHOUT READING THESE INSTRUCTIONS. 20040309: AFFECTS: users of x11/kdelibs3 and x11/kdebase3 AUTHOR: kde@FreeBSD.org If you update kdelibs from version 3.2.0 to version 3.2.1 while running a KDE 3.2.0 session, newly opened instances of Konqueror will silently crash as soon as the new version of kdelibs has been installed, due to mismatching linker symbols. It is recommended you quit your KDE session at that point and update kdebase to version 3.2.1, then restart KDE. 20040309: AFFECTS: users of audio/arts and x11/kdebase AUTHOR: kde@FreeBSD.org The arts port, PORTVERSION 1.2.1 does not include artswrapper anymore. Instead, artswrapper is now installed by a new port audio/artswrapper. Installation of artswrapper is optional, however: If you presently run KDE and you have "Run with the highest possible priority (realtime priority)" checked in Control Center/Sound & Multimedia/ Sound System and you choose to NOT install audio/artswrapper, you need to - Uncheck "Run with the highest possible priority (realtime priority)" in Control Center/Sound & Multimedia/Sound System BEFORE updating arts OR - AFTER updating arts and kdebase, go to Control Center/Sound & Multimedia/ Sound System, click on the unchecked "Run with the highest possible priority (realtime priority)", dismiss the message telling you that realtime is un- available or artswrapper is missing and then click Apply. 20040305: AFFECTS: users of security/antivir-milter AUTHOR: netchild@FreeBSD.org When updating from a previous version of security/antivir-milter you have to do the following after deinstalling the old port: rm /AntiVir/antivir rm /AntiVir/antivir.vdf chown root:wheel /AntiVir chown root:smmsp /AntiVir/hbedv.key In your SENDMAIL_MC change `S=unix:/AntiVir/avmilter.sock, F=T, T=S:10m;R:10m;E:5m' to: `S=unix:/var/spool/avmilter/avmilter.sock, F=T, T=S:10m;R:10m;E:10m' and rebuild sendmail.cf. If /var/spool/avmilter exist you have to: chown -R smmsp:smmsp /var/spool/avmilter If you are using a customized /etc/avmilter.conf the port won't remove it on deinstall and you have to manually change User and Group to smmsp there. Afterwards you can install the new version of this port. You then should run antivirupdater to get a current VDF. 20040226: AFFECTS: i386 users of ruby and portupgrade AUTHOR: knu@FreeBSD.org Change the default version of ruby to 1.8 for i386. If you are a ruby developer and want to keep ruby 1.6 as default, please add RUBY_DEFAULT_VER=1.6 to /etc/make.conf. Otherwise, please run the following series of commands to migrate to ruby 1.8: 1) Reinstall portupgrade manually (and as a result ruby 1.8 will be installed): pkg_delete portupgrade-\* (cd /usr/ports/sysutils/portupgrade; make install clean) 2) Reinstall everything that depends on ruby 1.6 to use ruby 1.8 instead: portupgrade -fr lang/ruby16 3) Reinstall ruby 1.8 (because the previous step kills symlinks): portupgrade -f lang/ruby18 4) Deinstall ruby 1.6 stuff (if you are paranoia): pkg_deinstall -ri lang/ruby16 5) If the above commands do now work somehow and portupgrade starts causing LoadError, please reinstall portupgrade manually again. Whenever you get confused, you can always deinstall portupgrade and all the ruby stuff (run "pkg_delete -r ruby-\*") and reinstall portupgrade as a last resort. 20040204: AFFECTS: 5.2-CURRENT users who started with a 5.2-RELEASE or older. AUTHOR: obrien@FreeBSD.org Change the default version of perl to 5.8. 1) Force perl-5.6.1 to be upgraded with perl-5.8. portupgrade -o lang/perl5.8 -f perl-5.6.1_15 2) Update all p5-* modules. portupgrade -f p5-\* $FreeBSD$ Property changes on: head/UPDATING ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.63 \ No newline at end of property +1.64 \ No newline at end of property Index: head/mail/mutt-devel/Makefile =================================================================== --- head/mail/mutt-devel/Makefile (revision 117566) +++ head/mail/mutt-devel/Makefile (revision 117567) @@ -1,410 +1,410 @@ # ex:ts=8 # Ports collection makefile for: mutt development # Date created: 6 Jun 2001 # Whom: Udo Schweigert # # $FreeBSD$ # # There are several knobs which are used to define additions to the core # mutt functionality. # # As all of the knobs have a unique name which should not interfere with # other ports you can add them to /etc/make.conf, e.g. a line like # "WITH_MUTT_NNTP=yes" will enable mutt's nntp facilities. # # In addition to the knobs listed below you can enable other configuration # options of mutt by adding them to the MUTT_CONFIGURE_ARGS variable. For # example you could say "MUTT_CONFIGURE_ARGS=--with-homespool=MyMail" to # configure a different file for mutt's homespool. # # The two most important knobs are: # -# In general you can choose between using the SLANG port (WITH_MUTT_SLANG) -# and ncurses (WITH_MUTT_NCURSES) which is the default. Note that you may -# have to set the variables COLORTERM=yes and COLORFGBG=color,color in your +# In general you can choose between using ncurses (WITH_MUTT_NCURSES) +# and SLANG (WITH_MUTT_SLANG) which is the default. Note that you may +# have to set the variables COLORTERM=yes and COLORFGBG="color1;color2" in your # environment to get slang function properly. # # If you want to install the mutt documentation in html and ps format define: # WITH_MUTT_HTML # This is a default knob and can be disabled by WITHOUT_MUTT_HTML # # If you do not want that the documentation is rebuilt using sgmlformat # define: # WITHOUT_MUTT_SGMLFORMAT # (this can only be stated if WITHOUT_MUTT_HTML is defined) # # If you want to access compressed email folders define: # WITH_MUTT_COMPRESSED_FOLDERS # This is a default knob and can be disabled by WITHOUT_MUTT_COMPRESSED_FOLDERS # # If you do not want mutt to use the iconv library define: # WITHOUT_MUTT_ICONV # # If you want to enable extended quoting functions define: # WITH_MUTT_QUOTE_PATCH # This is a default knob and can be disabled by WITHOUT_MUTT_QUOTE_PATCH # # If you want to have the Maildir/IMAP header cache define: # WITH_MUTT_MAILDIR_HEADER_CACHE # # If you want to make SMIME outlook compatible define: # WITH_MUTT_SMIME_OUTLOOK_COMPAT # This is a default knob and can be disabled by # WITHOUT_MUTT_SMIME_OUTLOOK_COMPAT # # If you want to use enhanced pgp features define: # WITH_MUTT_PGP_PATCH # This is a default knob and can be disabled by WITHOUT_MUTT_PGP_PATCH # # If you want to read and post news with mutt define: # WITH_MUTT_NNTP # # If you want to use the SASL authentication features with your email server # define # WITH_MUTT_CYRUS_SASL # # If you want to use the rethreading functions define: # WITH_MUTT_EDIT_THREADS # # If you want to use the signature menu define: # WITH_MUTT_SIGNATURE_MENU # # If you want to use the printf-like enhancement to the mbox-hook command # define: # WITH_MUTT_MBOX_HOOK_PATCH # # If you want to use the ifdef feature define: # WITH_MUTT_IFDEF_PATCH # # If you want to have the Maildir mtime patch define: # WITH_MUTT_MAILDIR_MTIME_PATCH PORTNAME= mutt-devel PORTVERSION= 1.5.6 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES+= mail ipv6 .if defined(WITH_MUTT_NNTP) CATEGORIES+= news .endif MASTER_SITES= ftp://ftp.mutt.org/mutt/devel/ \ ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/devel/ \ ftp://ftp.demon.co.uk/pub/mirrors/mutt/devel/ \ ftp://ftp.parodius.com/pub/mutt/devel/ DISTNAME= mutt-${PORTVERSION}i PATCH_SITES+= http://www.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ http://www2.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ http://www3.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ ftp://ftp.mutt.org.ua/pub/mutt/mutt-${VVV_PATCH_VERSION}/:vvv \ ftp://ftp3.mutt.org.ua/pub/mutt/mutt-${VVV_PATCH_VERSION}/:vvv \ http://cedricduval.free.fr/mutt/patches/download/:cd \ http://home.woolridge.ca/mutt/patches/:dw MAINTAINER?= udo.schweigert@siemens.com COMMENT?= The Mongrel of Mail User Agents (part Elm, Pine, Mush, mh, etc.) CONFLICTS= mutt-[0-9]* DIST_SUBDIR= mutt DOCSDIR?= ${PREFIX}/share/doc/mutt EXAMPLESDIR?= ${PREFIX}/share/examples/mutt DATADIR?= ${PREFIX}/share/mutt LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ENV= CC="${CC} -I${LOCALBASE}/include" LDFLAGS="${LDFLAGS}" CONFIGURE_ARGS= --enable-flock --disable-fcntl --with-ssl=${OPENSSLBASE} \ --with-sharedir=${PREFIX}/share/mutt --with-docdir=${DOCSDIR} \ --sysconfdir=${PREFIX}/etc --enable-external-dotlock \ --enable-pop --enable-imap .if defined(MUTT_CONFIGURE_ARGS) CONFIGURE_ARGS+= ${MUTT_CONFIGURE_ARGS} .endif USE_REINPLACE= yes USE_AUTOMAKE_VER= 18 USE_AUTOCONF_VER= 259 USE_OPENSSL= yes PLIST= ${WRKDIR}/PLIST PKGMESSAGE= ${WRKDIR}/pkg-message SCRIPTS_ENV= WRKDIR="${WRKDIR}" .include CD_PATCH_VERSION= 1.5.5.1 CD_IFDEF_PATCH_VERSION= 1.5.4 .if !defined(VVV_PATCH_VERSION) VVV_PATCH_VERSION= ${PORTVERSION} .endif .if !defined(CD_PATCH_VERSION) CD_PATCH_VERSION= ${PORTVERSION} .endif .if !defined(CD_IFDEF_PATCH_VERSION) CD_IFDEF_PATCH_VERSION= ${CD_PATCH_VERSION} .endif .if !defined(DW_PATCH_VERSION) DW_PATCH_VERSION= ${PORTVERSION} .endif .if !defined(DW_MBOX_PATCH_VERSION) DW_MBOX_PATCH_VERSION= ${DW_PATCH_VERSION} .endif .if defined(WITH_MUTT_IMAP_HEADER_CACHE) WITH_MUTT_MAILDIR_HEADER_CACHE= yes .endif # XXX # this should be done automagically by aclocal but .... # for now, this will have to do pre-build: @${REINPLACE_CMD} -E -e "s|^(ACLOCAL = ).+|\1${ACLOCAL}|" \ -e "s|^(AUTOCONF = ).+|\1${AUTOCONF}|" \ -e "s|^(AUTOMAKE = ).+|\1${AUTOMAKE}|" \ -e "s|^(AUTOHEADER = ).+|\1${AUTOHEADER}|" \ ${BUILD_WRKSRC}/Makefile .if defined(PACKAGE_BUILDING) BUILD_DEPENDS+= ispell:${PORTSDIR}/textproc/ispell RUN_DEPENDS= ispell:${PORTSDIR}/textproc/ispell \ urlview:${PORTSDIR}/textproc/urlview .endif .if defined(WITH_MUTT_NCURSES_PORT) WITH_MUTT_NCURSES= yes .endif -.if defined(WITH_MUTT_NCURSES) -MUTT_USES_NCURSES= yes -.endif -.if defined(WITH_MUTT_SLANG) && !defined(MUTT_USES_NCURSES) +.if defined(WITH_MUTT_SLANG) MUTT_USES_SLANG= yes .endif -.if !defined(MUTT_USES_NCURSES) && !defined(WITHOUT_MUTT_NCURSES) && !defined(MUTT_USES_SLANG) +.if defined(WITH_MUTT_NCURSES) && !defined(MUTT_USES_SLANG) MUTT_USES_NCURSES= yes .endif +.if !defined(MUTT_USES_SLANG) && !defined(WITHOUT_MUTT_SLANG) && !defined(MUTT_USES_NCURSES) +MUTT_USES_SLANG= yes +.endif .if defined(WITHOUT_MUTT_SGMLFORMAT) SGML_USED= no .endif .if !defined(SGML_USED) SGML_USED= no .endif .if !defined(WITHOUT_NLS) USE_GETTEXT= yes .endif .if !defined(WITHOUT_MUTT_ICONV) USE_ICONV= yes .endif .if defined(NOPORTDOCS) SGML_USED= no .endif .if defined(MUTT_USES_NCURSES) && ${OSVERSION} < 400000 LIB_DEPENDS+= ncurses.5:${PORTSDIR}/devel/ncurses CFLAGS+= -I${PREFIX}/include/ncurses -I${PREFIX}/include .elif defined(MUTT_USES_SLANG) LIB_DEPENDS+= slang.1:${PORTSDIR}/devel/libslang .endif .if defined(WITH_MUTT_CYRUS_SASL) BROKEN= "mutt-devel's SASL code appears to be broken" LIB_DEPENDS+= sasl.8:${PORTSDIR}/security/cyrus-sasl .endif .if defined(WITH_MUTT_MAILDIR_HEADER_CACHE) LIB_DEPENDS+= db-4.2.2:${PORTSDIR}/databases/db42 CFLAGS+= -I${PREFIX}/include/db42 .endif .if ! defined(WITHOUT_MUTT_SMIME_OUTLOOK_COMPAT) pre-configure:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook .endif .if defined(WITH_MUTT_MAILDIR_HEADER_CACHE) pre-configure:: @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-header-cache .endif .if defined(WITH_MUTT_MAILDIR_MTIME_PATCH) pre-configure:: .if defined(WITH_MUTT_NNTP) @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-maildir-mtime-nntp .else @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-maildir-mtime .endif .endif .if defined(WITH_MUTT_NNTP) pre-configure:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-nntp.c .endif .if ! defined(WITHOUT_MUTT_PGP_PATCH) SGML_NEEDED= yes pre-configure:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-pgp-dw .endif .if defined(WITH_MUTT_EDIT_THREADS) pre-configure:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-edit-threads .endif .if defined(WITH_MUTT_LOCALES_FIX) CONFIGURE_ARGS+= --enable-locales-fix .endif .if defined(MUTT_USES_NCURSES) && ${OSVERSION} < 400000 CONFIGURE_ARGS+= --with-curses=${PREFIX} .elif defined(MUTT_USES_SLANG) CONFIGURE_ARGS+= --with-slang=${PREFIX} PATCHFILES+= patch-${VVV_PATCH_VERSION}.vvv.slang.gz:vvv .endif .if defined(WITH_MUTT_CYRUS_SASL) CONFIGURE_ARGS+= --with-sasl=${LOCALBASE} .endif .if defined(WITHOUT_NLS) CONFIGURE_ARGS+= --disable-nls .endif .if defined(WITHOUT_MUTT_ICONV) CONFIGURE_ARGS+= --disable-iconv .else CONFIGURE_ARGS+= --with-libiconv-prefix=${PREFIX} .endif PATCH_DIST_STRIP= -p1 .if ! defined (WITHOUT_MUTT_COMPRESSED_FOLDERS) PATCHFILES+= patch-${VVV_PATCH_VERSION}.rr.compressed.gz:vvv CONFIGURE_ARGS+= --enable-compressed SGML_NEEDED= yes .endif .if defined(WITH_MUTT_NNTP) PATCHFILES+= patch-${VVV_PATCH_VERSION}.vvv.nntp.gz:vvv CONFIGURE_ARGS+= --enable-nntp SGML_NEEDED= yes .endif .if ! defined(WITHOUT_MUTT_QUOTE_PATCH) PATCHFILES+= patch-${VVV_PATCH_VERSION}.vvv.initials.gz:vvv \ patch-${VVV_PATCH_VERSION}.vvv.quote.gz:vvv SGML_NEEDED= yes .endif .if defined(WITH_MUTT_EDIT_THREADS) CONFIGURE_ARGS+= --enable-imap-edit-threads SGML_NEEDED= yes .endif .if defined(WITH_MUTT_SIGNATURE_MENU) PATCHFILES+= patch-${CD_PATCH_VERSION}.cd.signatures_menu.2.1:cd SGML_NEEDED= yes .endif .if defined(WITH_MUTT_IFDEF_PATCH) PATCHFILES+= patch-${CD_IFDEF_PATCH_VERSION}.cd.ifdef.1:cd SGML_NEEDED= yes .endif .if defined(WITH_MUTT_MBOX_HOOK_PATCH) PATCHFILES+= p0-patch-${DW_MBOX_PATCH_VERSION}.dw.mbox-hook.1:dw .endif WRKSRC= ${WRKDIR}/${DISTNAME:S/i$//} MAN1= flea.1 mutt.1 mutt_dotlock.1 muttbug.1 MAN5= muttrc.5 mbox.5 post-patch:: @${REINPLACE_CMD} -e 's,/usr/bin/gpg,${LOCALBASE}/bin/gpg,g' \ ${WRKSRC}/contrib/gpg.rc @${REINPLACE_CMD} -E -e 's|@samplesdir@|${EXAMPLESDIR}|g' \ ${WRKSRC}/contrib/Makefile.in pre-configure:: @(cd ${WRKSRC}; ${SETENV} ${AUTOMAKE_ENV} ${ACLOCAL} -I m4) .if defined(WITH_MUTT_NNTP) SCRIPTS_ENV+= MUTT_NNTP="yes" .endif .if ! defined (WITHOUT_MUTT_COMPRESSED_FOLDERS) SCRIPTS_ENV+= MUTT_COMPRESSED_FOLDERS="yes" .endif .if ! defined(WITHOUT_MUTT_QUOTE_PATCH) SCRIPTS_ENV+= MUTT_QUOTE_PATCH="yes" .endif .if defined(WITH_MUTT_MAILDIR_HEADER_CACHE) SCRIPTS_ENV+= MUTT_MAILDIR_HEADER_CACHE="yes" CONFIGURE_ARGS+= --enable-hcache .endif .if defined(WITH_MUTT_EDIT_THREADS) SCRIPTS_ENV+= MUTT_EDIT_THREADS="yes" .endif .if defined(WITH_MUTT_SIGNATURE_MENU) SCRIPTS_ENV+= MUTT_SIGNATURE_MENU="yes" .endif .if defined(WITH_MUTT_IFDEF_PATCH) SCRIPTS_ENV+= MUTT_IFDEF_PATCH="yes" .endif .if ! defined(WITHOUT_MUTT_PGP_PATCH) SCRIPTS_ENV+= MUTT_PGP_PATCH="yes" .endif .if ! defined(WITHOUT_MUTT_HTML) SCRIPTS_ENV+= MUTT_HTML="yes" .endif .if !defined(WITHOUT_NLS) SCRIPTS_ENV+= MUTT_NLS="yes" .endif .if !defined(NOPORTDOCS) SCRIPTS_ENV+= MUTT_PORTDOCS="yes" post-build: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-doc-ref @${REINPLACE_CMD} -E -e 's|\$$\{PREFIX\}|${PREFIX}|g' \ -e 's|\$$\{DOCSDIR\}|${DOCSDIR}|g' \ -e 's|\$$\{EXAMPLESDIR\}|${EXAMPLESDIR}|g' \ ${WRKSRC}/doc/mutt.man @${REINPLACE_CMD} -E -e 's|\$$\{PREFIX\}|${PREFIX}|g' \ -e 's|\$$\{DOCSDIR\}|${DOCSDIR}|g' \ -e 's|\$$\{EXAMPLESDIR\}|${EXAMPLESDIR}|g' \ ${WRKSRC}/doc/muttrc.man .if ! defined(WITHOUT_MUTT_HTML) SGML_USED= yes .endif .if defined(SGML_NEEDED) && !defined(WITHOUT_MUTT_SGMLFORMAT) SGML_USED= yes .endif .else # ! NOPORTDOCS post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-nodoc-contrib .endif # ! NOPORTDOCS .if ${SGML_USED} == yes SCRIPTS_ENV+= MUTT_SGML="yes" BUILD_DEPENDS+= sgmlfmt:${PORTSDIR}/textproc/sgmlformat post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-sgmlformat .endif pre-install: @${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/generate-plist > ${PLIST} post-install: @${ECHO} > ${PKGMESSAGE} ${INSTALL_DATA} ${WRKSRC}/Muttrc ${PREFIX}/etc/Muttrc.dist ${INSTALL_DATA} ${WRKSRC}/mime.types ${PREFIX}/etc/mime.types.dist .if !defined(NOPORTDOCS) @${ECHO} "===> Installing Mutt documentation" @${MKDIR} ${DOCSDIR} && ${CHMOD} a+rx ${DOCSDIR} @cd ${WRKSRC}/doc ; ${INSTALL_MAN} manual.txt PGP-Notes.txt \ ../ABOUT-NLS ../contrib/language* ${DOCSDIR} .if ${SGML_USED} == yes @cd ${WRKSRC}/doc ; ${INSTALL_MAN} manual.latin1 manual.ps ${DOCSDIR} .endif .if defined(WITH_MUTT_NNTP) @cd ${WRKSRC} ; ${INSTALL_MAN} ChangeLog.nntp ${DOCSDIR} .endif .if ! defined(WITHOUT_MUTT_HTML) @${MKDIR} ${DOCSDIR}/html && ${CHMOD} a+rx ${DOCSDIR}/html ${INSTALL_MAN} ${WRKSRC}/doc/*.html ${DOCSDIR}/html .endif .endif .if defined(MUTT_USES_SLANG) @${ECHO} "=====================================================" >> ${PKGMESSAGE} @${ECHO} "You have installed ${PORTNAME} with SLANG support." >> ${PKGMESSAGE} @${ECHO} "This may work for a color terminal only when defining" >> ${PKGMESSAGE} - @${ECHO} "COLORTERM=yes and COLORFGBG=color,color in your" >> ${PKGMESSAGE} + @${ECHO} "COLORTERM=yes and COLORFGBG=\"color1;color2\" in your" >> ${PKGMESSAGE} @${ECHO} "environment." >> ${PKGMESSAGE} @${ECHO} "=====================================================" >> ${PKGMESSAGE} .endif .if !defined(BATCH) @${CAT} ${PKGMESSAGE} @${ECHO} .endif .include Property changes on: head/mail/mutt-devel/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.229 \ No newline at end of property +1.230 \ No newline at end of property Index: head/mail/mutt-devel/files/extra-patch-maildir-header-cache =================================================================== --- head/mail/mutt-devel/files/extra-patch-maildir-header-cache (revision 117566) +++ head/mail/mutt-devel/files/extra-patch-maildir-header-cache (revision 117567) @@ -1,1435 +1,1435 @@ -diff -Nru a/Makefile.am b/Makefile.am ---- a/Makefile.am 2004-08-18 10:08:12 +02:00 -+++ b/Makefile.am 2004-08-18 10:08:12 +02:00 -@@ -20,2 +20,3 @@ - mutt_SOURCES = $(BUILT_SOURCES) \ -+ hcache.c \ - addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \ +diff -Nru a/PATCHES b/PATCHES +--- a/PATCHES ++++ b/PATCHES +@@ -0,0 +1 @@ ++patch-1.5.6.tg.hcache.2 diff -Nru a/configure.in b/configure.in ---- a/configure.in 2004-08-18 10:08:12 +02:00 -+++ b/configure.in 2004-08-18 10:08:12 +02:00 -@@ -768,6 +768,80 @@ +--- a/configure.in 2004-08-18 09:43:09 +02:00 ++++ b/configure.in 2004-08-18 06:34:04 +02:00 +@@ -768,6 +768,81 @@ fi]) +dnl -- start cache -- +AC_ARG_ENABLE(hcache, [ --enable-hcache Enable header caching], +[if test x$enableval = xyes; then + AC_DEFINE(USE_HCACHE, 1, [Enable header caching]) ++ MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS hcache.o" + + OLDCPPFLAGS="$CPPFLAGS" + OLDLIBS="$LIBS" + + BDB_VERSIONS="db-4 db4 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db" + + AC_MSG_CHECKING([for BerkeleyDB > 4.0]) + + for d in /opt/csw/bdb4 /opt /usr/local /usr; do + for v in `echo $BDB_VERSIONS .`; do + if test -r "$d/include/$v/db.h"; then + BDB_INCLUDE_DIR="$d/include/$v" + break + fi + done + for v in `echo $BDB_VERSIONS .`; do + if test -d "$d/lib/$v"; then + BDB_LIB_DIR="$d/lib/$v" + break + fi + done + for v in BerkeleyDB.4.3 BerkeleyDB.4.2 BerkeleyDB.4.1; do + test -r "$d/$v/include/db.h" && BDB_INCLUDE_DIR="$d/$v/include" + test -d "$d/$v/lib" && BDB_LIB_DIR="$d/$v/lib" + done + test x$BDB_INCLUDE_DIR = x -o x$BDB_LIB_DIR = x && continue + for v in `echo $BDB_VERSIONS`; do + CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR" + LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$v" + AC_TRY_LINK([ + #include + #include + ],[ + DB *db = NULL; + db->open(db,NULL,NULL,NULL,0,0,0); + ],[ + ac_cv_dbcreate=yes + BDB_LIB="$v" + break + ]) + done + test x$BDB_LIB != x && break + done + + if test x$ac_cv_dbcreate = xyes; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + + CPPFLAGS="$OLDCPPFLAGS" + LIBS="$OLDLIBS -lgdbm"; + AC_CACHE_CHECK(for gdbm_open, ac_cv_gdbmopen, + [ac_cv_gdbmopen=no + AC_TRY_LINK([#include ],[gdbm_open(0,0,0,0,0);],[ac_cv_gdbmopen=yes])]) + + if test x$ac_cv_dbcreate = xyes; then + CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR" + LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB" + AC_DEFINE(HAVE_DB4, 1, [Sleepycat DB4 Support]) + elif test x$ac_cv_gdbmopen = xyes; then + CPPFLAGS="$OLDCPPFLAGS" + LIBS="$OLDLIBS -lgdbm"; + AC_DEFINE(HAVE_GDBM, 1, [GDBM Support]) + else + AC_MSG_ERROR(You need Sleepycat DB4 or GDBM for --enable-hcache) + fi +fi]) +dnl -- end cache -- + AC_SUBST(MUTTLIBS) AC_SUBST(MUTT_LIB_OBJECTS) AC_SUBST(LIBIMAP) diff -Nru a/globals.h b/globals.h ---- a/globals.h 2004-08-18 10:08:12 +02:00 -+++ b/globals.h 2004-08-18 10:08:12 +02:00 +--- a/globals.h 2004-08-18 09:43:11 +02:00 ++++ b/globals.h 2004-08-26 22:32:53 +02:00 @@ -63,6 +63,10 @@ WHERE char *Locale; WHERE char *MailcapPath; WHERE char *Maildir; +#if USE_HCACHE +WHERE char *HeaderCache; -+WHERE short HeaderCachePageSize; ++WHERE char *HeaderCachePageSize; +#endif WHERE char *MhFlagged; WHERE char *MhReplied; WHERE char *MhUnseen; diff -Nru a/hcache.c b/hcache.c --- /dev/null Wed Dec 31 16:00:00 196900 -+++ b/hcache.c 2004-08-18 10:08:12 +02:00 -@@ -0,0 +1,794 @@ ++++ b/hcache.c 2004-08-26 22:32:53 +02:00 +@@ -0,0 +1,798 @@ +/* + * Copyright (C) 2004 Thomas Glanzmann + * Copyright (C) 2004 Tobias Werth + * Copyright (C) 2004 Brian Fundakowski Feldman + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + +#if HAVE_GDBM +#include +#elif HAVE_DB4 +#include +#endif + +#include +#include +#include "mutt.h" +#ifdef USE_IMAP +#include "message.h" +#endif +#include "mime.h" +#include "mx.h" +#include "lib.h" + +#if HAVE_GDBM +static struct +header_cache +{ + GDBM_FILE db; + char *folder; + unsigned int crc; +} HEADER_CACHE; +#elif HAVE_DB4 +static struct +header_cache +{ + DB_ENV *env; + DB *db; + unsigned int crc; + int fd; + char lockfile[_POSIX_PATH_MAX]; +} HEADER_CACHE; +#endif + +typedef union +{ + struct timeval timeval; + unsigned long long uid_validity; +} validate; + +static unsigned char * +dump_int(unsigned int i, unsigned char *d, int *off) +{ + safe_realloc(&d, *off + sizeof(int)); + memcpy(d + *off, &i, sizeof(int)); + (*off) += sizeof(int); + + return d; +} + +static void +restore_int(unsigned int *i, const unsigned char *d, int *off) +{ + memcpy(i, d + *off, sizeof(int)); + (*off) += sizeof(int); +} + +static unsigned char * +dump_char(char *c, unsigned char *d, int *off) +{ + unsigned int size; + + if (c == NULL) { + size = 0; + d = dump_int(size, d, off); + return d; + } + + size = mutt_strlen(c) + 1; + d = dump_int(size, d, off); + safe_realloc(&d, *off + size); + memcpy(d + *off, c, size); + *off += size; + + return d; +} + +static unsigned char * +dump_char_size(char *c, unsigned char *d, int *off, ssize_t size) +{ + if (c == NULL) { + size = 0; + d = dump_int(size, d, off); + return d; + } + + d = dump_int(size, d, off); + safe_realloc(&d, *off + size); + memcpy(d + *off, c, size); + *off += size; + + return d; +} + +static void +restore_char(char **c, const unsigned char *d, int *off) +{ + unsigned int size; + restore_int(&size, d, off); + + if (size == 0) { + *c = NULL; + return; + } + + *c = safe_malloc(size); + memcpy(*c, d + *off, size); + *off += size; +} + +static unsigned char * +dump_address(ADDRESS *a, unsigned char *d, int *off) +{ + unsigned int counter = 0; + unsigned int start_off = *off; + + d = dump_int(0xdeadbeef, d, off); + + while (a) { +#ifdef EXACT_ADDRESS + d = dump_char(a->val, d, off); +#endif + d = dump_char(a->personal, d, off); + d = dump_char(a->mailbox, d, off); + d = dump_int(a->group, d, off); + a = a->next; + counter++; + } + + memcpy(d + start_off, &counter, sizeof(int)); + + return d; +} + +static void +restore_address(ADDRESS **a, const unsigned char *d, int *off) +{ + unsigned int counter; + + restore_int(&counter, d, off); + + while (counter) { + *a = safe_malloc(sizeof(ADDRESS)); +#ifdef EXACT_ADDRESS + restore_char(&(*a)->val, d, off); +#endif + restore_char(&(*a)->personal, d, off); + restore_char(&(*a)->mailbox, d, off); + restore_int((unsigned int *)&(*a)->group, d, off); + a = &(*a)->next; + counter--; + } + + *a = NULL; +} + +static unsigned char * +dump_list(LIST *l, unsigned char *d, int *off) +{ + unsigned int counter = 0; + unsigned int start_off = *off; + + d = dump_int(0xdeadbeef, d, off); + + while (l) { + d = dump_char(l->data, d, off); + l = l->next; + counter++; + } + + memcpy(d + start_off, &counter, sizeof(int)); + + return d; +} + +static void +restore_list(LIST **l, const unsigned char *d, int *off) +{ + unsigned int counter; + + restore_int(&counter, d, off); + + while (counter) { + *l = safe_malloc(sizeof(LIST)); + restore_char(&(*l)->data, d, off); + l = &(*l)->next; + counter--; + } + + *l = NULL; +} + +static unsigned char * +dump_buffer(BUFFER *b, unsigned char *d, int *off) +{ + if (! b) { + d = dump_int(0, d, off); + return d; + } else { + d = dump_int(1, d, off); + } + + d = dump_char_size(b->data, d, off, b->dsize + 1); + d = dump_int(b->dptr - b->data, d, off); + d = dump_int(b->dsize, d, off); + d = dump_int(b->destroy, d, off); + + return d; +} + +static void +restore_buffer(BUFFER **b, const unsigned char *d, int *off) +{ + unsigned int used; + unsigned int offset; + restore_int(&used, d, off); + if (! used) { + return; + } + + *b = safe_malloc(sizeof(BUFFER)); + + restore_char(& (*b)->data, d, off); + restore_int(& offset, d, off); + (*b)->dptr = (*b)->data + offset; + restore_int(& (*b)->dsize, d, off); + restore_int((unsigned int *) & (*b)->destroy, d, off); +} + +static unsigned char * +dump_parameter(PARAMETER *p, unsigned char *d, int *off) +{ + unsigned int counter = 0; + unsigned int start_off = *off; + + d = dump_int(0xdeadbeef, d, off); + + while (p) { + d = dump_char(p->attribute, d, off); + d = dump_char(p->value, d, off); + p = p->next; + counter++; + } + + memcpy(d + start_off, &counter, sizeof(int)); + + return d; +} + +static void +restore_parameter(PARAMETER **p, const unsigned char *d, int *off) +{ + unsigned int counter; + + restore_int(&counter, d, off); + + while (counter) { + *p = safe_malloc(sizeof(PARAMETER)); + restore_char(&(*p)->attribute, d, off); + restore_char(&(*p)->value, d, off); + p = &(*p)->next; + counter--; + } + + *p = NULL; +} + +static unsigned char * +dump_body(BODY *c, unsigned char *d, int *off) +{ + safe_realloc(&d, *off + sizeof(BODY)); + memcpy(d + *off, c, sizeof(BODY)); + *off += sizeof(BODY); + + d = dump_char(c->xtype, d, off); + d = dump_char(c->subtype, d, off); + + d = dump_parameter(c->parameter, d, off); + + d = dump_char(c->description, d, off); + d = dump_char(c->form_name, d, off); + d = dump_char(c->filename, d, off); + d = dump_char(c->d_filename, d, off); + + return d; +} + +static void +restore_body(BODY *c, const unsigned char *d, int *off) +{ + memcpy(c, d + *off, sizeof(BODY)); + *off += sizeof(BODY); + + restore_char(& c->xtype, d, off); + restore_char(& c->subtype, d, off); + + restore_parameter(& c->parameter, d, off); + + restore_char(& c->description, d, off); + restore_char(& c->form_name, d, off); + restore_char(& c->filename, d, off); + restore_char(& c->d_filename, d, off); +} + +static unsigned char * +dump_envelope(ENVELOPE *e, unsigned char *d, int *off) +{ + d = dump_address(e->return_path, d, off); + d = dump_address(e->from, d, off); + d = dump_address(e->to, d, off); + d = dump_address(e->cc, d, off); + d = dump_address(e->bcc, d, off); + d = dump_address(e->sender, d, off); + d = dump_address(e->reply_to, d, off); + d = dump_address(e->mail_followup_to, d, off); + + d = dump_char(e->subject, d, off); + if (e->real_subj) { + d = dump_int(e->real_subj - e->subject, d, off); + } else { + d = dump_int(-1, d, off); + } + d = dump_char(e->message_id, d, off); + d = dump_char(e->supersedes, d, off); + d = dump_char(e->date, d, off); + d = dump_char(e->x_label, d, off); + + d = dump_list(e->references, d, off); + d = dump_list(e->in_reply_to, d, off); + d = dump_list(e->userhdrs, d, off); + + return d; +} + +static void +restore_envelope(ENVELOPE *e, const unsigned char *d, int *off) +{ + int real_subj_off; + + restore_address(& e->return_path, d, off); + restore_address(& e->from, d, off); + restore_address(& e->to, d, off); + restore_address(& e->cc, d, off); + restore_address(& e->bcc, d, off); + restore_address(& e->sender, d, off); + restore_address(& e->reply_to, d, off); + restore_address(& e->mail_followup_to, d, off); + + restore_char(& e->subject, d, off); + restore_int((unsigned int *) (& real_subj_off), d, off); + if (0 <= real_subj_off) { + e->real_subj = e->subject + real_subj_off; + } else { + e->real_subj = NULL; + } + restore_char(& e->message_id, d, off); + restore_char(& e->supersedes, d, off); + restore_char(& e->date, d, off); + restore_char(& e->x_label, d, off); + + restore_list(& e->references, d, off); + restore_list(& e->in_reply_to, d, off); + restore_list(& e->userhdrs, d, off); +} + +static +unsigned int crc32(unsigned int crc, unsigned char const *p, size_t len) +{ + int i; + while (len--) { + crc ^= *p++; + for (i = 0; i < 8; i++) + crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); + } + return crc; +} + +static int +generate_crc32() +{ + int crc = 0; + -+ crc = crc32(crc, (unsigned char const *) "HCACHE V1", mutt_strlen("HCACHE V1")); ++ crc = crc32(crc, (unsigned char const *) "sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20040826203315|26242", mutt_strlen("sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20040826203315|26242")); + +#if HAVE_LANGINFO_CODESET + crc = crc32(crc, (unsigned char const *) Charset, mutt_strlen(Charset)); + crc = crc32(crc, (unsigned char const *) "HAVE_LANGINFO_CODESET", mutt_strlen("HAVE_LANGINFO_CODESET")); +#endif + +#if EXACT_ADDRESS + crc = crc32(crc, (unsigned char const *) "EXACT_ADDRESS", mutt_strlen("EXACT_ADDRESS")); +#endif + return crc; +} + +static int +crc32_matches(const char *d, unsigned int crc) +{ + int off = sizeof(validate); + unsigned int mycrc = 0; + + if (! d) { + return 0; + } + + restore_int(&mycrc, (unsigned char *) d, &off); + + return (crc == mycrc); +} + +/* This function transforms a header into a char so that it is useable by + * db_store */ +static void * +mutt_hcache_dump(void *_db, HEADER *h, int *off, unsigned long long uid_validity) +{ + struct header_cache *db = _db; + unsigned char *d = NULL; + *off = 0; + + d = safe_malloc(sizeof(validate)); + + if (uid_validity) { + memcpy(d, &uid_validity, sizeof(long long)); + } else { + struct timeval now; + gettimeofday(&now, NULL); + memcpy(d, &now, sizeof(struct timeval)); + } + *off += sizeof(validate); + + d = dump_int(db->crc, d, off); + + safe_realloc(&d, *off + sizeof(HEADER)); + memcpy(d + *off, h, sizeof(HEADER)); + *off += sizeof(HEADER); + + d = dump_envelope(h->env, d, off); + d = dump_body(h->content, d, off); + d = dump_char(h->maildir_flags, d, off); + + return d; +} + +HEADER * +mutt_hcache_restore(const unsigned char *d, HEADER **oh) +{ + int off = 0; + HEADER *h = mutt_new_header(); + + /* skip validate */ + off += sizeof(validate); + + /* skip crc */ + off += sizeof(unsigned int); + + memcpy(h, d + off, sizeof(HEADER)); + off += sizeof(HEADER); + + h->env = mutt_new_envelope(); + restore_envelope(h->env, d, &off); + + h->content = mutt_new_body(); + restore_body(h->content, d, &off); + + restore_char(&h->maildir_flags, d, &off); + + /* this is needed for maildir style mailboxes */ + if (oh) { + h->old = (*oh)->old; + h->path = safe_strdup((*oh)->path); + mutt_free_header (oh); + } + + return h; +} + +#if HAVE_GDBM + +void * +mutt_hcache_open(const char *path, const char *folder) +{ + struct header_cache *h = safe_calloc(1, sizeof(HEADER_CACHE)); + h->db = NULL; + h->folder = safe_strdup (folder); + h->crc = generate_crc32(); + ++ int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384; ++ + if (! path || path[0] == '\0') { + FREE(& h->folder); + FREE(& h); + return NULL; + } + -+ h->db = gdbm_open((char *) path, (int) HeaderCachePageSize, GDBM_WRCREAT, 00600, NULL); ++ h->db = gdbm_open((char *) path, pagesize, GDBM_WRCREAT, 00600, NULL); + if (h->db) { + return h; + } + + /* if rw failed try ro */ -+ h->db = gdbm_open((char *) path, (int) HeaderCachePageSize, GDBM_READER, 00600, NULL); ++ h->db = gdbm_open((char *) path, pagesize, GDBM_READER, 00600, NULL); + if(h->db) { + return h; + } else { + FREE(& h->folder); + FREE(& h); + + return NULL; + } +} + +void +mutt_hcache_close(void *db) +{ + struct header_cache *h = db; + + if (! h) { + return; + } + + gdbm_close(h->db); + FREE(& h->folder); + FREE(& h); +} + +void * +mutt_hcache_fetch(void *db, const char *filename, size_t (*keylen)(const char *fn)) +{ + struct header_cache *h = db; + datum key; + datum data; + char path[_POSIX_PATH_MAX]; + + if (! h) { + return NULL; + } + + strncpy(path, h->folder, sizeof(path)); + strncat(path, filename, sizeof(path) - mutt_strlen(path)); + + key.dptr = path; + key.dsize = keylen(path); + + data = gdbm_fetch(h->db, key); + + if (! crc32_matches(data.dptr, h->crc)) { + free(data.dptr); + return NULL; + } + + return data.dptr; +} + +int +mutt_hcache_store(void *db, const char *filename, HEADER *header, unsigned long long uid_validity, size_t (*keylen)(const char *fn)) +{ + struct header_cache *h = db; + datum key; + datum data; + char path[_POSIX_PATH_MAX]; + int ret; + + if (! h) { + return -1; + } + + strncpy(path, h->folder, sizeof(path)); + strncat(path, filename, sizeof(path) - mutt_strlen(path)); + + key.dptr = path; + key.dsize = keylen(path); + -+ data.dptr = mutt_hcache_dump(db, header, &data.dsize, uid_validity); ++ data.dptr = mutt_hcache_dump(db, header, &data.dsize, uid_validity); + + ret = gdbm_store(h->db, key, data, GDBM_REPLACE); + + FREE(& data.dptr); + + return ret; +} + +int +mutt_hcache_delete(void *db, const char *filename, size_t (*keylen)(const char *fn)) +{ + datum key; + struct header_cache *h = db; + char path[_POSIX_PATH_MAX]; + + if (! h) { + return -1; + } + + strncpy(path, h->folder, sizeof(path)); + strncat(path, filename, sizeof(path) - mutt_strlen(path)); + + key.dptr = path; + key.dsize = keylen(path); + + return gdbm_delete(h->db, key); +} +#elif HAVE_DB4 + +static void +mutt_hcache_dbt_init(DBT *dbt, void *data, size_t len) +{ + dbt->data = data; + dbt->size = dbt->ulen = len; + dbt->dlen = dbt->doff = 0; + dbt->flags = DB_DBT_USERMEM; +} + +static void +mutt_hcache_dbt_empty_init(DBT *dbt) +{ + dbt->data = NULL; + dbt->size = dbt->ulen = dbt->dlen = dbt->doff = 0; + dbt->flags = 0; +} + +void * +mutt_hcache_open(const char *path, const char *folder) +{ + struct stat sb; + u_int32_t createflags = DB_CREATE; + int ret; + struct header_cache *h = calloc(1, sizeof(HEADER_CACHE)); ++ int pagesize = atoi(HeaderCachePageSize); + ++ + h->crc = generate_crc32(); + + if (! path || path[0] == '\0') { + FREE(& h); + return NULL; + } + + snprintf (h->lockfile, _POSIX_PATH_MAX, "%s-lock-hack", path); + + h->fd = open(h->lockfile, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); + if (h->fd < 0) { + FREE (&h); + return NULL; + } + + if (mx_lock_file(h->lockfile, h->fd, 1, 0, 5)) { + close(h->fd); + FREE (&h); + return NULL; + } + + ret = db_env_create(&h->env, 0); + if (ret) { + mx_unlock_file(h->lockfile, h->fd, 0); + FREE(& h); + return NULL; + } + + ret = h->env->open(h->env, NULL, DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE, 0600); + if (! ret) { + ret = db_create(&h->db, h->env, 0); + if (ret) { + h->env->close(h->env, 0); + mx_unlock_file(h->lockfile, h->fd, 0); + FREE(& h); + return NULL; + } + } + + if (stat(path, &sb) != 0 && errno == ENOENT) { + createflags |= DB_EXCL; -+ h->db->set_pagesize(h->db, (int) HeaderCachePageSize); ++ h->db->set_pagesize(h->db, pagesize); + } + + ret = h->db->open(h->db, NULL, path, folder, DB_BTREE, createflags, 0600); + if (ret) { + h->db->close(h->db, 0); + h->env->close(h->env, 0); + mx_unlock_file(h->lockfile, h->fd, 0); + FREE(& h); + return NULL; + } + + return h; +} + +void +mutt_hcache_close(void *db) +{ + struct header_cache *h = db; + int ret; + + if (! h) { + return; + } + + h->db->close(h->db, 0); + h->env->close(h->env, 0); + mx_unlock_file(h->lockfile, h->fd, 0); + FREE(& h); +} + +void * +mutt_hcache_fetch(void *db, const char *filename, size_t (*keylen)(const char *fn)) +{ + DBT key; + DBT data; + struct header_cache *h = db; + + if (! h) { + return NULL; + } + + filename++; /* skip '/' */ + + mutt_hcache_dbt_init(&key, (void *) filename, keylen(filename)); + mutt_hcache_dbt_empty_init(&data); + data.flags = DB_DBT_MALLOC; + + h->db->get(h->db, NULL, &key, &data, 0); + + if (! crc32_matches(data.data, h->crc)) { + free(data.data); + return NULL; + } + + return data.data; +} + +int +mutt_hcache_store(void *db, const char *filename, HEADER *header, unsigned long long uid_validity, size_t (*keylen)(const char *fn)) +{ + DBT key; + DBT data; + int ret; + struct header_cache *h = db; + + if (! h) { + return -1; + } + + filename++; /* skip '/' */ + + mutt_hcache_dbt_init(&key, (void *) filename, keylen(filename)); + + mutt_hcache_dbt_empty_init(&data); + data.flags = DB_DBT_USERMEM; -+ data.data = mutt_hcache_dump(db, header, (signed int *) &data.size, uid_validity); ++ data.data = mutt_hcache_dump(db, header, (signed int *) &data.size, uid_validity); + data.ulen = data.size; + + ret = h->db->put(h->db, NULL, &key, &data, 0); + + FREE(& data.data); + + return ret; +} + +int +mutt_hcache_delete(void *db, const char *filename, size_t (*keylen)(const char *fn)) +{ + DBT key; + struct header_cache *h = db; + + if (! h) { + return -1; + } + + filename++; /* skip '/' */ + + mutt_hcache_dbt_init(&key, (void *) filename, keylen(filename)); + return h->db->del(h->db, NULL, &key, 0); +} +#endif diff -Nru a/imap/imap.c b/imap/imap.c ---- a/imap/imap.c 2004-08-18 10:08:12 +02:00 -+++ b/imap/imap.c 2004-08-18 10:08:12 +02:00 +--- a/imap/imap.c 2004-08-18 09:43:27 +02:00 ++++ b/imap/imap.c 2004-08-17 00:34:10 +02:00 @@ -602,6 +602,17 @@ if ((pc = imap_get_flags (&(idata->flags), pc)) == NULL) goto fail; } +#ifdef USE_HCACHE + /* save UIDVALIDITY for the header cache */ + else if (ascii_strncasecmp("OK [UIDVALIDITY", pc, 14) == 0) + { + dprint(2, (debugfile, "Getting mailbox UIDVALIDITY\n")); + pc += 3; + pc = imap_next_word(pc); + + sscanf(pc, "%u", &(idata->uid_validity)); + } +#endif else { pc = imap_next_word (pc); diff -Nru a/imap/imap_private.h b/imap/imap_private.h ---- a/imap/imap_private.h 2004-08-18 10:08:12 +02:00 -+++ b/imap/imap_private.h 2004-08-18 10:08:12 +02:00 +--- a/imap/imap_private.h 2004-08-18 09:43:27 +02:00 ++++ b/imap/imap_private.h 2004-07-24 12:39:31 +02:00 @@ -179,6 +179,9 @@ unsigned int newMailCount; IMAP_CACHE cache[IMAP_CACHE_LEN]; int noclose : 1; +#ifdef USE_HCACHE + unsigned long long uid_validity; +#endif /* all folder flags - system flags AND keywords */ LIST *flags; diff -Nru a/imap/message.c b/imap/message.c ---- a/imap/message.c 2004-08-18 10:08:12 +02:00 -+++ b/imap/message.c 2004-08-18 10:08:12 +02:00 +--- a/imap/message.c 2004-08-18 09:43:27 +02:00 ++++ b/imap/message.c 2004-08-06 02:09:41 +02:00 @@ -39,6 +39,12 @@ static int msg_parse_fetch (IMAP_HEADER* h, char* s); static char* msg_parse_flags (IMAP_HEADER* h, char* s); +#if USE_HCACHE +static int msg_fetch_header_fetch (CONTEXT* ctx, IMAP_HEADER* h, char* buf, + FILE* fp); +static size_t imap_hcache_keylen (const char *fn); +#endif /* USE_HCACHE */ + /* imap_read_headers: * Changed to read many headers instead of just one. It will return the * msgno of the last message read. It will return a value other than @@ -57,8 +63,18 @@ int fetchlast = 0; const char *want_headers = "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO REPLY-TO LINES X-LABEL"; +#if USE_HCACHE + void *hc = NULL; + unsigned long long *uid_validity = NULL; + char uid_buf[64]; +#endif /* USE_HCACHE */ + ctx = idata->ctx; +#if USE_HCACHE + hc = mutt_hcache_open (HeaderCache, ctx->path); +#endif /* USE_HCACHE */ + if (mutt_bit_isset (idata->capabilities,IMAP4REV1)) { snprintf (hdrreq, sizeof (hdrreq), "BODY.PEEK[HEADER.FIELDS (%s)]", @@ -73,6 +89,9 @@ { /* Unable to fetch headers for lower versions */ mutt_error _("Unable to fetch headers from this IMAP server version."); mutt_sleep (2); /* pause a moment to let the user see the error */ +#if USE_HCACHE + mutt_hcache_close (hc); +#endif /* USE_HCACHE */ return -1; } @@ -83,6 +102,9 @@ { mutt_error (_("Could not create temporary file %s"), tempfile); mutt_sleep (2); +#if USE_HCACHE + mutt_hcache_close (hc); +#endif /* USE_HCACHE */ return -1; } unlink (tempfile); @@ -95,14 +117,88 @@ idata->reopen &= ~IMAP_NEWMAIL_PENDING; idata->newMailCount = 0; +#if USE_HCACHE + snprintf (buf, sizeof (buf), + "FETCH %d:%d (UID FLAGS)", msgbegin + 1, msgend + 1); + fetchlast = msgend + 1; + + imap_cmd_start (idata, buf); + + for (msgno = msgbegin; msgno <= msgend ; msgno++) + { + if (ReadInc && (!msgno || ((msgno+1) % ReadInc == 0))) + mutt_message (_("Evaluating cache... [%d/%d]"), msgno + 1, + msgend + 1); + + rewind (fp); + memset (&h, 0, sizeof (h)); + h.data = safe_calloc (1, sizeof (IMAP_HEADER_DATA)); + do + { + mfhrc = 0; + + rc = imap_cmd_step (idata); + if (rc != IMAP_CMD_CONTINUE) + break; + + if ((mfhrc = msg_fetch_header_fetch (idata->ctx, &h, idata->cmd.buf, fp)) == -1) + continue; + else if (mfhrc < 0) + break; + + /* make sure we don't get remnants from older larger message headers */ + fputs ("\n\n", fp); + + sprintf(uid_buf, "/%u", h.data->uid); /* XXX --tg 21:41 04-07-11 */ + uid_validity = (unsigned long long *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen); + + if (uid_validity != NULL + && *uid_validity == idata->uid_validity) { + ctx->hdrs[msgno] = mutt_hcache_restore((unsigned char *) uid_validity, 0); + ctx->hdrs[msgno]->index = h.sid - 1; + if (h.sid != ctx->msgcount + 1) + dprint (1, (debugfile, "imap_read_headers: msgcount and sequence ID are inconsistent!")); + /* messages which have not been expunged are ACTIVE (borrowed from mh + * folders) */ + ctx->hdrs[msgno]->active = 1; + ctx->hdrs[msgno]->read = h.read; + ctx->hdrs[msgno]->old = h.old; + ctx->hdrs[msgno]->deleted = h.deleted; + ctx->hdrs[msgno]->flagged = h.flagged; + ctx->hdrs[msgno]->replied = h.replied; + ctx->hdrs[msgno]->changed = h.changed; + /* ctx->hdrs[msgno]->received is restored from mutt_hcache_restore */ + ctx->hdrs[msgno]->data = (void *) (h.data); + + ctx->msgcount++; + } + rewind (fp); + + FREE(&uid_validity); + + } + while ((rc != IMAP_CMD_OK) && ((mfhrc == -1) || + ((msgno + 1) >= fetchlast))); + } + + fetchlast = msgbegin; +#endif /* USE_HCACHE */ + for (msgno = msgbegin; msgno <= msgend ; msgno++) { if (ReadInc && (!msgno || ((msgno+1) % ReadInc == 0))) mutt_message (_("Fetching message headers... [%d/%d]"), msgno + 1, msgend + 1); + if (ctx->hdrs[msgno]) + continue; + if (msgno + 1 > fetchlast) { + fetchlast = msgno + 1; + while((fetchlast <= msgend) && (! ctx->hdrs[fetchlast])) + fetchlast++; + /* * Make one request for everything. This makes fetching headers an * order of magnitude faster if you have a large mailbox. @@ -112,11 +208,9 @@ */ snprintf (buf, sizeof (buf), "FETCH %d:%d (UID FLAGS INTERNALDATE RFC822.SIZE %s)", msgno + 1, - msgend + 1, hdrreq); + fetchlast, hdrreq); imap_cmd_start (idata, buf); - - fetchlast = msgend + 1; } /* freshen fp, h */ @@ -170,6 +264,11 @@ /* content built as a side-effect of mutt_read_rfc822_header */ ctx->hdrs[msgno]->content->length = h.content_length; +#if USE_HCACHE + sprintf(uid_buf, "/%u", h.data->uid); + mutt_hcache_store(hc, uid_buf, ctx->hdrs[msgno], idata->uid_validity, &imap_hcache_keylen); +#endif /* USE_HCACHE */ + ctx->msgcount++; } while ((rc != IMAP_CMD_OK) && ((mfhrc == -1) || @@ -179,7 +278,9 @@ { imap_free_header_data ((void**) &h.data); fclose (fp); - +#if USE_HCACHE + mutt_hcache_close (hc); +#endif /* USE_HCACHE */ return -1; } @@ -194,6 +295,10 @@ } } +#if USE_HCACHE + mutt_hcache_close (hc); +#endif /* USE_HCACHE */ + fclose(fp); if (ctx->msgcount > oldmsgcount) @@ -724,6 +829,7 @@ return s; } + /* msg_fetch_header: import IMAP FETCH response into an IMAP_HEADER. * Expects string beginning with * n FETCH. * Returns: @@ -782,6 +888,56 @@ return rc; } + +#if USE_HCACHE +static size_t imap_hcache_keylen (const char *fn) +{ + return mutt_strlen(fn); +} + +/* msg_fetch_header: import IMAP FETCH response into an IMAP_HEADER. + * Expects string beginning with * n FETCH. + * Returns: + * 0 on success + * -1 if the string is not a fetch response + * -2 if the string is a corrupt fetch response */ +static int msg_fetch_header_fetch (CONTEXT* ctx, IMAP_HEADER* h, char* buf, FILE* fp) +{ + IMAP_DATA* idata; + long bytes; + int rc = -1; /* default now is that string isn't FETCH response*/ + + idata = (IMAP_DATA*) ctx->data; + + if (buf[0] != '*') + return rc; + + /* skip to message number */ + buf = imap_next_word (buf); + h->sid = atoi (buf); + + /* find FETCH tag */ + buf = imap_next_word (buf); + if (ascii_strncasecmp ("FETCH", buf, 5)) + return rc; + + rc = -2; /* we've got a FETCH response, for better or worse */ + if (!(buf = strchr (buf, '('))) + return rc; + buf++; + + if (msg_parse_fetch (h, buf) < 0) { + return -2; + } + + if (!(buf = strchr (buf, ')'))) + return rc; + buf++; + + return 0; +} +#endif /* USE_HCACHE */ + /* msg_has_flag: do a caseless comparison of the flag against a flag list, * return 1 if found or flag list has '\*', 0 otherwise */ diff -Nru a/init.h b/init.h ---- a/init.h 2004-08-18 10:08:12 +02:00 -+++ b/init.h 2004-08-18 10:08:12 +02:00 -@@ -981,6 +981,30 @@ +--- a/init.h 2004-08-18 09:43:12 +02:00 ++++ b/init.h 2004-08-26 22:32:53 +02:00 +@@ -981,6 +981,31 @@ ** \fBDON'T CHANGE THIS SETTING UNLESS YOU ARE REALLY SURE WHAT YOU ARE ** DOING!\fP */ +#if USE_HCACHE + + { "header_cache", DT_PATH, R_NONE, UL &HeaderCache, 0 }, + /* + ** .pp + ** Path to the header cache file. If unset no cache will be used. Otherwise + ** the cache will be enabled for Maildir and IMAP mailboxes. + */ + { "maildir_header_cache_verify", DT_BOOL, R_NONE, OPTHCACHEVERIFY, 1 }, + /* + ** .pp + ** Check for Maildir unaware programs other than mutt having modified maildir + ** files when the header cache is in use. This incurs one stat(2) per + ** message every time the folder is opened. + */ -+ { "header_cache_pagesize", DT_NUM, R_NONE, UL &HeaderCachePageSize, 16384 }, ++ { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" }, + /* + ** .pp + ** Change the maildir header cache database page size. Too large + ** or too small of a page size for the common header can waste -+ ** space, memory effectiveness, or CPU time. You can use the -+ ** db_dump utility to determine the optimal page size. ++ ** space, memory effectiveness, or CPU time. The default should be more or ++ ** less the best you can get. For details google after mutt maildir header ++ ** cache (first hit). + */ +#endif /* USE_HCACHE */ { "maildir_trash", DT_BOOL, R_NONE, OPTMAILDIRTRASH, 0 }, /* ** .pp diff -Nru a/main.c b/main.c ---- a/main.c 2004-08-18 10:08:12 +02:00 -+++ b/main.c 2004-08-18 10:08:12 +02:00 +--- a/main.c 2004-08-18 09:43:12 +02:00 ++++ b/main.c 2004-07-24 12:39:30 +02:00 @@ -411,6 +411,12 @@ "-HAVE_GETADDRINFO " #endif +#if USE_HCACHE + "+USE_HCACHE " +#else + "-USE_HCACHE " +#endif + ); #ifdef ISPELL diff -Nru a/mh.c b/mh.c ---- a/mh.c 2004-08-18 10:08:12 +02:00 -+++ b/mh.c 2004-08-18 10:08:12 +02:00 +--- a/mh.c 2004-08-18 09:43:13 +02:00 ++++ b/mh.c 2004-07-26 09:37:28 +02:00 @@ -779,11 +779,68 @@ return r; } +#if USE_HCACHE + +static size_t maildir_hcache_keylen (const char *fn) +{ + const char * p = strchr (fn, ':'); + return p ? (size_t) (p - fn) : mutt_strlen(fn); +} + /* * This function does the second parsing pass for a maildir-style * folder. */ +void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md) +{ + struct maildir *p; + void *hc = NULL; + char fn[_POSIX_PATH_MAX]; + void *data; + unsigned int size; + struct timeval *when = NULL; + struct stat lastchanged; + int ret; + + hc = mutt_hcache_open (HeaderCache, ctx->path); + + for (p = md; p; p = p->next) { + if (! (p && p->h && !p->header_parsed)) { + continue; + } + + data = mutt_hcache_fetch (hc, p->h->path + 3, &maildir_hcache_keylen); + when = (struct timeval *) data; + + snprintf(fn, sizeof (fn), "%s/%s", ctx->path, p->h->path); + + if (option(OPTHCACHEVERIFY)) { + ret = stat(fn, &lastchanged); + } else { + lastchanged.st_mtime = 0; + ret = 0; + } + + if (data != NULL + && ret == 0 + && lastchanged.st_mtime <= when->tv_sec) { + p->h = mutt_hcache_restore ((unsigned char *)data, &p->h); + maildir_parse_flags (p->h, fn); + + } else if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) { + maildir_parse_flags(p->h, fn); + p->header_parsed = 1; + mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen); + } else { + mutt_free_header (&p->h); + } + FREE(&data); + } + mutt_hcache_close (hc); +} + +#else /* USE_HCACHE */ void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md) { @@ -801,7 +858,7 @@ } } - +#endif /* USE_HCACHE */ /* Read a MH/maildir style mailbox. * @@ -1293,6 +1350,9 @@ { char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX]; int i, j; +#if USE_HCACHE + void *hc = NULL; +#endif /* USE_HCACHE */ if (ctx->magic == M_MH) i = mh_check_mailbox (ctx, index_hint); @@ -1302,6 +1362,11 @@ if (i != 0) return i; +#if USE_HCACHE + if (ctx->magic == M_MAILDIR) + hc = mutt_hcache_open(HeaderCache, ctx->path); +#endif /* USE_HCACHE */ + for (i = 0; i < ctx->msgcount; i++) { if (ctx->hdrs[i]->deleted @@ -1310,7 +1375,13 @@ snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path); if (ctx->magic == M_MAILDIR || (option (OPTMHPURGE) && ctx->magic == M_MH)) + { +#if USE_HCACHE + if (ctx->magic == M_MAILDIR) + mutt_hcache_delete (hc, ctx->hdrs[i]->path + 3, &maildir_hcache_keylen); +#endif /* USE_HCACHE */ unlink (path); + } else if (ctx->magic == M_MH) { /* MH just moves files out of the way when you delete them */ @@ -1332,16 +1403,21 @@ if (ctx->magic == M_MAILDIR) { if (maildir_sync_message (ctx, i) == -1) - return -1; + goto err; } else { if (mh_sync_message (ctx, i) == -1) - return -1; + goto err; } } } +#if USE_HCACHE + if (ctx->magic == M_MAILDIR) + mutt_hcache_close (hc); +#endif /* USE_HCACHE */ + if (ctx->magic == M_MH) mh_update_sequences (ctx); @@ -1362,6 +1438,13 @@ } return 0; + +err: +#if USE_HCACHE + if (ctx->magic == M_MAILDIR) + mutt_hcache_close (hc); +#endif /* USE_HCACHE */ + return -1; } static char *maildir_canon_filename (char *dest, const char *src, size_t l) diff -Nru a/mutt.h b/mutt.h ---- a/mutt.h 2004-08-18 10:08:12 +02:00 -+++ b/mutt.h 2004-08-18 10:08:12 +02:00 +--- a/mutt.h 2004-08-18 09:43:13 +02:00 ++++ b/mutt.h 2004-07-24 12:39:30 +02:00 @@ -345,6 +345,9 @@ OPTFORCENAME, OPTFORWDECODE, OPTFORWQUOTE, +#if USE_HCACHE + OPTHCACHEVERIFY, +#endif OPTHDRS, OPTHEADER, OPTHELP, diff -Nru a/protos.h b/protos.h ---- a/protos.h 2004-08-18 10:08:12 +02:00 -+++ b/protos.h 2004-08-18 10:08:12 +02:00 +--- a/protos.h 2004-08-18 09:43:16 +02:00 ++++ b/protos.h 2004-08-09 08:05:48 +02:00 @@ -99,6 +99,16 @@ ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *, short, short); HEADER *mutt_dup_header (HEADER *); +#if USE_HCACHE +void *mutt_hcache_open(const char *path, const char *folder); +void mutt_hcache_close(void *db); +HEADER *mutt_hcache_restore(const unsigned char *d, HEADER **oh); +void *mutt_hcache_fetch(void *db, const char *filename, size_t (*keylen)(const char *fn)); +int mutt_hcache_store(void *db, const char *filename, HEADER *h, unsigned long long uid_validity, size_t (*keylen)(const char *fn)); +int mutt_hcache_delete(void *db, const char *filename, size_t (*keylen)(const char *fn)); +#endif /* USE_HCACHE */ + + ATTACHPTR **mutt_gen_attach_list (BODY *, int, ATTACHPTR **, short *, short *, int, int); time_t mutt_decrease_mtime (const char *, struct stat *); ---- PATCHES.orig Tue Nov 6 19:59:33 2001 -+++ PATCHES Tue Nov 6 19:59:42 2001 -@@ -1,0 +1 @@ -+patch-1.5.6.tg.hcache.0 Property changes on: head/mail/mutt-devel/files/extra-patch-maildir-header-cache ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.4 \ No newline at end of property +1.5 \ No newline at end of property Index: head/mail/mutt-devel/files/patch-doc-manual.sgml.head =================================================================== --- head/mail/mutt-devel/files/patch-doc-manual.sgml.head (nonexistent) +++ head/mail/mutt-devel/files/patch-doc-manual.sgml.head (revision 117567) @@ -0,0 +1,111 @@ +--- doc/manual.sgml.head.orig Sun Feb 1 18:49:53 2004 ++++ doc/manual.sgml.head Wed Aug 25 14:02:33 2004 +@@ -125,24 +125,24 @@ + + ^A or bol move to the start of the line + ^B or backward-char move back one char +-Esc B backward-word move back one word ++Esc B backward-word move back one word + ^D or delete-char delete the char under the cursor + ^E or eol move to the end of the line + ^F or forward-char move forward one char +-Esc F forward-word move forward one word ++Esc F forward-word move forward one word + complete complete filename or alias + ^T complete-query complete address with query + ^K kill-eol delete to the end of the line +-ESC d kill-eow delete to the end ot the word ++ESC d kill-eow delete to the end ot the word + ^W kill-word kill the word in front of the cursor + ^U kill-line delete entire line + ^V quote-char quote the next typed key + history-up recall previous string from history + history-down recall next string from history + backspace kill the char in front of the cursor +-Esc u upcase-word convert word to upper case +-Esc l downcase-word convert word to lower case +-Esc c capitalize-word capitalize the word ++Esc u upcase-word convert word to upper case ++Esc l downcase-word convert word to lower case ++Esc c capitalize-word capitalize the word + ^G n/a abort + n/a finish editing + +@@ -325,8 +325,8 @@ + ESC p previous-subthread jump to the start of the previous subthread + ESC r read-subthread mark the current subthread as read + ESC t tag-thread toggle the tag on the current thread +-ESC v collapse-thread toggle collapse for the current thread +-ESC V collapse-all toggle collapse for all threads ++ESC v collapse-thread toggle collapse for the current thread ++ESC V collapse-all toggle collapse for all threads + P parent-message jump to parent message in thread + + +@@ -513,7 +513,7 @@ + + + a attach-file attach a file +-A attach-message attach message(s) to the message ++A attach-message attach message(s) to the message + ESC k attach-key attach a PGP public key + d edit-description edit description on attachment + D detach-file detach a file +@@ -529,7 +529,7 @@ + p pgp-menu select PGP options + P postpone-message postpone this message until later + q quit quit (abort) sending the message +-w write-fcc write the message to a folder ++w write-fcc write the message to a folder + i ispell check spelling (if available on your system) + ^F forget-passphrase wipe passphrase(s) from memory + +@@ -1760,7 +1760,7 @@ + ~g cryptographically signed messages + ~G cryptographically encrypted messages + ~h EXPR messages which contain EXPR in the message header +-~k message contains PGP key material ++~k message contains PGP key material + ~i ID message which match ID in the ``Message-ID'' field + ~L EXPR message is either originated or received by EXPR + ~l message is addressed to a known mailing list +@@ -1778,12 +1778,12 @@ + ~T tagged messages + ~t USER messages addressed to USER + ~U unread messages +-~v message is part of a collapsed thread. +-~V cryptographically verified messages ++~v message is part of a collapsed thread. ++~V cryptographically verified messages + ~x EXPR messages which contain EXPR in the `References' field + ~y EXPR messages which contain EXPR in the `X-Label' field + ~z [MIN]-[MAX] messages with a size in the range MIN to MAX *) +-~= duplicated messages (see $duplicate_threads) ++~= duplicated messages (see $duplicate_threads) + + + Where EXPR, USER, ID, and SUBJECT are +@@ -1885,10 +1885,10 @@ + An error margin is a sign (+ or -), followed by a digit, followed by + one of the following units: + +-y years +-m months +-w weeks +-d days ++y years ++m months ++w weeks ++d days + + As a special case, you can replace the sign by a ``*'' character, + which is equivalent to giving identical plus and minus error margins. +@@ -2919,7 +2919,7 @@ + to send messages from the command line as well. + + +--A expand an alias ++-A expand an alias + -a attach a file to a message + -b specify a blind carbon-copy (BCC) address + -c specify a carbon-copy (Cc) address Property changes on: head/mail/mutt-devel/files/patch-doc-manual.sgml.head ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/mail/mutt-devel/files/patch-threadcomplete =================================================================== --- head/mail/mutt-devel/files/patch-threadcomplete (revision 117566) +++ head/mail/mutt-devel/files/patch-threadcomplete (revision 117567) @@ -1,73 +1,159 @@ -written by Nicolas Rachinsky -http://www.rachinsky.de - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published -by the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - ---- mutt-1.3.28.ori/mutt.h Thu Mar 14 19:22:25 2002 -+++ mutt.h Fri Mar 15 00:22:41 2002 -@@ -198,6 +198,7 @@ +diff -Nru a/PATCHES b/PATCHES +--- PATCHES 2004-07-24 12:27:17 +02:00 ++++ PATCHES 2004-08-22 02:01:52 +02:00 +@@ -0,0 +1 @@ ++patch-1.5.6.cb.thread_pattern.1 +diff -Nru a/doc/manual.sgml.head b/doc/manual.sgml.head +--- doc/manual.sgml.head 2004-07-24 12:27:29 +02:00 ++++ doc/manual.sgml.head 2004-08-25 14:54:08 +02:00 +@@ -1771,6 +1771,8 @@ + messages: + + ++~a messages in threads that contain at least one tagged message; ++ this is the same as ~(~T) [see below for ~(..)] + ~A all messages + ~b EXPR messages which contain EXPR in the message body + ~B EXPR messages which contain EXPR in the whole message +@@ -1809,6 +1811,8 @@ + ~y EXPR messages which contain EXPR in the `X-Label' field + ~z [MIN]-[MAX] messages with a size in the range MIN to MAX *) + ~= duplicated messages (see $duplicate_threads) ++~(PATTERN) messages in threads containing messages matching a certain ++ pattern, e.g. all threads containing messages from you: ~(~P) + + + Where EXPR, USER, ID, and SUBJECT are +diff -Nru a/mutt.h b/mutt.h +--- mutt.h 2004-07-24 12:27:21 +02:00 ++++ mutt.h 2004-08-25 14:04:40 +02:00 +@@ -207,10 +207,12 @@ M_LIMIT, M_EXPIRED, M_SUPERSEDED, + M_THREADCOMPLETE, /* actions for mutt_pattern_comp/mutt_pattern_exec */ M_AND, ---- pattern.c.orig Fri Jul 11 09:19:06 2003 -+++ pattern.c Fri Jul 11 09:23:17 2003 + M_OR, ++ M_THREAD, + M_TO, + M_CC, + M_COLLAPSED, +diff -Nru a/pattern.c b/pattern.c +--- pattern.c 2004-07-24 12:27:23 +02:00 ++++ pattern.c 2004-08-25 15:37:51 +02:00 @@ -44,6 +44,7 @@ } Flags[] = { + { 'a', M_THREADCOMPLETE, 0, NULL }, { 'A', M_ALL, 0, NULL }, { 'b', M_BODY, M_FULL_MSG, eat_regexp }, { 'B', M_WHOLE_MSG, M_FULL_MSG, eat_regexp }, -@@ -946,6 +947,27 @@ +@@ -700,7 +701,7 @@ + pattern_t *mutt_pattern_comp (/* const */ char *s, int flags, BUFFER *err) + { + pattern_t *curlist = NULL; +- pattern_t *tmp; ++ pattern_t *tmp, *tmp2; + pattern_t *last = NULL; + int not = 0; + int alladdr = 0; +@@ -755,6 +756,39 @@ + alladdr = 0; + break; + case '~': ++ if (*(ps.dptr + 1) == '(') { ++ ps.dptr ++; /* skip ~ */ ++ p = find_matching_paren (ps.dptr + 1); ++ if (*p != ')') ++ { ++ snprintf (err->data, err->dsize, _("mismatched brackets: %s"), ps.dptr); ++ mutt_pattern_free (&curlist); ++ return NULL; ++ } ++ tmp = new_pattern (); ++ tmp->op = M_THREAD; ++ if (last) ++ last->next = tmp; ++ else ++ curlist = tmp; ++ last = tmp; ++ tmp->not ^= not; ++ tmp->alladdr |= alladdr; ++ not = 0; ++ alladdr = 0; ++ /* compile the sub-expression */ ++ buf = mutt_substrdup (ps.dptr + 1, p); ++ if ((tmp2 = mutt_pattern_comp (buf, flags, err)) == NULL) ++ { ++ FREE (&buf); ++ mutt_pattern_free (&curlist); ++ return NULL; ++ } ++ FREE (&buf); ++ tmp->child = tmp2; ++ ps.dptr = p + 1; /* restore location */ ++ break; ++ } + if (implicit && or) + { + /* A | B & C == (A | B) & C */ +@@ -945,6 +979,30 @@ return alladdr; } -+static int match_threadcomplete(int flag,THREAD *t,int left,int up,int right,int down) ++static int match_threadcomplete(struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx, THREAD *t,int left,int up,int right,int down) +{ -+ int a=0; -+ HEADER *h=NULL; ++ int a; ++ HEADER *h; + -+ if(! t)return 0; -+ h=t->message; -+ if(! flag && h && h->tagged)return 1; -+ if(flag && h && ! h->tagged) return 1; ++ if(!t) ++ return 0; ++ h = t->message; ++ if(!h) ++ return 0; ++ if(mutt_pattern_exec(pat, flags, ctx, h)) ++ return 1; + -+ if(up)a=match_threadcomplete(flag,t->parent,1,1,1,0); -+ if(a)return a; -+ if(right && t->parent)a=match_threadcomplete(flag,t->next,0,0,1,1); -+ if(a)return a; -+ if(left && t->parent)a=match_threadcomplete(flag,t->prev,1,0,0,1); -+ if(a)return a; -+ if(down)a=match_threadcomplete(flag,t->child,1,0,1,1); -+ if(a)return a; -+ return 0; ++ if(up && (a=match_threadcomplete(pat, flags, ctx, t->parent,1,1,1,0))) ++ return a; ++ if(right && t->parent && (a=match_threadcomplete(pat, flags, ctx, t->next,0,0,1,1))) ++ return a; ++ if(left && t->parent && (a=match_threadcomplete(pat, flags, ctx, t->prev,1,0,0,1))) ++ return a; ++ if(down && (a=match_threadcomplete(pat, flags, ctx, t->child,1,0,1,1))) ++ return a; ++ return 0; +} + /* flags M_MATCH_FULL_ADDRESS match both personal and machine address */ int -@@ -1024,6 +1046,8 @@ +@@ -958,6 +1016,8 @@ + return (pat->not ^ (perform_and (pat->child, flags, ctx, h) > 0)); + case M_OR: + return (pat->not ^ (perform_or (pat->child, flags, ctx, h) > 0)); ++ case M_THREAD: ++ return (pat->not ^ match_threadcomplete(pat->child, flags, ctx, h->thread, 1, 1, 1, 1)); + case M_ALL: + return (!pat->not); + case M_EXPIRED: +@@ -1023,6 +1083,16 @@ pat->alladdr, 2, h->env->to, h->env->cc)); case M_LIST: return (pat->not ^ mutt_is_list_recipient (pat->alladdr, h->env->to, h->env->cc)); + case M_THREADCOMPLETE: -+ return ((h->thread && match_threadcomplete(pat->not,h->thread,1,1,1,1))); ++ { static pattern_t tmp; ++ static short pattern_set = 0; ++ if(! pattern_set) { ++ memset (&tmp, 0, sizeof (tmp)); ++ tmp.op = M_TAG; ++ pattern_set = 1; ++ } ++ return (pat->not ^ match_threadcomplete(&tmp, flags, ctx, h->thread, 1, 1, 1, 1)); ++ } case M_PERSONAL_RECIP: return (pat->not ^ match_user (pat->alladdr, h->env->to, h->env->cc)); case M_PERSONAL_FROM: ---- PATCHES~ Tue Nov 6 19:59:33 2001 -+++ PATCHES Tue Nov 6 19:59:42 2001 -@@ -1,0 +1 @@ -+1.3.28.nr.threadcomplete Property changes on: head/mail/mutt-devel/files/patch-threadcomplete ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.1 \ No newline at end of property +1.2 \ No newline at end of property