aboutsummaryrefslogtreecommitdiff
path: root/src/rc-update/rc-update.c
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-03-14 19:03:52 -0300
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-10-19 10:56:54 +0200
commit9efa44579fd1f60a4c9ace264bb0b968ccb0f7ea (patch)
tree71f6d00e0fe41ae3ac338c6dba21c75f7cb74528 /src/rc-update/rc-update.c
parentb80971ce08dd080529efaf694afc67846e0748b8 (diff)
openrc: Add support for user services.
Modifies many functions where filesystem paths were hardcoded. In non-user-services mode, they still are. In user-services mode, they are allocated, since XDG_ dirs are to be set via environment variables. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'src/rc-update/rc-update.c')
-rw-r--r--src/rc-update/rc-update.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rc-update/rc-update.c b/src/rc-update/rc-update.c
index 64d781a5..f4bbbe88 100644
--- a/src/rc-update/rc-update.c
+++ b/src/rc-update/rc-update.c
@@ -36,17 +36,27 @@ const char *usagestring = "" \
"Usage: rc-update [options] add <service> [<runlevel>...]\n" \
" or: rc-update [options] del <service> [<runlevel>...]\n" \
" or: rc-update [options] [show [<runlevel>...]]";
-const char getoptstring[] = "asu" getoptstring_COMMON;
+const char getoptstring[] = "asu" getoptstring_COMMON
+#ifdef RC_USER_SERVICES
+getoptstring_USER_SERVICES
+#endif
+;
const struct option longopts[] = {
{ "all", 0, NULL, 'a' },
{ "stack", 0, NULL, 's' },
{ "update", 0, NULL, 'u' },
+#ifdef RC_USER_SERVICES
+ longopts_USER_SERVICES
+#endif
longopts_COMMON
};
const char * const longopts_help[] = {
"Process all runlevels",
"Stack a runlevel instead of a service",
"Force an update of the dependency tree",
+#ifdef RC_USER_SERVICES
+ longopts_help_USER_SERVICES
+#endif
longopts_help_COMMON
};
@@ -236,6 +246,9 @@ int main(int argc, char **argv)
if (deptree)
rc_deptree_free(deptree);
return ret;
+#ifdef RC_USER_SERVICES
+ case_RC_USER_SERVICES
+#endif
case_RC_COMMON_GETOPT
}