[Pm-utils] [PATCH 1/5] Add help function to 99video.

Michael Biebl mbiebl at gmail.com
Fri Mar 7 07:21:11 PST 2008


2008/3/7, Michael Biebl <mbiebl at gmail.com>:
> 2008/3/7, Michael Biebl <mbiebl at gmail.com>:
>
> > 2008/3/7, Victor Lowther <victor.lowther at gmail.com>:
>  >
>  > > On Sat, Mar 01, 2008 at 07:15:03PM -0600, Victor Lowther wrote:
>  >  >  > On Sat, Mar 01, 2008 at 11:14:48AM -0600, Victor Lowther wrote:
>  >  >  > > This patch series applies on top of my most recent video hook merge
>  >  >  > > patch series.  It seems to be the best way to free up pm-utils from
>  >  >  > > having to act as the option parser for the hooks.
>  >  >  >
>  >  >  > If there are no objections, I will merge this branch upstream on
>  >  >  > Thursday, March 6 2008.  This branch is also available as
>  >  >  > 'vlowther-hook-option-processing' @ http://git.fnordovax.org/pm-utils/
>  >  >
>  >  >
>  >  > Pushed upstream without the final patch.
>  >  >
>  >
>  >
>  > Looks like the quirk options parsing in 99video is currently broken.
>  >
>  >  None of my quirks are currently set and applied.
>
>
> This fixes it for me:
>
> diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
>
> index 1dc88bd..911125c 100755
>
> --- a/pm/sleep.d/99video
>  +++ b/pm/sleep.d/99video
>
> @@ -11,7 +11,7 @@
>
>   for opt in $PM_CMDLINE; do
>         [ "${opt#--quirk-}" = "$opt" ] && continue # not one we care about.
>  -       case "${1##--quirk-}" in # just quirks, please
>  +       case "${opt##--quirk-}" in # just quirks, please
>                 dpms-on)           QUIRK_DPMS_ON="true" ;;
>                 dpms-suspend)      QUIRK_DPMS_SUSPEND="true" ;;
>                 radeon-off)        QUIRK_RADEON_OFF="true" ;;
>  @@ -25,7 +25,6 @@ for opt in $PM_CMDLINE; do
>                 none)              QUIRK_NONE="true" ;;
>                 *) continue ;;
>         esac
>  -       shift
>   done
>
>
>  Btw:  [ "${opt#--quirk-}" = "$opt" ] && continue # not one we care about.
>  That's superfluous and only adds and additional check in each loop
>  interation. We should just remove it.
>

I also noticed another problem with moving the option parsing into the
hooks (and modules):

We can't tell anymore, if one of the provided command line options is
wrong/unknown.

Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


More information about the Pm-utils mailing list