From e641b4384977011b93c3c2a90222d459bc4c5ca6 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Mon, 2 Jul 2012 22:04:22 -0500 Subject: Bring Back prefix support We now have a team member who is interested in OpenRC on prefix, so I am bringing it back to the main tree. --- runlevels/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'runlevels') diff --git a/runlevels/Makefile b/runlevels/Makefile index 25fa029f..c42b307a 100644 --- a/runlevels/Makefile +++ b/runlevels/Makefile @@ -53,24 +53,34 @@ install: if ! test -d "${SYSINITDIR}"; then \ ${INSTALL} -d ${SYSINITDIR} || exit $$?; \ for x in ${SYSINIT}; do \ - ln -snf ${PREFIX}/etc/init.d/"$$x" ${SYSINITDIR}/"$$x" || exit $$?; \ - done \ + if test -n "${PREFIX}"; then \ + grep -q "keyword .*-prefix" ${INITDIR}/"$$x" && continue; \ + fi; \ + ln -snf ${PREFIX}/etc/init.d/"$$x" ${SYSINITDIR}/"$$x" || exit $$?; done \ fi if ! test -d "${BOOTDIR}"; then \ ${INSTALL} -d ${BOOTDIR} || exit $$?; \ for x in ${BOOT}; do \ + if test -n "${PREFIX}"; then \ + grep -q "keyword .*-prefix" ${INITDIR}/"$$x" && continue; \ + fi; \ ln -snf ${PREFIX}/etc/init.d/"$$x" ${BOOTDIR}/"$$x" || exit $$?; \ done \ fi if ! test -d "${DEFAULTDIR}"; then \ ${INSTALL} -d ${DEFAULTDIR} || exit $$?; \ for x in ${DEFAULT}; do \ - ln -snf ${PREFIX}/etc/init.d/"$$x" ${DEFAULTDIR}/"$$x" || exit $$?; \ - done \ + if test -n "${PREFIX}"; then \ + grep -q "keyword .*-prefix" ${INITDIR}/"$$x" && continue; \ + fi; \ + ln -snf ${PREFIX}/etc/init.d/"$$x" ${DEFAULTDIR}/"$$x" || exit $$?; done \ fi if ! test -d "${SHUTDOWNDIR}"; then \ ${INSTALL} -d ${SHUTDOWNDIR} || exit $$?; \ for x in ${SHUTDOWN}; do \ + if test -n "${PREFIX}"; then \ + grep -q "keyword .*-prefix" ${INITDIR}/"$$x" && continue; \ + fi; \ ln -snf ${PREFIX}/etc/init.d/"$$x" ${SHUTDOWNDIR}/"$$x" || exit $$?; done \ fi -- cgit v1.2.3