--- Begin Message ---
http://bugs.freedesktop.org/show_bug.cgi?id=14560

           Summary: resume scripts run in incorrect sort order
           Product: pm-utils
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: General
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The scripts in /usr/lib/pm-utils/sleep.d (or some similar location) are
supposed to run in reverse order when resuming from suspend.  However, they
actually run in the same order.  This causes problems with several
order-sensitive scripts in that directory, such as 05led and 95led.

The bug is in function pm_main from the /usr/lib/pm-utils/functions script.  It
sets local variable $sort to either "sort" or "sort -r" depending on the
desired order.  However, the list of script names is then piped through "sort",
rather than "$sort".  Thus, setting $sort to "sort -r" has no affect on the
ordering.

Suggested fix: near line 139 of /usr/lib/pm-utils/functions, change this:

                do [ -O "$f" ] && echo ${f##*/} ; done | sort | uniq) ;

to this:

                do [ -O "$f" ] && echo ${f##*/} ; done | eval $sort | uniq) ;

Note that the "eval" is necessary because otherwise the shell will try to find
an executable command named "sort -r" rather than running "sort" with "-r" as
an argument.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

--- End Message ---
_______________________________________________
Pm-utils mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to