All of lore.kernel.org
 help / color / mirror / Atom feed
* default listtext dir
@ 2006-09-08 13:29 Henne Vogelsang
  0 siblings, 0 replies; only message in thread
From: Henne Vogelsang @ 2006-09-08 13:29 UTC (permalink / raw)
  To: mlmmj

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

Hi,

i frequently run into the problem that i update mlmmj and have to wade
trough all my lists and update the listtexts because some new one got
added (e.g. submod-moderator) or something is modified. 

I would like to propose a default listtext directory (like there already
is in datadir/mlmmj/text.skel). So listtexts would be searched

1. in spool/list/text/file and if not there
2. in default/file

This would mean that spool/list/text/file is just an overwrite and you
can operate lists just with default texts (no text/ dir at all). Also
comes in handy if the translations are behind etc.

The following patch implements this in prestdreply.c. The only part that
is missing is making configure setting the dir in config.h instead of
hardcoding it. What do you think?

Henne

-- 
Henne Vogelsang, Core Services
"Rules change. The Game remains the same."
			 - Omar (The Wire)

[-- Attachment #2: mlmmj-defaulttextdir.patch --]
[-- Type: text/x-patch, Size: 703 bytes --]

--- config.h.in
+++ config.h.in
@@ -129,3 +129,6 @@
 
 /* Define to `unsigned' if <sys/types.h> does not define. */
 #undef size_t
+
+/* Define to the location of the default listext directory */
+#define DEFAULTTEXTDIR  "/usr/share/mlmmj/text.skel/"
--- src/prepstdreply.c
+++ src/prepstdreply.c
@@ -166,8 +166,13 @@
 	infd = open(tmp, O_RDONLY);
 	myfree(tmp);
 	if(infd < 0) {
-		log_error(LOG_ARGS, "Could not open std mail %s", filename);
-		return NULL;
+		tmp = concatstr(2, DEFAULTTEXTDIR, filename);
+		infd = open(tmp, O_RDONLY);
+		myfree(tmp);
+		if(infd < 0) {
+			log_error(LOG_ARGS, "Could not open std mail %s", filename);
+			return NULL;
+		}	
 	}
 
 	listaddr = getlistaddr(listdir);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-08 13:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-08 13:29 default listtext dir Henne Vogelsang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.