Commit 320ccfdf authored by Guillaume Benoit's avatar Guillaume Benoit

[cli] remove uneeded dbus-launch

parent 37c81319
......@@ -48,14 +48,6 @@ namespace Pamac {
trans_cancellable = false;
waiting = false;
overwrite_files = {};
if (Posix.geteuid () != 0) {
// Use tty polkit authentication agent
try {
pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE);
} catch (Error e) {
stdout.printf ("%s: %s\n", dgettext (null, "Error"), e.message);
}
}
// watch CTRl + C
Unix.signal_add (Posix.Signal.INT, trans_cancel);
}
......@@ -445,6 +437,14 @@ namespace Pamac {
transaction.stop_building.connect (() => {
trans_cancellable = false;
});
if (Posix.geteuid () != 0) {
// Use tty polkit authentication agent
try {
pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE);
} catch (Error e) {
stdout.printf ("%s: %s\n", dgettext (null, "Error"), e.message);
}
}
}
bool trans_cancel () {
......@@ -1896,22 +1896,6 @@ namespace Pamac {
}
public static int main (string[] args) {
if (Posix.geteuid () != 0) {
// set dbus environment variable to allow launch in tty
try {
var process = new Subprocess.newv ({"dbus-launch"}, SubprocessFlags.STDOUT_PIPE | SubprocessFlags.STDERR_SILENCE);
var dis = new DataInputStream (process.get_stdout_pipe ());
string? line;
while ((line = dis.read_line ()) != null) {
string[] splitted = line.split ("=", 2);
unowned string key = splitted[0];
unowned string? val = splitted[1];
Environment.set_variable (key, val, true);
}
} catch (Error e) {
stderr.printf (e.message);
}
}
// i18n
Intl.textdomain ("pamac");
Intl.setlocale (LocaleCategory.ALL, "");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment