From owner-freebsd-ports@FreeBSD.ORG Wed Feb 20 04:01:05 2008 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA22A16A401 for ; Wed, 20 Feb 2008 04:01:05 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: from syn.atarininja.org (syn.csh.rit.edu [129.21.60.158]) by mx1.freebsd.org (Postfix) with ESMTP id 898AB13C457 for ; Wed, 20 Feb 2008 04:01:05 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: by syn.atarininja.org (Postfix, from userid 1001) id D56455C5E; Tue, 19 Feb 2008 23:03:41 -0500 (EST) Date: Tue, 19 Feb 2008 23:03:41 -0500 From: Wesley Shields To: ports@FreeBSD.org Message-ID: <20080220040341.GA64876@atarininja.org> References: <20080211184626.GH90004@atarininja.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: <20080211184626.GH90004@atarininja.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: Re: Collecting pkg-message files? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2008 04:01:05 -0000 --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 11, 2008 at 01:46:26PM -0500, Wesley Shields wrote: > One of the things that often trips up new users is the fact that > pkg-message files scroll past their buffers when installing something > via ports. As such, they sometimes miss important post-installation > steps which need to be taken in order to finish the install. I've > attached a patch I've come up with to collect all the pkg-message files > during an install and display them at the end. > > In order to not be in violation of POLA I only collect the messages and > display them if SHOW_ALL_PKG_MSGS is defined. This way it won't get in > the way of any automated tools, and in some cases it may reduce the > complexity of those tools if they provide native support for this. > > I've barely tested this, but I'm due to get a new laptop in a few weeks > and plan to run this patch while I'm building and installing everything > I normally use. I'm curious if there is anyone else out there willing > to test this out before I submit a PR for it once it proves stable > during my new laptop install. Please let me know what you think and if > you run into any problems with it. > > -- WXS I've had one or two people report back on this. I've attached what I believe should fix their problem and ran it through a couple more builds of a handful of ports. If you want to test it out I'm attaching an updated version here. -- WXS --WIyZ46R2i8wDzkSu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="show-all-pkg-messages.diff" Index: bsd.commands.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.commands.mk,v retrieving revision 1.1 diff -u -u -r1.1 bsd.commands.mk --- bsd.commands.mk 4 Aug 2007 11:37:23 -0000 1.1 +++ bsd.commands.mk 20 Feb 2008 03:52:17 -0000 @@ -64,6 +64,7 @@ MV?= /bin/mv OBJCOPY?= /usr/bin/objcopy OBJDUMP?= /usr/bin/objdump +PAGER?= /usr/bin/less PASTE?= /usr/bin/paste PAX?= /bin/pax PRINTF?= /usr/bin/printf Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.589 diff -u -u -r1.589 bsd.port.mk --- bsd.port.mk 17 Oct 2007 10:12:24 -0000 1.589 +++ bsd.port.mk 20 Feb 2008 03:52:18 -0000 @@ -2313,6 +2313,7 @@ PKGMESSAGE?= ${PKGDIR}/pkg-message TMPPLIST?= ${WRKDIR}/.PLIST.mktmp +ALLPKGMSGS?= ${WRKDIR}/all-pkg-messages .for _CATEGORY in ${CATEGORIES} PKGCATEGORY?= ${_CATEGORY} @@ -3933,6 +3934,30 @@ .endif .endif +.if !target(collect-all-pkg-message) +collect-all-pkg-message: +.if defined(SHOW_ALL_PKG_MSGS) + @if [ -f ${PKGMESSAGE} ]; then \ + ${ECHO_MSG} "===> Collecting pkg-message for later display."; \ + ${ECHO_CMD} "pkg-message for ${PKGNAME}:" >> ${ALLPKGMSGS}; \ + ${CAT} ${PKGMESSAGE} >> ${ALLPKGMSGS}; \ + fi; +.else + @${DO_NADA} +.endif +.endif + +.if !target(display-all-pkg-message) +display-all-pkg-message: +.if defined(SHOW_ALL_PKG_MSGS) + @if [ ${WRKDIR} = `dirname ${ALLPKGMSGS}` -a -e ${ALLPKGMSGS} ]; then \ + ${PAGER} ${ALLPKGMSGS}; \ + fi; +.else + @${DO_NADA} +.endif +.endif + .if !target(security-check) .if !defined(OLD_SECURITY_CHECK) @@ -4109,13 +4134,15 @@ _INSTALL_DEP= build _INSTALL_SEQ= install-message check-conflicts \ run-depends lib-depends apply-slist pre-install \ - pre-install-script generate-plist check-already-installed + pre-install-script generate-plist collect-all-pkg-message \ + check-already-installed _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ pre-su-install-script do-install install-desktop-entries \ post-install post-install-script add-plist-info \ add-plist-docs add-plist-examples add-plist-data \ add-plist-post install-rc-script compress-man \ - install-ldconfig-file fake-pkg security-check + install-ldconfig-file fake-pkg security-check \ + display-all-pkg-message _PACKAGE_DEP= install _PACKAGE_SEQ= package-message pre-package pre-package-script \ do-package post-package-script @@ -4817,15 +4844,15 @@ dir=`${ECHO_CMD} $$dir | ${SED} -e 's/:.*//'`; \ if [ X${DEPENDS_PRECLEAN} != "X" ]; then \ target="clean $$target"; \ - depends_args="$$depends_args NOCLEANDEPENDS=yes"; \ + depends_args="$$depends_args NOCLEANDEPENDS=yes ALLPKGMSGS=${ALLPKGMSGS}"; \ fi; \ if [ X${DEPENDS_CLEAN} != "X" ]; then \ target="$$target clean"; \ - depends_args="$$depends_args NOCLEANDEPENDS=yes"; \ + depends_args="$$depends_args NOCLEANDEPENDS=yes ALLPKGMSGS=${ALLPKGMSGS}"; \ fi; \ else \ target="${DEPENDS_TARGET}"; \ - depends_args="${DEPENDS_ARGS}"; \ + depends_args="${DEPENDS_ARGS} ALLPKGMSGS=${ALLPKGMSGS}"; \ fi; \ if ${EXPR} "$$prog" : \\/ >/dev/null; then \ if [ -e "$$prog" ]; then \ --WIyZ46R2i8wDzkSu--