Обсуждение: Case sensitive mode in windows build option

Поиск
Список
Период
Сортировка

Case sensitive mode in windows build option

От
Dilip kumar
Дата:

 

As per current behavior if user want to build in debug mode in windows, then he need to give debug in capital letters (DEBUG),

I think many user will always make mistake in giving this option, in my opinion we can make it case insensitive.

 

I have attached a small patch for the same ( just converted comparison to case insensitive).

 

Regards,

Dilip

Вложения

Re: Case sensitive mode in windows build option

От
Craig Ringer
Дата:
On 01/14/2014 11:49 AM, Dilip kumar wrote:
>  
> 
> As per current behavior if user want to build in debug mode in windows,
> then he need to give debug in capital letters (DEBUG),
> 
> I think many user will always make mistake in giving this option, in my
> opinion we can make it case insensitive.

The idea seems reasonable, the implementation does not. You've changed
the meaning rather more than making it case insensitive.

Use the Perl 'lc' function to compare a lower-cased input instead.

http://perldoc.perl.org/functions/lc.html

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



Re: Case sensitive mode in windows build option

От
Dilip kumar
Дата:
On 01/14/2014 11:25 AM Craig Ringer Wrote,

> > As per current behavior if user want to build in debug mode in
> > windows, then he need to give debug in capital letters (DEBUG),
> >
> > I think many user will always make mistake in giving this option, in
> > my opinion we can make it case insensitive.
>
> The idea seems reasonable, the implementation does not. You've changed
> the meaning rather more than making it case insensitive.
>
> Use the Perl 'lc' function to compare a lower-cased input instead.
>
> http://perldoc.perl.org/functions/lc.html

I think I have done the same thing, converted user input to upper case and compared with DEBUG, so this will always
givethe case insensitive comparison. 
Now we can input debug in any case (Debug, DEBUG, debug..) and it will work fine..

And for achieving this I used Perl 'uc' function to compare upper-cased input.

! if (uc($ARGV[0]) eq 'DEBUG') {     $bconf = "Debug"; }

Will it make any difference if I use 'lc' instead of 'uc' ?

Please correct me if I have missed something here..


Regards,
Dilip



Re: Case sensitive mode in windows build option

От
Craig Ringer
Дата:
On 01/14/2014 05:35 PM, Dilip kumar wrote:
> On 01/14/2014 11:25 AM Craig Ringer Wrote,
> 
>>> As per current behavior if user want to build in debug mode in
>>> windows, then he need to give debug in capital letters (DEBUG),
>>>
>>> I think many user will always make mistake in giving this option, in
>>> my opinion we can make it case insensitive.
>>
>> The idea seems reasonable, the implementation does not. You've changed
>> the meaning rather more than making it case insensitive.
>>
>> Use the Perl 'lc' function to compare a lower-cased input instead.
>>
>> http://perldoc.perl.org/functions/lc.html
> 
> I think I have done the same thing, converted user input to upper case and compared with DEBUG, so this will always
givethe case insensitive comparison.
 
> Now we can input debug in any case (Debug, DEBUG, debug..) and it will work fine..

You're completely right. My apologies. I'm not used to reading that
awful (IMO) context-diff format - despite it being the official standard
for PostgreSQL, I still misread it on a regular basis.

I saw:

! if (uc($ARGV[0]) eq 'DEBUG')
...
! elsif (uc($ARGV[0]) ne "RELEASE")

and thought "WTF?".

In fact, the WTF is all me.

Please disregard.

This seems quite sensible. Please add it to the commitfest app if it
isn't there already:
   http://commitfest.postgresql.org/

and I'll sign up as a reviewer so I can do some build-testing on it
after the rather pressing deadline I've got in the next couple of days
has passed.

If you don't hear from me by Friday, poke me.


-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



Re: Case sensitive mode in windows build option

От
Andrew Dunstan
Дата:
On 01/13/2014 10:49 PM, Dilip kumar wrote:
>
> As per current behavior if user want to build in debug mode in
> windows, then he need to give debug in capital letters (DEBUG),
>
> I think many user will always make mistake in giving this option, in
> my opinion we can make it case insensitive.
>
> I have attached a small patch for the same ( just converted comparison
> to case insensitive).
>
>

I have committed this. It's in the commitfest as a bug fix, but I don't
think it's strictly a bug. OTOH, it's pretty harmless. Do we want to
backpatch it?

cheers

andrew



Re: Case sensitive mode in windows build option

От
Tom Lane
Дата:
Andrew Dunstan <andrew@dunslane.net> writes:
> I have committed this. It's in the commitfest as a bug fix, but I don't
> think it's strictly a bug. OTOH, it's pretty harmless. Do we want to
> backpatch it?

Given the lack of field complaints, I'd say it's not worth the trouble.
        regards, tom lane