X-Git-Url: https://git.pld-linux.org/?p=packages%2Fmutt.git;a=blobdiff_plain;f=mutt-home_etc.patch;h=9c24e2358fa23073943bb84d2f676e4d3b3d66c7;hp=b9df34468a32e0e92cdadacc72c566b972e18267;hb=37de89838c121f645c12ff15f970213aaae08c48;hpb=96c78afdb3cf52e0ddf6f1571d15acb1ff557786 diff --git a/mutt-home_etc.patch b/mutt-home_etc.patch index b9df344..9c24e23 100644 --- a/mutt-home_etc.patch +++ b/mutt-home_etc.patch @@ -1,10 +1,11 @@ -diff -Nur mutt-1.4.1.orig/configure.in mutt-1.4.1/configure.in ---- mutt-1.4.1.orig/configure.in Mon Dec 8 13:51:51 2003 -+++ mutt-1.4.1/configure.in Mon Dec 8 14:01:22 2003 -@@ -592,6 +592,31 @@ - ]) - AM_CONDITIONAL(USE_SASL, test x$need_sasl = xyes) +diff -Nur mutt-1.5.11.orig/configure.ac mutt-1.5.11/configure.ac +--- mutt-1.5.11.orig/configure.ac 2006-05-11 23:23:13.000000000 +0200 ++++ mutt-1.5.11/configure.ac 2006-05-12 00:58:13.000000000 +0200 +@@ -816,6 +816,32 @@ + fi]) + dnl -- end cache -- ++dnl -- home-etc -- +AC_ARG_WITH(home-etc, [ --with-home-etc[=PFX] Use HOME-ETC library to allow user keeping it's configuration files in a non-standard place ], + [ + if test "$with_home_etc" != "no" @@ -33,32 +34,47 @@ diff -Nur mutt-1.4.1.orig/configure.in mutt-1.4.1/configure.in if test "$need_md5" = "yes" then MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS md5c.o" -diff -Nur mutt-1.4.1.orig/doc/mutt.man mutt-1.4.1/doc/mutt.man ---- mutt-1.4.1.orig/doc/mutt.man Wed Jul 24 10:41:31 2002 -+++ mutt-1.4.1/doc/mutt.man Mon Dec 8 13:53:17 2003 -@@ -122,13 +122,13 @@ +diff -Nur mutt-1.5.11.orig/doc/mutt.man mutt-1.5.11/doc/mutt.man +--- mutt-1.5.11.orig/doc/mutt.man 2005-08-18 21:38:54.000000000 +0200 ++++ mutt-1.5.11/doc/mutt.man 2006-05-12 00:58:13.000000000 +0200 +@@ -122,6 +122,8 @@ + .IP "MAILDIR" + Full path of the user's spool mailbox if MAIL is unset. Commonly used when the spool + mailbox is a ++.IP "HOME_ETC" ++Path to alternative configuration directory. + .B maildir (5) + folder. + .IP "MAILCAPS" +@@ -138,17 +140,17 @@ Specifies the editor to use when composing messages. .SH FILES .PP -.IP "~/.muttrc or ~/.mutt/muttrc" +.IP "$HOME_ETC/.muttrc" or "$HOME_ETC/.mutt/muttrc" or "~/.muttrc" or "~/.mutt/muttrc" User configuration file. - .IP "/etc/Muttrc" + .IP "@sysconfdir@/Muttrc" System-wide configuration file. .IP "/tmp/muttXXXXXX" Temporary files created by Mutt. -.IP "~/.mailcap" -+.IP "$HOME_ETC/.mailcap" or "~/.mailcap" ++.IP "~/.mailcap or $HOME_ETC/.mailcap" User definition for handling non-text MIME types. - .IP "/etc/mailcap" + .IP "@sysconfdir@/mailcap" System definition for handling non-text MIME types. -diff -Nur mutt-1.4.1.orig/init.c mutt-1.4.1/init.c ---- mutt-1.4.1.orig/init.c Mon Dec 8 13:51:51 2003 -+++ mutt-1.4.1/init.c Mon Dec 8 14:02:19 2003 -@@ -25,6 +25,12 @@ - #include "mbyte.h" - #include "charset.h" +-.IP "~/.mime.types" ++.IP "~/.mime.types or $HOME_ETC/.mime.types" + User's personal mapping between MIME types and file extensions. + .IP "@sysconfdir@/mime.types" + System mapping between MIME types and file extensions. +diff -Nur mutt-1.5.11.orig/init.c mutt-1.5.11/init.c +--- mutt-1.5.11.orig/init.c 2006-05-11 23:23:13.000000000 +0200 ++++ mutt-1.5.11/init.c 2006-05-12 00:58:40.000000000 +0200 +@@ -35,7 +35,12 @@ + #include "mutt_ssl.h" + #endif +- +#ifdef HAVE_HOME_ETC_H +# include +# define H_CFDIR _HEdir @@ -66,9 +82,32 @@ diff -Nur mutt-1.4.1.orig/init.c mutt-1.4.1/init.c +# define H_CFDIR Homedir +#endif - #ifdef HAVE_PGP - #include "pgp.h" -@@ -1892,13 +1898,13 @@ + #include "mx.h" + #include "init.h" +@@ -2334,7 +2339,21 @@ + else + { + /* Default search path from RFC1524 */ +- MailcapPath = safe_strdup ("~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap"); ++ ++#define MAILCAPPATHS "~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap" ++#ifdef HAVE_HOME_ETC_H ++ ++ MailcapPath = safe_malloc (mutt_strlen (MAILCAPPATHS) + mutt_strlen (_HEdir) + 2); ++ if (_HEdir != NULL && (mutt_strlen (_HEdir)) > 0) ++ sprintf (MailcapPath, "%s:%s", _HEdir, MAILCAPPATHS); /* __SPRINTF_CHECKED__ */ ++ else ++ strcpy (MailcapPath, MAILCAPPATHS); /* __SPRCPY_CHECKED__ */ ++ ++#else ++ ++ MailcapPath = safe_strdup (MAILCAPPATHS); ++ ++#endif + } + + Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/tmp"); +@@ -2981,15 +2981,15 @@ if (!Muttrc) { @@ -83,47 +122,73 @@ diff -Nur mutt-1.4.1.orig/init.c mutt-1.4.1/init.c if (access(buffer, F_OK) == -1) - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(Homedir)); + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(H_CFDIR)); - + if (access(buffer, F_OK) == -1) /* default to .muttrc for alias_file */ +- snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(Homedir)); ++ snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(H_CFDIR)); + default_rc = 1; Muttrc = safe_strdup (buffer); -diff -Nur mutt-1.4.1.orig/muttbug.sh.in mutt-1.4.1/muttbug.sh.in ---- mutt-1.4.1.orig/muttbug.sh.in Mon Dec 8 13:51:50 2003 -+++ mutt-1.4.1/muttbug.sh.in Mon Dec 8 13:53:17 2003 -@@ -244,13 +244,21 @@ - if test "$personal" = "yes" ; then - CANDIDATES=".muttrc-${MUTTVERSION} .muttrc .mutt/muttrc-${MUTTVERSION} .mutt/muttrc" - MATCHED="none" -+ if test -n "$HOME_ETC" ; then -+ for f in $CANDIDATES; do -+ if test -f "${HOME_ETC}/$f" ; then -+ MATCHED="${HOME_ETC}/$f" -+ break -+ fi -+ done -+ else - for f in $CANDIDATES; do - if test -f "${HOME}/$f" ; then - MATCHED="${HOME}/$f" - break - fi - done -- -+ fi - if test "$MATCHED" = "none" ; then - echo "Warning: Can't find your personal .muttrc." >&2 - else -diff -Nur mutt-1.4.1.orig/sendlib.c mutt-1.4.1/sendlib.c ---- mutt-1.4.1.orig/sendlib.c Mon Dec 8 13:51:51 2003 -+++ mutt-1.4.1/sendlib.c Mon Dec 8 14:02:54 2003 -@@ -29,7 +29,6 @@ - #include "pager.h" - #include "charset.h" +@@ -2526,10 +2545,10 @@ + } -- - #include - #include - #include -@@ -40,6 +39,13 @@ + uname (&u); +- pathlen = strlen (Homedir) + sizeof("/.slrnfaces/") ++ pathlen = strlen (H_CFDIR) + sizeof("/.slrnfaces/") + + strlen (u.nodename) + 30; + fifo = safe_malloc (pathlen); +- sprintf (fifo, "%s/.slrnfaces", Homedir); ++ sprintf (fifo, "%s/.slrnfaces", H_CFDIR); + if (mkdir (fifo, 0700)) + { + if (errno != EEXIST) +@@ -2544,7 +2563,7 @@ + FILE *fp; + + /* We'll abuse fifo filename memory here. It's long enough. */ +- sprintf (fifo, "%s/.slrnfaces/README", Homedir); ++ sprintf (fifo, "%s/.slrnfaces/README", H_CFDIR); + if ((fp = fopen (fifo, "w")) != NULL) + { + fputs (_( +@@ -2560,7 +2579,7 @@ + } + } + +- status = snprintf (fifo, pathlen, "%s/.slrnfaces/%s.%ld", Homedir, ++ status = snprintf (fifo, pathlen, "%s/.slrnfaces/%s.%ld", H_CFDIR, + u.nodename, (long)getpid()); + if (status < 0) + goto clean_face; +diff -Nur mutt-1.5.11.orig/mutt_ssl.c mutt-1.5.11/mutt_ssl.c +--- mutt-1.5.11.orig/mutt_ssl.c 2005-08-03 11:17:46.000000000 +0200 ++++ mutt-1.5.11/mutt_ssl.c 2006-05-12 00:58:13.000000000 +0200 +@@ -58,6 +58,13 @@ + #define HAVE_ENTROPY() (!access(DEVRANDOM, R_OK) || entropy_byte_count >= 16) + #endif + ++#ifdef HAVE_HOME_ETC_H ++# include ++# define H_CFDIR _HEdir ++#else ++# define H_CFDIR Homedir ++#endif ++ + /* keep a handle on accepted certificates in case we want to + * open up another connection to the same server in this session */ + static STACK_OF(X509) *SslSessionCerts = NULL; +@@ -162,7 +169,7 @@ + /* load entropy from egd sockets */ + #ifdef HAVE_RAND_EGD + add_entropy (getenv ("EGDSOCKET")); +- snprintf (path, sizeof(path), "%s/.entropy", NONULL(Homedir)); ++ snprintf (path, sizeof(path), "%s/.entropy", NONULL(H_CFDIR)); + add_entropy (path); + add_entropy ("/tmp/entropy"); + #endif +diff -Nur mutt-1.5.11.orig/sendlib.c mutt-1.5.11/sendlib.c +--- mutt-1.5.11.orig/sendlib.c 2006-05-11 23:23:13.000000000 +0200 ++++ mutt-1.5.11/sendlib.c 2006-05-12 00:58:13.000000000 +0200 +@@ -45,6 +45,13 @@ #include #include @@ -137,7 +202,7 @@ diff -Nur mutt-1.4.1.orig/sendlib.c mutt-1.4.1/sendlib.c #ifdef HAVE_SYSEXITS_H #include #else /* Make sure EX_OK is defined */ -@@ -958,9 +964,9 @@ +@@ -908,9 +915,9 @@ /* Given a file with path ``s'', see if there is a registered MIME type. * returns the major MIME type, and copies the subtype to ``d''. First look @@ -149,8 +214,8 @@ diff -Nur mutt-1.4.1.orig/sendlib.c mutt-1.4.1/sendlib.c + * match `ps.gz' when `gz' also exists. */ - static int lookup_mime_type (BODY *att, const char *path) -@@ -989,7 +995,7 @@ + int mutt_lookup_mime_type (BODY *att, const char *path) +@@ -939,7 +946,7 @@ switch (count) { case 0: