FS#7235 - Pacman Locale Problem

Attached to Project: Pacman
Opened by Alper Kanat (T-u-N-i-X) - Tuesday, 22 May 2007, 13:14 GMT
Last edited by Dan McGee (toofishes) - Saturday, 09 June 2007, 16:16 GMT
Task Type Bug Report
Category Backend/Core
Status Closed
Assigned To Aaron Griffin (phrakture)
Dan McGee (toofishes)
Architecture All
Severity High
Priority Normal
Reported Version 3.0.4
Due in Version 3.1.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Pacman has again problem with the Turkish locale. It can't parse pacman.conf file.. I'm using tr_TR.UTF-8 when it doesn't work.. If I set it to C locale, it works successfully..

A few months ago, there has been the same problem which I have again reported.. It was solved with the next minor release..
This task depends upon

Closed by  Dan McGee (toofishes)
Saturday, 09 June 2007, 16:16 GMT
Reason for closing:  Fixed
Additional comments about closing:  (inadvertently) fixed in 3.1
Comment by Roman Kyrylych (Romashka) - Tuesday, 22 May 2007, 19:24 GMT Comment by Aaron Griffin (phrakture) - Tuesday, 22 May 2007, 19:38 GMT
Could you attach the --debug output so I can see where/what entry it is failing on?
Comment by Alper Kanat (T-u-N-i-X) - Wednesday, 23 May 2007, 10:45 GMT
$ pacman -Ss asm --debug
debug: config: new section 'options'
debug: returning error 54 from alpm_parse_config : syntax error in config file
error: failed to parse config (syntax error in config file)
Comment by Aaron Griffin (phrakture) - Wednesday, 23 May 2007, 15:53 GMT
Ok, what is the first line after '[options]' in your pacman.conf
Comment by Alper Kanat (T-u-N-i-X) - Wednesday, 23 May 2007, 16:24 GMT
[options]
LogFile = /var/log/pacman.log
Comment by Alper Kanat (T-u-N-i-X) - Wednesday, 23 May 2007, 16:25 GMT
I add the whole pacman.conf here..
Comment by Aaron Griffin (phrakture) - Wednesday, 23 May 2007, 16:31 GMT
Hmmm this is odd. The last turkish fix I added worked like so (in pseudocode):

original_key = "LogFile"
key = "LOGFILE" (uppercase of original_key)

if original_key == "LogFile" or key == "LOGFILE"
... carry on ...

the uppercase version will fail in the turkish locale, but the proper-cased version should not - and this did fix it before, correct?

Hmmm, perhaps this change was lost somewhere in the shuffle... I will check.
Comment by Alper Kanat (T-u-N-i-X) - Sunday, 27 May 2007, 20:30 GMT
Any improvements ?
Comment by Dan McGee (toofishes) - Wednesday, 30 May 2007, 19:11 GMT
$ cat /etc/pacman.conf
#
# GENERAL OPTIONS
#
[options]
LogFile = /var/log/pacman.log
HoldPkg = pacman glibc
.....................

$ locale
LANG=tr_TR.UTF-8
LC_CTYPE="tr_TR.UTF-8"
LC_NUMERIC="tr_TR.UTF-8"
LC_TIME="tr_TR.UTF-8"
LC_COLLATE=C
LC_MONETARY="tr_TR.UTF-8"
LC_MESSAGES="tr_TR.UTF-8"
LC_PAPER="tr_TR.UTF-8"
LC_NAME="tr_TR.UTF-8"
LC_ADDRESS="tr_TR.UTF-8"
LC_TELEPHONE="tr_TR.UTF-8"
LC_MEASUREMENT="tr_TR.UTF-8"
LC_IDENTIFICATION="tr_TR.UTF-8"
LC_ALL=

