git: bf294827efee - main - misc/mc: improve the check whether installed diff(1) is GNU or BSD

Alexey Dokuchaev danfe at FreeBSD.org
Sun Sep 26 15:45:39 UTC 2021


The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bf294827efee6b6298dcd76a985b97d8638a4966

commit bf294827efee6b6298dcd76a985b97d8638a4966
Author:     Alexey Dokuchaev <danfe at FreeBSD.org>
AuthorDate: 2021-09-26 15:44:06 +0000
Commit:     Alexey Dokuchaev <danfe at FreeBSD.org>
CommitDate: 2021-09-26 15:44:55 +0000

    misc/mc: improve the check whether installed diff(1) is GNU or BSD
    
    In 2017, GNU diff had been replaced by BSD licensed diff in our base,
    but some features of GNU diff had not been implemented, particularly,
    the ``group format'' family of options.  Instead of checking for the
    ${OSVERSION} value, check if installed diff(1) implementation is GNU
    or BSD one based on the --version output.
    
    Because conditions are subject to immediate expansion, we cannot use
    ${DIFF} and ${GREP} variables; however, literal ``diff'' is actually
    correct in this particular case as user's preferred diff(1) does not
    necessarily point to ``/usr/bin/diff'' which ${DIFF} expands to.
    
    While here, amend the EDITOR option description so it clearly refers
    to the internal *text* editor.
---
 misc/mc/Makefile | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/misc/mc/Makefile b/misc/mc/Makefile
index ea04ec6871d2..2d9c4925de6e 100644
--- a/misc/mc/Makefile
+++ b/misc/mc/Makefile
@@ -15,6 +15,11 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 RUN_DEPENDS=	zip:archivers/zip
 
+.if ${:!diff --version 2>/dev/null | grep -c GNU\ diffutils || :!} < 1
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-src_diffviewer_ydiff.c
+RUN_DEPENDS+=	gdiff:textproc/diffutils
+.endif
+
 USES=		gmake gnome libtool perl5 pkgconfig python shebangfix tar:xz
 SHEBANG_FILES=	${WRKSRC}/src/vfs/extfs/helpers/s3+.in \
 		${WRKSRC}/src/vfs/extfs/helpers/uc1541
@@ -32,7 +37,7 @@ OPTIONS_SINGLE_SCREEN=	SLANG NCURSES
 OPTIONS_SUB=	yes
 
 ASPELL_DESC=	Aspell support for internal editor
-EDITOR_DESC=	Build with internal editor
+EDITOR_DESC=	Build with internal text editor
 EXTATTR_DESC=	Extended attributes support
 SCREEN_DESC=	Screen library
 SFTP_DESC=	Support for SFTP (via libssh)
@@ -94,11 +99,4 @@ post-install-X11-on:
 		${STAGEDIR}${PREFIX}/share/pixmaps/
 	${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.desktop ${STAGEDIR}${DESKTOPDIR}
 
-.include <bsd.port.pre.mk>
-
-.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200030
-EXTRA_PATCHES+=	${FILESDIR}/extra-patch-src_diffviewer_ydiff.c
-RUN_DEPENDS+=	gdiff:textproc/diffutils
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>


More information about the dev-commits-ports-all mailing list