[pacman-dev] Case sensitive options in pacman.conf

Nagy Gabor ngaba at bibl.u-szeged.hu
Tue Mar 11 11:58:17 EDT 2008


> 2008/3/11, Xavier <shiningxc at gmail.com>:
> > Currently, every options in pacman.conf apparently has a fixed case :
> >  RootDir     = /
> >  DBPath      = /var/lib/pacman/
> >  CacheDir    = /var/cache/pacman/pkg/
> >  LogFile     = /var/log/pacman.log
> >  HoldPkg     = pacman glibc
> >
> >
> >  But in fact, pacman does an insensitive comparisons when parsing the file.
> >  } else if(!strcmp(key, "CACHEDIR")) {
> >  with key = strtoupper("CacheDir")
> >
> >  So you can put cAcHeDiR if you like..
> >
> >  Then we found out this insensitive comparison didn't work in some locales,
> >  like tr_TR one, where for example, upper(i) != I
> >  To work around this, we also added a sensitive comparison :
> >  } else if(strcmp(origkey, "CacheDir") == 0 || strcmp(key, "CACHEDIR") ==
> 0) {
> > 
>
http://projects.archlinux.org/git/?p=pacman.git;a=commitdiff;h=1cd7567ff8af4bcc2813eb0f104fdab8ef0f7c53
> >
> >  So in fact, in tr_TR locale, only case sensitive options will really work
> (eg
> >  cAcHeDiR won't work).
> >  Why do we make a special case for this locale? I think that having to do
> >  every single comparisons twice during the config file parsing is really
> ugly,
> >  and more error prone when adding new options.
> >
> >  So I would vote for only allowing case sensitive options in pacman.conf,
> to
> >  treat all locales equally, and cleaning the code :)
> >
> >  If that's not acceptable, what about adding a new function, to do
> something
> >  like :
> >  } else if(compare(origkey, "CacheDir", "CACHEDIR") == 0) {
> >
> >  That still isn't ideal but would at least reduce the duplication a bit.
> >
> 
> "only case sensitive" is ok for me, I'm not that lazy to use Shift. :-P
+1



----------------------------------------------------
SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu
This mail sent through IMP: http://horde.org/imp/





More information about the pacman-dev mailing list