Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop PREFIX macro and fix for Gentoo prefix #686

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion man/openrc-run.8
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ A special variable to describe the system more.
Possible values are OPENVZ, XENU, XEN0, UML and VSERVER.
.It Va RC_PREFIX
In a Gentoo Prefix installation, this variable contains the prefix
offset. Otherwise it is undefined.
offset. Otherwise it is empty string.
.It Va RC_UNAME
The result of `uname -s`.
.It Va RC_CMD
Expand Down
4 changes: 0 additions & 4 deletions src/librc/librc.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ get_systype(void)
static const char *
detect_prefix(const char *systype)
{
#ifdef PREFIX
return RC_SYS_PREFIX;
#else
if (systype) {
if (strcmp(systype, RC_SYS_NONE) == 0)
return NULL;
Expand All @@ -245,7 +242,6 @@ detect_prefix(const char *systype)
}

return NULL;
#endif
}

static const char *
Expand Down
5 changes: 2 additions & 3 deletions src/librc/rc.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ extern "C" {
#define RC_SYSCONFDIR "@SYSCONFDIR@"
#define RC_LIBDIR "@PREFIX@/@LIB@/rc"
#define RC_LIBEXECDIR "@LIBEXECDIR@"
#if defined(PREFIX)
#define RC_SVCDIR RC_LIBEXECDIR "/init.d"
#elif defined(__linux__) || (defined(__FreeBSD_kernel__) && \
#if defined(__linux__) || (defined(__FreeBSD_kernel__) && \
defined(__GLIBC__)) || defined(__GNU__)
#define RC_SVCDIR "/run/openrc"
#define RC_SVCDIR RC_PREFIX "/run/openrc"
#else
#define RC_SVCDIR RC_LIBEXECDIR "/init.d"
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/shared/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ env_config(void)
if (sys)
setenv("RC_SYS", sys, 1);

#ifdef PREFIX
setenv("RC_PREFIX", RC_PREFIX, 1);
#endif

/* Some scripts may need to take a different code path if
Linux/FreeBSD, etc
Expand Down
Loading