diff options
author | 2010-08-20 20:02:13 +0100 | |
---|---|---|
committer | 2010-08-21 19:57:03 +0100 | |
commit | 52eb02fe814bb6c3f39d456481d10a66acd7d05e (patch) | |
tree | 9d2a415bb61b5ce300be85419772e96914656871 | |
parent | 62018097a314bd8d4e11ba5c769e0dfd3135fa2d (diff) | |
download | paludis-52eb02fe814bb6c3f39d456481d10a66acd7d05e.tar.gz paludis-52eb02fe814bb6c3f39d456481d10a66acd7d05e.tar.xz |
accounts -> Process
-rw-r--r-- | paludis/repositories/accounts/passwd_accounts_handler.cc | 15 |
1 files 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 <paludis/util/set.hh> #include <paludis/util/destringify.hh> #include <paludis/util/join.hh> +#include <paludis/util/process.hh> #include <paludis/output_manager.hh> #include <paludis/action.hh> #include <paludis/repository.hh> @@ -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 " |