Date: Thu, 10 Aug 2006 17:01:41 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 103581 for review Message-ID: <200608101701.k7AH1fCm037320@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=103581 Change 103581 by gabor@gabor_spitfire on 2006/08/10 17:00:44 Add CHROOTDESTDIR macro to avoid code duplication and make the chrooting processes simpler. This is set to ${CHROOT} ${DESTDIR} if DESTDIR is set, anyway it is epmty. Idea by: John E. Hein <jhein at timing dot com> Affected files ... .. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#77 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#77 (text+ko) ==== @@ -1171,6 +1171,10 @@ IS_JAILED!= if [ `${SYSCTL} -n security.jail.jailed` = "1" ] ; then ${ECHO_CMD} YES; fi; .endif +.if defined(DESTDIR) +CHROOTDESTDIR= ${CHROOT} ${DESTDIR} +.endif + # Get the object format. .if !defined(PORTOBJFORMAT) PORTOBJFORMAT!= ${TEST} -x /usr/bin/objformat && /usr/bin/objformat || ${ECHO_CMD} aout @@ -1390,23 +1394,12 @@ .endif .if defined(USE_LINUX_PREFIX) -.if !defined(DESTDIR) -LDCONFIG_CMD?= ${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL} -LDCONFIG_PLIST_EXEC_CMD?= ${LDCONFIG_CMD} -LDCONFIG_PLIST_UNEXEC_CMD?= ${LDCONFIG_CMD} -.else -LDCONFIG_CMD?= ${CHROOT} ${DESTDIR} ${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL} +LDCONFIG_CMD?= ${CHROOTDESTDIR} ${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL} LDCONFIG_PLIST_EXEC_CMD?= ${LDCONFIG_CMD} LDCONFIG_PLIST_UNEXEC_CMD?= ${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL} -.endif .else -.if !defined(DESTDIR) -LDCONFIG_CMD?= ${LDCONFIG} -m ${LDCONFIG_RUNLIST} -LDCONFIG_PLIST_EXEC_CMD?= ${LDCONFIG} -m ${LDCONFIG_PLIST} -.else -LDCONFIG_CMD?= ${CHROOT} ${DESTDIR} ${LDCONFIG} -m ${LDCONFIG_RUNLIST} -LDCONFIG_PLIST_EXEC_CMD?= ${CHROOT} ${DESTDIR} ${LDCONFIG} -m ${LDCONFIG_PLIST} -.endif +LDCONFIG_CMD?= ${CHROOTDESTDIR} ${LDCONFIG} -m ${LDCONFIG_RUNLIST} +LDCONFIG_PLIST_EXEC_CMD?= ${CHROOTDESTDIR} ${LDCONFIG} -m ${LDCONFIG_PLIST} LDCONFIG_PLIST_UNEXEC_CMD?= ${LDCONFIG} -R .endif @@ -2311,33 +2304,18 @@ .if ${OSVERSION} < 491101 && ${PKGORIGIN} != "sysutils/pkg_install" EXTRACT_DEPENDS+= ${LOCALBASE}/sbin/pkg_info:${PORTSDIR}/sysutils/pkg_install .endif -.if !defined(DESTDIR) PKG_CMD?= ${LOCALBASE_REL}/sbin/pkg_create -PKG_ADD?= ${LOCALBASE_REL}/sbin/pkg_add -PKG_DELETE?= ${LOCALBASE_REL}/sbin/pkg_delete -PKG_INFO?= ${LOCALBASE_REL}/sbin/pkg_info -PKG_VERSION?= ${LOCALBASE_REL}/sbin/pkg_version -.else -PKG_CMD?= ${LOCALBASE_REL}/sbin/pkg_create -PKG_ADD?= ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_add -PKG_DELETE?= ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_delete -PKG_INFO?= ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_info -.endif +PKG_ADD?= ${CHROOTDESTDIR} ${LOCALBASE_REL}/sbin/pkg_add +PKG_DELETE?= ${CHROOTDESTDIR} ${LOCALBASE_REL}/sbin/pkg_delete +PKG_INFO?= ${CHROOTDESTDIR} ${LOCALBASE_REL}/sbin/pkg_info +PKG_VERSION?= ${CHROOTDESTDIR} ${LOCALBASE_REL}/sbin/pkg_version .else -.if !defined(DESTDIR) PKG_CMD?= /usr/sbin/pkg_create -PKG_ADD?= /usr/sbin/pkg_add -PKG_DELETE?= /usr/sbin/pkg_delete -PKG_INFO?= /usr/sbin/pkg_info -PKG_VERSION?= /usr/sbin/pkg_version -.else -PKG_CMD?= /usr/sbin/pkg_create -PKG_ADD?= ${CHROOT} ${DESTDIR} /usr/sbin/pkg_add -PKG_DELETE?= ${CHROOT} ${DESTDIR} /usr/sbin/pkg_delete -PKG_INFO?= ${CHROOT} ${DESTDIR} /usr/sbin/pkg_info -PKG_VERSION?= ${CHROOT} ${DESTDIR} /usr/sbin/pkg_version +PKG_ADD?= ${CHROOTDESTDIR} /usr/sbin/pkg_add +PKG_DELETE?= ${CHROOTDESTDIR} /usr/sbin/pkg_delete +PKG_INFO?= ${CHROOTDESTDIR} /usr/sbin/pkg_info +PKG_VERSION?= ${CHROOTDESTDIR} /usr/sbin/pkg_version .endif -.endif # Does the pkg_create tool support conflict checking? # XXX Slow? @@ -3419,7 +3397,7 @@ ${LDCONFIG} -m ${USE_LDCONFIG} .else @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR}" - ${CHROOT} ${DESTDIR} ${LDCONFIG} -m ${USE_LDCONFIG} + ${CHROOTDESTDIR}} ${LDCONFIG} -m ${USE_LDCONFIG} .endif .else .if !defined(DESTDIR) @@ -3427,7 +3405,7 @@ -${LDCONFIG} -m ${USE_LDCONFIG} .else @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR} (errors are ignored)" - ${CHROOT} ${DESTDIR} -${LDCONFIG} -m ${USE_LDCONFIG} + ${CHROOTDESTDIR} -${LDCONFIG} -m ${USE_LDCONFIG} .endif .endif .if ${USE_LDCONFIG:L} != "${PREFIX}/lib" @@ -3450,7 +3428,7 @@ ${LDCONFIG} -32 -m ${USE_LDCONFIG32} .else @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR}" - ${CHROOT} ${DESTDIR} ${LDCONFIG} -32 -m ${USE_LDCONFIG32} + ${CHROOTDESTDIR} ${LDCONFIG} -32 -m ${USE_LDCONFIG32} .endif .else .if !defined(DESTDIR) @@ -3458,7 +3436,7 @@ -${LDCONFIG} -32 -m ${USE_LDCONFIG32} .else @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR} (errors are ignored)" - ${CHROOT} ${DESTDIR} -${LDCONFIG} -32 -m ${USE_LDCONFIG32} + ${CHROOTDESTDIR} -${LDCONFIG} -32 -m ${USE_LDCONFIG32} .endif .endif @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file" @@ -4488,7 +4466,7 @@ fi; \ else \ ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library in ${DESTDIR}: $$lib"; \ - if ${CHROOT} ${DESTDIR} ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ + if ${CHROOTDESTDIR} ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ ${ECHO_MSG} " - found"; \ if [ ${_DEPEND_ALWAYS} = 1 ]; then \ ${ECHO_MSG} " (but building it anyway)"; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608101701.k7AH1fCm037320>