This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug locale/25195] localedef does not return error status when warnings were issued.
- From: "carlos at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 21 Nov 2019 04:31:07 +0000
- Subject: [Bug locale/25195] localedef does not return error status when warnings were issued.
- Auto-submitted: auto-generated
- References: <bug-25195-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=25195
Carlos O'Donell <carlos at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #5 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Sergei Trofimovich from comment #4)
> # /usr/bin/localedef -c --no-archive -i en_US -f 'ISO-8859-1-whee' -A
> /usr/share/locale/locale.alias --prefix / en_US; echo $?
> failed to set locale!
> [error] character map file `ISO-8859-1-whee' not found: No such file or
> directory
> 0
Thanks, that helped!
cd $HOME
mkdir -p usr/lib/locale/en_US
/usr/bin/localedef -c --no-archive -i en_US \
-f 'ISO-8859-1-whee' -A /usr/share/locale/locale.alias \
--prefix $HOME en_US
[error] character map file `ISO-8859-1-whee' not found: No such file or
directory
echo $?
0
Reproduced.
This is the expected behaviour. Sorry I didn't notice the "-c" originally.
(a) You specified "-c" on the command line which means "--force" and so
regardless of errors the output is written.
(b) If output is written then an error code of 4 cannot be returned. That would
violate the POSIX specification e.g. exit code of >= 3 means warnings or errors
occurred and _no output_ was generated.
By using "-c" you are basically saying "ignore errors, and force the output"
and so the output is generated regardless of the error and that operation as
you requested was successful.
Removing "-c" avoids output and returns error code 4.
/usr/bin/localedef --no-archive -i en_US \
-f 'ISO-8859-1-whee' -A /usr/share/locale/locale.alias \
--prefix $HOME en_US
[error] character map file `ISO-8859-1-whee' not found: No such file or
directory
[error] no output file produced because errors were issued
echo $?
4
I'm marking this RESOLVED/INVALID.
Please reopen if you have any more questions.
--
You are receiving this mail because:
You are on the CC list for the bug.