[Pm-utils] unify boolean config variables
Dan Nicholson
dbn.lists at gmail.com
Fri May 1 06:24:55 PDT 2009
On Wed, Apr 29, 2009 at 10:09 PM, Michael Biebl <mbiebl at gmail.com> wrote:
> 2009/4/30 Michael Biebl <mbiebl at gmail.com>:
>> Hi,
>>
>> currently our man pages and config variables are not very consistent
>> with regard to boolean variables.
>>
>> The majority uses true/false,
>> there is HIBERNATE_RESUME_POST_VIDEO which is yes/no
>> and NEED_CLOCK_SYNC, where anything else then "" is treated as true
>> (see 90clock).
>>
>> I'd like to use true/false for all boolean values and update the
>> manpages for HIBERNATE_RESUME_POST_VIDEO and NEED_CLOCK_SYNC and also
>> the check in 90clock, to test explictly [ "$NEED_CLOCK_SYNC" = "true"
>> ] || ...
>>
>> Any objections? Do you think this would pose upgrade problems for
>> users who already set
>> HIBERNATE_RESUME_POST_VIDEO to yes or no ( I could check both values
>> (yes/no,true/false))
>
> This time with patch. I keep the backward compatible check for
> HIBERNATE_RESUME_POST_VIDEO = yes
I think the backwards compat checks are important. You've changed the
NEEDS_CLOCK_SYNC code to check for "true", but previously it could
have been anything. I think it would be better to change so that
anything except "no", "false" or "" is treated as "true". So,
case "$NEEDS_CLOCK_SYNC" in
no,false,"") ;;
*) exit $NA ;;
esac
Then someone who had a previously valid configuration of
NEEDS_CLOCK_SYNC=1 or NEEDS_CLOCK_SYNC="" continues to work. The
comment in the defaults file also still says just to "set this
variable". Should say to set it to true.
--
Dan
More information about the Pm-utils
mailing list