From 52eb02fe814bb6c3f39d456481d10a66acd7d05e Mon Sep 17 00:00:00 2001 From: Ciaran McCreesh Date: Fri, 20 Aug 2010 20:02:13 +0100 Subject: accounts -> Process --- paludis/repositories/accounts/passwd_accounts_handler.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/paludis/repositories/accounts/passwd_accounts_handler.cc b/paludis/repositories/accounts/passwd_accounts_handler.cc index 3ed16c0f0..e5d5eee4f 100644 --- a/paludis/repositories/accounts/passwd_accounts_handler.cc +++ b/paludis/repositories/accounts/passwd_accounts_handler.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009 Ciaran McCreesh + * Copyright (c) 2009, 2010 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -199,9 +200,9 @@ PasswdAccountsHandler::merge_user(const MergeParams & params) home = " -d '" + home + "'"; } while (false); - Command cmd("useradd -r " + username + preferred_uid + gecos + primary_group + extra_groups + shell + home); - cmd.with_echo_to_stderr(); - int exit_status(run_command(cmd)); + Process process(ProcessCommand({ "sh", "-c", "useradd -r " + username + preferred_uid + gecos + primary_group + extra_groups + shell + home })); + process.echo_command_to(params.output_manager()->stderr_stream()); + int exit_status(process.run().wait()); if (0 != exit_status) throw ActionFailedError("Install of '" + stringify(*params.package_id()) + "' failed because useradd returned " @@ -255,9 +256,9 @@ PasswdAccountsHandler::merge_group(const MergeParams & params) preferred_gid = " -g '" + preferred_gid + "'"; } while (false); - Command cmd("groupadd -r " + groupname + preferred_gid); - cmd.with_echo_to_stderr(); - int exit_status(run_command(cmd)); + Process process(ProcessCommand({ "sh", "-c", "groupadd -r " + groupname + preferred_gid })); + process.echo_command_to(params.output_manager()->stderr_stream()); + int exit_status(process.run().wait()); if (0 != exit_status) throw ActionFailedError("Install of '" + stringify(*params.package_id()) + "' failed because groupadd returned " -- cgit v1.2.3