From f092045650faad778d25d000d80b3128664d2e2a Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 28 Feb 2008 11:08:49 +0000 Subject: Support the use of PREFIX and PKG_PREFIX. --- src/librc/Makefile | 2 -- src/librc/librc-depend.c | 8 ++++++-- src/librc/librc.c | 12 ++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'src/librc') diff --git a/src/librc/Makefile b/src/librc/Makefile index 888155b8..880a56e7 100644 --- a/src/librc/Makefile +++ b/src/librc/Makefile @@ -13,7 +13,5 @@ LDADD+= ${LIBKVM} CFLAGS+= -I../includes -SHLIBDIR= /${LIBNAME} - include ${MK}/cc.mk include ${MK}/lib.mk diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c index cf978d63..1ab2b604 100644 --- a/src/librc/librc-depend.c +++ b/src/librc/librc-depend.c @@ -696,8 +696,12 @@ bool rc_deptree_update_needed (void) if (! existss (RC_DEPTREE) || ! rc_newer_than (RC_DEPTREE, RC_INITDIR) || ! rc_newer_than (RC_DEPTREE, RC_CONFDIR) || - ! rc_newer_than (RC_DEPTREE, RC_INITDIR_LOCAL) || - ! rc_newer_than (RC_DEPTREE, RC_CONFDIR_LOCAL) || +#ifdef RC_PKG_INITDIR + ! rc_newer_than (RC_DEPTREE, RC_PKG_INITDIR) || +#endif +#ifdef RC_PKG_CONFDIR + ! rc_newer_than (RC_DEPTREE, RC_PKG_CONFDIR) || +#endif ! rc_newer_than (RC_DEPTREE, "/etc/rc.conf")) return (true); diff --git a/src/librc/librc.c b/src/librc/librc.c index 12d31348..552e083d 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -328,11 +328,13 @@ char *rc_service_resolve (const char *service) snprintf (buffer, sizeof (buffer), RC_INITDIR "/%s", service); /* So we don't exist in /etc/init.d - check /usr/local/etc/init.d */ +#ifdef RC_PKG_INITDIR if (stat (buffer, &buf) != 0) { - snprintf (buffer, sizeof (buffer), RC_INITDIR_LOCAL "/%s", service); + snprintf (buffer, sizeof (buffer), RC_PKG_INITDIR "/%s", service); if (stat (buffer, &buf) != 0) return (NULL); } +#endif return (xstrdup (buffer)); } @@ -781,12 +783,18 @@ char **rc_services_in_runlevel (const char *runlevel) if (! runlevel) { int i; - char **local = ls_dir (RC_INITDIR_LOCAL, LS_INITD); +#ifdef RC_PKG_INITDIR + char **local = ls_dir (RC_PKG_INITDIR, LS_INITD); +#endif list = ls_dir (RC_INITDIR, LS_INITD); + +#ifdef RC_PKG_INITDIR STRLIST_FOREACH (local, dir, i) rc_strlist_addsortu (&list, dir); rc_strlist_free (local); +#endif + return (list); } -- cgit v1.2.3