Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jan 2021 11:22:18 -0500
From:      Steve Wills <swills@FreeBSD.org>
To:        Po-Chuan Hsieh <sunpoet@freebsd.org>
Cc:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   Re: svn commit: r560241 - head/devel/readline
Message-ID:  <8ffc93fb-5efb-d40b-edf0-591ca3cf2676@FreeBSD.org>
In-Reply-To: <CAMHz58SirFY8zaCWUnJigoj0AnHh6WLvZeGC%2B1kwuSrV_3=UCw@mail.gmail.com>
References:  <202101032029.103KTsw0028112@repo.freebsd.org> <5d52f437-618a-0da2-c8eb-a403a7e401fc@FreeBSD.org> <CAMHz58SirFY8zaCWUnJigoj0AnHh6WLvZeGC%2B1kwuSrV_3=UCw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------1DA202B8FBEA18E250789E72
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 1/4/21 10:36 AM, Po-Chuan Hsieh wrote:
> 
> 
> I also considered PREFIX while preparing the patch. On second thought, I 
> think LOCALBASE is the right answer since inputrc is not part of the 
> readline package.

I disagree, the inputrc file is a file that could very well be part of 
the readline package if it installed a sample, see attached.

It's a readline file, not something installed some other package. It may 
be installed or edit by the admin user, but that applies to all config 
files.

LOCALBASE is "files installed by other packages".

So, PREFIX is correct and LOCALBASE is not.

Cheers,
Steve


--------------1DA202B8FBEA18E250789E72
Content-Type: text/x-patch; charset=UTF-8;
 name="readline_reinplace-rev1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="readline_reinplace-rev1.diff"

diff --git devel/readline/Makefile devel/readline/Makefile
index 34820ecedc0d..6f52b7f804af 100644
--- devel/readline/Makefile
+++ devel/readline/Makefile
@@ -37,13 +37,16 @@ PATCHLEVEL=	${PATCHES:O:[-1]}
 PATCHFILES+=	${PORTNAME}${PORTVERSION:R:S|.||}-${patch:S|^|00|:S|.*(...)$|\1|}
 .endfor
 
+ETCDIR=		${PREFIX}/etc
+
 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
 
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libhistory.so.8.0 ${STAGEDIR}${PREFIX}/lib/libreadline.so.8.0
+	${INSTALL_DATA} ${WRKSRC}/examples/Inputrc ${STAGEDIR}${ETCDIR}/inputrc.sample
 
 .include <bsd.port.mk>
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
diff --git devel/readline/pkg-plist devel/readline/pkg-plist
index 3b1cec75b888..6fbd001c29d9 100644
--- devel/readline/pkg-plist
+++ devel/readline/pkg-plist
@@ -1,3 +1,4 @@
+@sample %%ETCDIR%%/inputrc.sample
 include/readline/chardefs.h
 include/readline/history.h
 include/readline/keymaps.h

--------------1DA202B8FBEA18E250789E72--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8ffc93fb-5efb-d40b-edf0-591ca3cf2676>