git: 2cf20a89ee5c - main - sysutils/e2fsprogs-core: clean up a bit, drop coreutils depends

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Thu, 09 Feb 2023 20:55:35 UTC
The branch main has been updated by mandree:

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

commit 2cf20a89ee5cc43ccf5f2968f8ede26b2ff2fb2e
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2023-02-09 20:50:14 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2023-02-09 20:52:25 +0000

    sysutils/e2fsprogs-core: clean up a bit, drop coreutils depends
    
    Patch a test script to work around BSD dd's missing oconv=append,
    and do away with coreutils as a build requisite.
    
    Move some REINPLACE_CMD features to individual patches that I
    intend to send upstream for inclusion, and remove others that
    are now no longer required.
    
    This should only affect the build and self-test phases,
    and not change package content, so not bumping PORTREVISION.
---
 sysutils/e2fsprogs-core/Makefile                      |  7 -------
 .../files/patch-tests_f__detect__junk_script          | 11 +++++++++++
 .../files/patch-tests_t__mmp__fail_script             | 19 +++++++++++++++++++
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/sysutils/e2fsprogs-core/Makefile b/sysutils/e2fsprogs-core/Makefile
index e70f10fef4c5..7c3dd16cde85 100644
--- a/sysutils/e2fsprogs-core/Makefile
+++ b/sysutils/e2fsprogs-core/Makefile
@@ -36,7 +36,6 @@ CONFIGURE_ARGS?=--disable-fsck \
 		--libdir='${PREFIX}/lib/e2fsprogs/' \
 		--includedir='${PREFIX}/include/e2fsprogs/' \
 		--with-root-prefix='${PREFIX}' \
-		DD=${LOCALBASE}/bin/gdd \
 		LDFLAGS='${LDFLAGS} -L${LOCALBASE}/lib -Wl,--rpath -Wl,${LOCALBASE}/lib/e2fsprogs'
 CONFIGURE_ENV?=	LIBS='-Wl,--as-needed ${LIBS} -lexecinfo -lelf'
 # apparently HAVE_PTHREAD_H checks go missing if the FUSEFS option is unset, force it:
@@ -74,7 +73,6 @@ FUSEFS_USES=		fuse
 
 NLS_USES=		gettext iconv:build
 
-BUILD_DEPENDS+=	gdd:sysutils/coreutils
 BASHTESTS_BUILD_DEPENDS=	${BASH_CMD}:shells/bash
 BASH_CMD=	${LOCALBASE}/bin/bash
 
@@ -136,13 +134,8 @@ libintl=
 EXTRA_PATCHES+=	${FILESDIR}/extrapatch-no-sbrk
 .endif
 
-# d_fallocate_blkmap appears to fail on some systems for unknown reasons.
-# m_offset sometimes failes, a make clean and re-build usually fixes this. Reason unknown.
 post-patch::
 .if !empty(DISTFILES)
-	@${REINPLACE_CMD} -E -e 's/md5sum ([^ ]*)/printf "%s  %s\\n" $$(md5 -q \1) \1/' \
-	    -e "s/ == 0/ = 0/" -e "s/tar x$$/tar xf -/" -e "s/\<dd\>/gdd/" \
-	    ${WRKSRC}/tests/[a-z]_*/script
 	@${REINPLACE_CMD} -e 's/<malloc\.h>/<stdlib.h>/' ${WRKSRC}/*/*.c
 	@${REINPLACE_CMD} -e 's,/etc/blkid.tab,${ETCDIR}/blkid.tab,' ${WRKSRC}/misc/blkid* ${WRKSRC}/lib/blkid/blkidP.h
 	@${REINPLACE_CMD} -E -e 's/__GNUC_PREREQ\>/__GNUC_PREREQ__/' ${WRKSRC}/*/*/*.[ch] ${WRKSRC}/*/*.c
diff --git a/sysutils/e2fsprogs-core/files/patch-tests_f__detect__junk_script b/sysutils/e2fsprogs-core/files/patch-tests_f__detect__junk_script
new file mode 100644
index 000000000000..45b544cf691d
--- /dev/null
+++ b/sysutils/e2fsprogs-core/files/patch-tests_f__detect__junk_script
@@ -0,0 +1,11 @@
+--- tests/f_detect_junk/script.orig	2023-02-07 03:31:53 UTC
++++ tests/f_detect_junk/script
+@@ -9,7 +9,7 @@ FSCK_OPT=-fn
+ IMAGE=$test_dir/image.bz2
+ 
+ bzip2 -d < $IMAGE > $TMPFILE
+-$DD if=/dev/zero of=$TMPFILE conv=notrunc oflag=append bs=1024k count=16 > /dev/null 2>&1
++$DD if=/dev/zero of=$TMPFILE conv=notrunc bs=1024k count=16 2>/dev/null >>$TMPFILE
+ 
+ # Run fsck to fix things?
+ if [ -x $DEBUGFS_EXE ]; then
diff --git a/sysutils/e2fsprogs-core/files/patch-tests_t__mmp__fail_script b/sysutils/e2fsprogs-core/files/patch-tests_t__mmp__fail_script
new file mode 100644
index 000000000000..77fd70e4ccf2
--- /dev/null
+++ b/sysutils/e2fsprogs-core/files/patch-tests_t__mmp__fail_script
@@ -0,0 +1,19 @@
+--- tests/t_mmp_fail/script.orig	2023-02-07 03:31:53 UTC
++++ tests/t_mmp_fail/script
+@@ -10,14 +10,14 @@ fi
+ 
+ $TUNE2FS -O project $TMPFILE >> $test_name.log 2>&1
+ status=$?
+-if [ "$status" == 0 ] ; then
++if [ "$status" = 0 ] ; then
+ 	echo "'tune2fs -O project' succeeded on small inode" > $test_name.failed
+ 	echo "$test_name: $test_description: failed"
+ 	return 1
+ fi
+ $TUNE2FS -o bad_option $TMPFILE >> $test_name.log 2>&1
+ status=$?
+-if [ "$status" == 0 ] ; then
++if [ "$status" = 0 ] ; then
+ 	echo "'tune2fs -o bad_option' succeeded" > $test_name.failed
+ 	echo "$test_name: $test_description: failed"
+ 	return 1