Date: Thu, 27 Jul 2006 12:50:13 +0200 (CEST) From: Matthias Andree <matthias.andree@gmx.de> To: FreeBSD-gnats-submit@FreeBSD.org Cc: portmgr@FreeBSD.org Subject: ports/100915: [PATCH] Mk/bsd.port.mk: export rc.subr script suffix Message-ID: <20060727105013.E2F74C564@merlin.emma.line.org> Resent-Message-ID: <200607271100.k6RB0Um8020265@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 100915 >Category: ports >Synopsis: [PATCH] Mk/bsd.port.mk: export rc.subr script suffix >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jul 27 11:00:29 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Matthias Andree >Release: FreeBSD 6.1-STABLE i386 >Organization: >Environment: System: FreeBSD merlin.emma.line.org 6.1-STABLE FreeBSD 6.1-STABLE #7: Mon Jul 17 11:17:59 CEST 2006 toor@merlin.emma.line.org:/usr/obj/usr/src/sys/GENERIC i386 >Description: portmgr - as maintainer for Mk/bsd.port.mk - is Cc'd. The install-rc-script target in ports/Mk/bsd.port.mk performs this check: .if (${OSVERSION} >= 700007 || ( ${OSVERSION} < 700000 && ${OSVERSION} >= 600101 )) to determine if it should install USE_RC_SUBR files with or without .sh suffix. However, the result of this check is of wider interest, as it may be useful to substitute this in a files/pkg-message.in or similar, as used by the upcoming 2.0.6_1 revision of the security/openvpn port, or to check if the build and execution environments match, to prevent users from installing newer 6.1 packages on 6.0-RELEASE installs which only results in pain and complaining about non-working rc.d scripts. I suggest to export a variable, perhaps RC_SUBR_SUFFIX, that a port's Makefile can query after including bsd.port.pre.mk that is either empty or ".sh". Suggested patch attached, which also simplifies the install-rc-script target. I am sending the patch as context diff, because it is easier to review this way than unified format could be. Please review and apply. Thank you! >How-To-Repeat: >Fix: WARNING - This is untested! *** bsd.port.mk.orig Tue Jul 18 06:12:51 2006 --- bsd.port.mk Thu Jul 27 12:39:42 2006 *************** *** 5244,5249 **** --- 5244,5257 ---- .endif .endif + # The name of installed rc.subr-based start scripts changed + # with the rcorder(8) integration. Export their suffix. + .if (${OSVERSION} >= 700007 || ( ${OSVERSION} < 700000 && ${OSVERSION} >= 600101 )) + RC_SUBR_SUFFIX?= + .else + RC_SUBR_SUFFIX?=.sh + .fi + .if !target(install-rc-script) install-rc-script: .if defined(USE_RCORDER) || defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES" *************** *** 5259,5275 **** .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES" @${ECHO_CMD} "===> Installing rc.d startup script(s)" @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST} - .if (${OSVERSION} >= 700007 || ( ${OSVERSION} < 700000 && ${OSVERSION} >= 600101 )) - @for i in ${USE_RC_SUBR}; do \ - ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d/$${i%.sh}; \ - ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \ - done - .else @for i in ${USE_RC_SUBR}; do \ ! ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d/$${i%.sh}.sh; \ ! ${ECHO_CMD} "etc/rc.d/$${i%.sh}.sh" >> ${TMPPLIST}; \ done - .endif .endif .else @${DO_NADA} --- 5267,5276 ---- .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES" @${ECHO_CMD} "===> Installing rc.d startup script(s)" @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST} @for i in ${USE_RC_SUBR}; do \ ! ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d/$${i%.sh}${RC_SUBR_SUFFIX}; \ ! ${ECHO_CMD} "etc/rc.d/$${i%.sh}${RC_SUBR_SUFFIX}" >> ${TMPPLIST}; \ done .endif .else @${DO_NADA} >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060727105013.E2F74C564>