[jhbuild] systeminstall: Also support sudo



commit 5faf6467fbcb31fcbc7696ec85ca55a9f8fa9114
Author: Colin Walters <walters verbum org>
Date:   Thu Sep 29 10:44:55 2011 -0400

    systeminstall: Also support sudo

 jhbuild/utils/systeminstall.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/utils/systeminstall.py b/jhbuild/utils/systeminstall.py
index 860c73a..93d0581 100644
--- a/jhbuild/utils/systeminstall.py
+++ b/jhbuild/utils/systeminstall.py
@@ -51,9 +51,12 @@ def get_installed_pkgconfigs(config):
 
 class SystemInstall(object):
     def __init__(self):
-        if not cmds.has_command('pkexec'):
+        if cmds.has_command('pkexec'):
+            self._root_command_prefix_args = ['pkexec']
+        elif cmds.has_command('sudo'):
+            self._root_command_prefix_args = ['sudo']
+        else:
             raise SystemExit, _('No suitable root privilege command found; you should install "pkexec"')
-        self._root_command_prefix_args = ['pkexec']
 
     def install(self, pkgconfig_ids):
         """Takes a list of pkg-config identifiers and uses a system-specific method to install them."""



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]