aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2019-08-15 19:49:15 -0400
committerJason Woodward2019-08-16 00:34:34 -0400
commit0a8c4c504a181c8406bd57fad17554b3aac38f3f (patch)
treed1c5db15afb0e174d503da76f1a18182eed64e86
parente4d2c1897850a4e69cfb34fc675565584dfd766b (diff)
downloadslapt-update-service-0a8c4c504a181c8406bd57fad17554b3aac38f3f.tar.gz
add gslapt-polkit helper support
-rw-r--r--configure.ac13
-rw-r--r--slack-required2
-rw-r--r--src/client.c10
3 files changed, 21 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 4e9a1d5..6bf9951 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,12 @@ AC_ARG_WITH(
[ac_cv_prog_KDESU=$withval],
[AC_CHECK_PROG([KDESU], [kdesu], yes, [no])]
)
+AC_ARG_WITH(
+ [gslapt-polkit],
+ AC_HELP_STRING([--with-gslapt-polkit], [use gslapt-polkit helper (default is auto)]),
+ [ac_cv_prog_GSLAPTPOLKIT=$withval],
+ [AC_CHECK_PROG([GSLAPTPOLKIT], [gslapt-polkit], yes, [no])]
+)
if test "$ac_cv_prog_GNOMESU" = "yes"; then
AC_DEFINE(HAS_GNOMESU, 1, [has gnomesu])
@@ -120,8 +126,11 @@ fi
if test "$ac_cv_prog_KDESU" = "yes"; then
AC_DEFINE(HAS_KDESU, 1, [has kdesu])
fi
-if test "$ac_cv_prog_GNOMESU" = "no" -a "$ac_cv_prog_GKSU" = "no" -a "$ac_cv_prog_KDESU" = "no"; then
- AC_MSG_ERROR([gnomesu, gksu, or kdesu is required. please specify one with --with-APPNAME=yes.])
+if test "$ac_cv_prog_GSLAPTPOLKIT" = "yes"; then
+ AC_DEFINE(HAS_GSLAPTPOLKIT, 1, [has gslapt-polkit helper])
+fi
+if test "$ac_cv_prog_GNOMESU" = "no" -a "$ac_cv_prog_GKSU" = "no" -a "$ac_cv_prog_KDESU" = "no" -a "$ac_cv_prog_GSLAPTPOLKIT" = "no"; then
+ AC_MSG_ERROR([gnomesu, gksu, kdesu, or gslapt-polkit is required. please specify one with --with-APPNAME=yes.])
fi
# translations
diff --git a/slack-required b/slack-required
index 151fcd3..aa3eb85 100644
--- a/slack-required
+++ b/slack-required
@@ -1,4 +1,4 @@
gtk+2
libnotify
gslapt
-libgnomesu | gksu | kdesu
+polkit | libgnomesu | gksu | kdesu
diff --git a/src/client.c b/src/client.c
index 77b2d87..136ab12 100644
--- a/src/client.c
+++ b/src/client.c
@@ -53,7 +53,15 @@ static void hide_sun(void);
static void run_gslapt(const char *action)
{
gchar *argv[4];
-#if defined(HAS_GNOMESU)
+#if defined(HAS_GSLAPTPOLKIT)
+ argv[0] = "/usr/bin/gslapt-polkit";
+ if (strcmp(action, "upgrade") == 0) {
+ argv[1] = "--upgrade";
+ } else {
+ argv[1] = NULL;
+ }
+ argv[2] = NULL;
+#elif defined(HAS_GNOMESU)
argv[0] = "/usr/bin/gnomesu";
argv[1] = "-c";
if (strcmp(action, "upgrade") == 0) {