From owner-svn-ports-all@freebsd.org Mon Jan 4 15:22:30 2021 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 293BC4D8FEA; Mon, 4 Jan 2021 15:22:30 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mouf.net (mouf.net [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mouf.net", Issuer "mouf.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8fWV0Xmtz4r77; Mon, 4 Jan 2021 15:22:29 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from lrrr.mouf.net (cpe-76-182-16-135.nc.res.rr.com [76.182.16.135]) (authenticated bits=0) by mouf.net (8.14.9/8.14.9) with ESMTP id 104FMGGt031592 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 4 Jan 2021 15:22:21 GMT (envelope-from swills@FreeBSD.org) Subject: Re: svn commit: r560241 - head/devel/readline To: Sunpoet Po-Chuan Hsieh , ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org References: <202101032029.103KTsw0028112@repo.freebsd.org> From: Steve Wills Message-ID: <5d52f437-618a-0da2-c8eb-a403a7e401fc@FreeBSD.org> Date: Mon, 4 Jan 2021 10:22:10 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <202101032029.103KTsw0028112@repo.freebsd.org> Content-Type: multipart/mixed; boundary="------------FE3EAB1EEA7002706B7D9A49" Content-Language: en-US X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mouf.net [199.48.129.64]); Mon, 04 Jan 2021 15:22:22 +0000 (UTC) X-Spam-Status: No, score=-0.7 required=4.5 tests=KHOP_HELO_FCRDNS, NICE_REPLY_A autolearn=unavailable autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mouf.net X-Virus-Scanned: clamav-milter 0.99.2 at mouf.net X-Virus-Status: Clean X-Rspamd-Queue-Id: 4D8fWV0Xmtz4r77 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2021 15:22:30 -0000 This is a multi-part message in MIME format. --------------FE3EAB1EEA7002706B7D9A49 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, I think the attached patch would be better for two reasons. First, because sed (REINPLACE_CMD) will fail silently if the referenced line is not found, applying a patch and then replacing it helps us know if the code gets refactored in a way that makes our REINPLACE_CMD ineffective (such as the line getting moved to a different file, for example). And second, because PREFIX should be used, since this is changing where files that are a part of this package are located. (LOCALBASE is where we find files installed by other packages.) Cheers, Steve On 1/3/21 3:29 PM, Sunpoet Po-Chuan Hsieh wrote: > Author: sunpoet > Date: Sun Jan 3 20:29:54 2021 > New Revision: 560241 > URL: https://svnweb.freebsd.org/changeset/ports/560241 > > Log: > Read inputrc from LOCALBASE/etc/inputrc rather than /etc/inputrc > > - Bump PORTREVISION for package change > > PR: 247933 > Reported by: Michael Osipov > > Modified: > head/devel/readline/Makefile > > Modified: head/devel/readline/Makefile > ============================================================================== > --- head/devel/readline/Makefile Sun Jan 3 20:29:49 2021 (r560240) > +++ head/devel/readline/Makefile Sun Jan 3 20:29:54 2021 (r560241) > @@ -3,6 +3,7 @@ > > PORTNAME= readline > PORTVERSION= 8.0.${PATCHLEVEL} > +PORTREVISION= 1 > CATEGORIES= devel > MASTER_SITES= GNU > DISTNAME= ${PORTNAME}-${PORTVERSION:R} > @@ -37,6 +38,7 @@ PATCHFILES+= ${PORTNAME}${PORTVERSION:R:S|.||}-${patch > .endfor > > post-patch: > + @${REINPLACE_CMD} -e '/SYS_INPUTRC/ s|/etc/inputrc|${LOCALBASE}&|' ${WRKSRC}/rlconf.h > .if exists(/usr/lib/libtermcapw.so) > @${REINPLACE_CMD} 's|-ltermcap|-ltermcapw|g' ${WRKSRC}/configure > .endif > --------------FE3EAB1EEA7002706B7D9A49 Content-Type: text/x-patch; charset=UTF-8; name="readline_reinplace-rev0.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="readline_reinplace-rev0.diff" diff --git devel/readline/Makefile devel/readline/Makefile index 34820ecedc0d..36a5590c925e 100644 --- devel/readline/Makefile +++ devel/readline/Makefile @@ -38,7 +38,7 @@ PATCHFILES+= ${PORTNAME}${PORTVERSION:R:S|.||}-${patch:S|^|00|:S|.*(...)$|\1|} .endfor post-patch: - @${REINPLACE_CMD} -e '/SYS_INPUTRC/ s|/etc/inputrc|${LOCALBASE}&|' ${WRKSRC}/rlconf.h + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/rlconf.h .if exists(/usr/lib/libtermcapw.so) @${REINPLACE_CMD} 's|-ltermcap|-ltermcapw|g' ${WRKSRC}/configure .endif diff --git devel/readline/files/patch-rlconf.h devel/readline/files/patch-rlconf.h new file mode 100644 index 000000000000..2fc7de2dff9d --- /dev/null +++ devel/readline/files/patch-rlconf.h @@ -0,0 +1,11 @@ +--- rlconf.h.orig 2021-01-04 15:13:43 UTC ++++ rlconf.h +@@ -43,7 +43,7 @@ + #define DEFAULT_INPUTRC "~/.inputrc" + + /* The ultimate last-ditch filename for an init file -- system-wide. */ +-#define SYS_INPUTRC "/etc/inputrc" ++#define SYS_INPUTRC "%%PREFIX%%/etc/inputrc" + + /* If defined, expand tabs to spaces. */ + #define DISPLAY_TABS --------------FE3EAB1EEA7002706B7D9A49--