Bug 67742 - gettext's msginit does not really use the GETTEXTLIBDIR enviroment variable
Summary: gettext's msginit does not really use the GETTEXTLIBDIR enviroment variable
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gettext (Show other bugs)
(Show other bugs)
Version: 7.3
Hardware: i386 Linux
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Aaron Brown
Depends On:
TreeView+ depends on / blocked
Reported: 2002-07-01 13:20 UTC by George Barbarosie
Modified: 2007-04-18 16:43 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-07-04 09:46:44 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description George Barbarosie 2002-07-01 13:20:25 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020606

Description of problem:
gettext's msginit is supposed to use the enviroment var GETTEXTLIBDIR to
indicate where the project-id and user-email scripts are stored. Now, while
project-id can be moved to a different libdir, msginit will continue to look for
 user-email in the default /user/lib/gettext/user-email.

How reproducible:

Steps to Reproduce:
1) do smth about bug #67741 ;)
2) move all /usr/lib/gettext/ to some /custom_lib/gettext/
3) export GETTEXTLIBDIR="/custom_lib/gettext/
4) create a project-version; 
5) xgettext files to get a po/PROJ.pot
6) cd po; LANG="fr_FR" msginit

Actual Results: 
will complain about:

/usr/lib/gettext/user-email: /usr/lib/gettext/user-email: No such file or directory
msginit: /usr/lib/gettext/user-email subprocess I/O error

Expected Results:
ask about email validity; create fr_FR.po; no errors;

Additional info:

I did not check to see if other gettext utils are supposed to use GETTEXTLIBDIR
and if they really obey by it. But, for msginit, here's the patch to fix this:

--- msginit.c.orig      Mon Jul  1 16:19:56 2002
+++ msginit.c   Mon Jul  1 16:21:38 2002
@@ -1062,7 +1062,8 @@
 static const char *
 get_user_email ()
-  char *prog = concatenated_pathname (LIBDIR, "gettext/user-email", NULL);
+  char *gettextlibdir;
+  char *prog;
   char *argv[4];
   pid_t child;
   int fd[1];
@@ -1072,6 +1073,12 @@
   size_t linelen;
   int exitstatus;
+  gettextlibdir = getenv ("GETTEXTLIBDIR");
+  if (gettextlibdir == NULL || gettextlibdir[0] == '\0')
+    gettextlibdir = concatenated_pathname (LIBDIR, "gettext", NULL);
+  prog = concatenated_pathname (gettextlibdir, "user-email", NULL);
   /* Ask the user for his email address.  */
   argv[0] = "/bin/sh";
   argv[1] = prog;

Comment 1 Trond Eivind Glomsrxd 2002-07-03 19:45:20 UTC
Where is GETTEXTLIBDIR documented?

Comment 2 George Barbarosie 2002-07-04 09:46:40 UTC
Except for two references in the po/Changelog and for the explicit use in
msginit.c, nowhere indeed. Suit yourself then.

Comment 3 Trond Eivind Glomsrxd 2002-07-09 15:35:33 UTC
Ok, just wondered since I couldn't find any docs about it. I'd recommend you
send your patch upstream to see if you can get any feedback on it.

Comment 4 Bruno Haible 2003-02-17 15:50:25 UTC
Indeed GETTEXTLIBDIR is not documented. (Its only purpose is for "make check"
to work before "make install".) If you want to install gettext with a different
libdir, rebuild it with "configure --libdir=...".

Note You need to log in before you can comment on or make changes to this bug.