PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Fri Sep 11 08:39:59 PDT 2009


 src/programs/pkaction.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit f8f132f066a930e296aa327d4c35c6d644774b9c
Author: David Zeuthen <davidz at redhat.com>
Date:   Fri Sep 11 11:35:58 2009 -0400

    Sort by action id in pkaction(1) output

diff --git a/src/programs/pkaction.c b/src/programs/pkaction.c
index 3493bc0..7d8f645 100644
--- a/src/programs/pkaction.c
+++ b/src/programs/pkaction.c
@@ -93,6 +93,14 @@ print_action (PolkitActionDescription *action,
     }
 }
 
+static gint
+action_desc_compare_by_action_id_func (PolkitActionDescription *a,
+                                       PolkitActionDescription *b)
+{
+  return g_strcmp0 (polkit_action_description_get_action_id (a),
+                    polkit_action_description_get_action_id (b));
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -196,6 +204,9 @@ main (int argc, char *argv[])
     }
   else
     {
+      actions = g_list_sort (actions,
+                             (GCompareFunc) action_desc_compare_by_action_id_func);
+
       for (l = actions; l != NULL; l = l->next)
         {
           PolkitActionDescription *action = POLKIT_ACTION_DESCRIPTION (l->data);


More information about the hal-commit mailing list