$ pacman -Ss asm
current/nasm 0.98.39-1
80x86 assembler designed for portability and modularity
extra/libgnomecanvasmm 2.16.0-2
A C++ wrapper for libgnomecanvas.
extra/rasmol 2.7.3-2
A program for molecular graphics visualisation (aka openrasmol)
community/yasm 0.6.0-1
Yasm is a complete rewrite of the NASM assembler designed from the ground up to allow for multiple assembler syntaxes to be supported (eg, NASM, TASM, GAS, etc.)

I can't duplicate this bug after setting my locale, so this is real hard to debug for me. I'm running 3.0.4-3.
Comment by Alper Kanat (T-u-N-i-X) - Wednesday, 30 May 2007, 20:57 GMT
Your LC_COLLATE is set to C.. Can you please set it to tr_TR.UTF-8 too ?
Comment by Dan McGee (toofishes) - Wednesday, 30 May 2007, 21:10 GMT
Still no problems. I tried setting LC_ALL as well and couldn't get it to bug out.
Comment by Alper Kanat (T-u-N-i-X) - Wednesday, 30 May 2007, 23:47 GMT
:S i've tried it on another machine by changing its locale (by simply typing export LANG=tr_TR.UTF-8; export LC_ALL=tr_TR.UTF-8) but the error didn't show up on that machine.. so the problem might be related with something on my machine.. But how can I find that ? How can I clear every pacman file and re-install it ?
Comment by Aaron Griffin (phrakture) - Thursday, 31 May 2007, 04:30 GMT
Try regenerating your locale, and also a pacman -S pacman couldn't hurt.
Comment by Alper Kanat (T-u-N-i-X) - Saturday, 02 June 2007, 20:55 GMT
I reinstalled the whole Arch Linux again... It's the same as it used to be.. I also regenerated my locales but it didn't work.. :(
Comment by Dan McGee (toofishes) - Saturday, 02 June 2007, 21:12 GMT
This is quite odd. Where and how is your language set? rc.conf, bashrc, etc?
Comment by Alper Kanat (T-u-N-i-X) - Saturday, 02 June 2007, 21:30 GMT
Here.. I hope they help..
Comment by Alper Kanat (T-u-N-i-X) - Saturday, 02 June 2007, 21:33 GMT
I'm using sudo for all pacman operations.. I've send my user's .bashrc file.. But the root also has the same problem.
Comment by Xavier (shining) - Friday, 08 June 2007, 20:55 GMT
I can reproduce the problem with pacman v3.0.4 , but not with pacman git..
Comment by Xavier (shining) - Friday, 08 June 2007, 21:15 GMT
Oh, it was a very stupid mistake :D

Index: lib/libalpm/alpm.c
===================================================================
RCS file: /home/cvs-pacman/pacman-lib/lib/libalpm/alpm.c,v
retrieving revision 1.128
diff -u -r1.128 alpm.c
--- lib/libalpm/alpm.c 4 Apr 2007 03:59:36 -0000 1.128
+++ lib/libalpm/alpm.c 8 Jun 2007 21:14:19 -0000
@@ -939,7 +939,7 @@
RET_ERR(PM_ERR_CONF_BAD_SYNTAX, -1);
}
_alpm_strtrim(key);
- strncpy(origkey, key, min(255, strlen(key)));
+ strncpy(origkey, key, min(255, strlen(key)+1));
key = _alpm_strtoupper(key);
if(!strlen(section) && strcmp(key, "INCLUDE")) {
RET_ERR(PM_ERR_CONF_DIRECTIVE_OUTSIDE_SECTION, -1);


toofishes fixed it when moving parseconfig from alpm to the client :
http://projects.archlinux.org/git/gitweb.cgi?p=pacman.git;a=commitdiff;h=65662315b6d180f7066f6578c55a9feec7250114#patch3
Now it's : upperkey = strtoupper(strdup(key));
Comment by Dan McGee (toofishes) - Friday, 08 June 2007, 21:57 GMT
Ha! I love fixing bugs by mistake. Now I just need to clean up that config parsing a bit more.
Comment by Alper Kanat (T-u-N-i-X) - Saturday, 09 June 2007, 16:04 GMT
:) waiting for the release.. thanks guys..! you rock..!

Loading...