From owner-freebsd-ports@FreeBSD.ORG Mon Feb 11 18:44:51 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 D578016A41B for ; Mon, 11 Feb 2008 18:44:51 +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 995CC13C458 for ; Mon, 11 Feb 2008 18:44:51 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: by syn.atarininja.org (Postfix, from userid 1001) id 5EB385C5A; Mon, 11 Feb 2008 13:46:26 -0500 (EST) Date: Mon, 11 Feb 2008 13:46:26 -0500 From: Wesley Shields To: ports@FreeBSD.org Message-ID: <20080211184626.GH90004@atarininja.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yudcn1FV7Hsu/q59" Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: 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: Mon, 11 Feb 2008 18:44:51 -0000 --yudcn1FV7Hsu/q59 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 PS: I'm hoping to have time in a week or two to hack out similar functionality for pkg_add(1). --yudcn1FV7Hsu/q59 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 9 Feb 2008 00:08:31 -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 9 Feb 2008 00:08:32 -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,19 @@ .endif .endif +.if !target(collect-pkg-message) +collect-pkg-message: +.if defined(SHOW_ALL_PKG_MSGS) +.if exists(${PKGMESSAGE}) + @${ECHO_MSG} "===> Collecting pkg-message for later display." + @${ECHO_CMD} "pkg-message for ${PKGNAME}:" >> ${ALLPKGMSGS} + @${CAT} ${PKGMESSAGE} >> ${ALLPKGMSGS} +.endif +.else + @${DO_NADA} +.endif +.endif + .if !target(security-check) .if !defined(OLD_SECURITY_CHECK) @@ -4109,7 +4123,8 @@ _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 check-already-installed \ + collect-pkg-message _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 \ @@ -4817,15 +4832,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 \ @@ -5750,6 +5765,11 @@ .else @${DO_NADA} .endif +.if defined(SHOW_ALL_PKG_MSGS) + @if [ ${WRKDIR} = `dirname ${ALLPKGMSGS}` ]; then \ + ${PAGER} ${ALLPKGMSGS}; \ + fi; +.endif .endif # Depend is generally meaningless for arbitrary ports, but if someone wants --yudcn1FV7Hsu/q59--