Bug 25427 - /usr/lib/pm-utils/functions: is_set missing '|'
Summary: /usr/lib/pm-utils/functions: is_set missing '|'
Status: RESOLVED FIXED
Alias: None
Product: pm-utils
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: highest blocker
Assignee: Victor Lowther
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 16:28 UTC by profjim
Modified: 2009-12-13 23:50 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch to revert above patch to fix regression (1.06 KB, patch)
2009-12-11 00:39 UTC, Martin Pitt
Details | Splinter Review

Description profjim 2009-12-03 16:28:45 UTC
/usr/lib/pm-utils/functions: is_set() says:

> # If a variable is set to true, yes, 1, or is simply set with no value,
> # return 0, otherwise return 1.
> is_set() {
>    case ${1-UNSET} in
>		true|yes|TRUE|YES|on|ON|1'') return 0;;

if 1 and '' are supposed to be two different ways of getting retvalue 0, shouldn't they be separated with a '|'?
Comment 1 Victor Lowther 2009-12-06 11:32:54 UTC
Yes, they should be.  Thanks!
Comment 2 Martin Pitt 2009-12-11 00:38:24 UTC
rc2 has a major regression: debugging is now always on, and suspend does not work at all any more.

The reason is commit f7df23f2928f63c38ef4b307b4312787f1a715bc (which supposedly fixed this bug), but since it essentially reverts the implied value of unspecified variables, it turns the behaviour upside down.

So far the code has been written with the assumption that is_set() returns
2 (and not 0) for undefined variables, so before the default value of variables
can be true, the entire code would need to change first.

Attached patch reverts to the original behaviour for now, and makes pm-suspend & friends work again.
Comment 3 Martin Pitt 2009-12-11 00:39:01 UTC
Created attachment 31971 [details] [review]
patch to revert above patch to fix regression
Comment 4 Victor Lowther 2009-12-11 20:11:52 UTC
(In reply to comment #3)
> Created an attachment (id=31971) [details]
> patch to revert above patch to fix regression
> 

Remember kids, don't release code under the influence of sleep deprivation!
Comment 5 Martin Pitt 2009-12-13 23:50:22 UTC
Thanks, this was fixed in git now.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.