From 5c403e351844e5aa07428431c3d15e70431a3807 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 6 Dec 2012 22:21:45 +0100 Subject: daemon: Add more options. * nix/nix-daemon/guix-daemon.cc (GUIX_OPT_BUILD_USERS_GROUP, GUIX_OPT_CACHE_FAILURES, GUIX_OPT_LOSE_LOGS, GUIX_OPT_DISABLE_STORE_OPTIMIZATION, GUIX_OPT_IMPERSONATE_LINUX_26): New macros. (options)["build-users-group", "cache-failures", "lose-logs", "disable-store-optimization", "impersonate-linux-2.6"]: New options. (parse_opt): Handle them. --- nix/nix-daemon/guix-daemon.cc | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index 7a3b178eab..6bbea52196 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc @@ -50,7 +50,12 @@ builds derivations on behalf of its clients."; #define GUIX_OPT_SYSTEM 1 #define GUIX_OPT_DISABLE_CHROOT 2 -#define GUIX_OPT_DISABLE_LOG_COMPRESSION 3 +#define GUIX_OPT_BUILD_USERS_GROUP 3 +#define GUIX_OPT_CACHE_FAILURES 4 +#define GUIX_OPT_LOSE_LOGS 5 +#define GUIX_OPT_DISABLE_LOG_COMPRESSION 6 +#define GUIX_OPT_DISABLE_STORE_OPTIMIZATION 7 +#define GUIX_OPT_IMPERSONATE_LINUX_26 8 static const struct argp_option options[] = { @@ -67,8 +72,22 @@ static const struct argp_option options[] = "this option has no effect)" #endif }, + { "build-users-group", GUIX_OPT_BUILD_USERS_GROUP, "GROUP", 0, + "Perform builds as a user of GROUP" }, + { "cache-failures", GUIX_OPT_CACHE_FAILURES, 0, 0, + "Cache build failures" }, + { "lose-logs", GUIX_OPT_LOSE_LOGS, 0, 0, + "Do not keep build logs" }, { "disable-log-compression", GUIX_OPT_DISABLE_LOG_COMPRESSION, 0, 0, "Disable compression of the build logs" }, + { "disable-store-optimization", GUIX_OPT_DISABLE_STORE_OPTIMIZATION, 0, 0, + "Disable automatic file \"deduplication\" in the store" }, + { "impersonate-linux-2.6", GUIX_OPT_IMPERSONATE_LINUX_26, 0, 0, + "Impersonate Linux 2.6" +#ifndef HAVE_SYS_PERSONALITY_H + " (this option has no effect in this configuration)" +#endif + }, { 0, 0, 0, 0, 0 } }; @@ -84,6 +103,21 @@ parse_opt (int key, char *arg, struct argp_state *state) case GUIX_OPT_DISABLE_LOG_COMPRESSION: settings.compressLog = false; break; + case GUIX_OPT_BUILD_USERS_GROUP: + settings.buildUsersGroup = arg; + break; + case GUIX_OPT_DISABLE_STORE_OPTIMIZATION: + settings.autoOptimiseStore = false; + break; + case GUIX_OPT_CACHE_FAILURES: + settings.cacheFailure = true; + break; + case GUIX_OPT_IMPERSONATE_LINUX_26: + settings.impersonateLinux26 = true; + break; + case GUIX_OPT_LOSE_LOGS: + settings.keepLog = false; + break; case 'C': settings.buildCores = atoi (arg); break; -- cgit 1.4.1