svn commit: r549723 - head/sysutils/e2fsprogs

Baptiste Daroussin bapt at FreeBSD.org
Wed Sep 23 13:53:34 UTC 2020


On Wed, Sep 23, 2020 at 12:44:17PM +0000, Matthias Andree wrote:
> Author: mandree
> Date: Wed Sep 23 12:44:16 2020
> New Revision: 549723
> URL: https://svnweb.freebsd.org/changeset/ports/549723
> 
> Log:
>   - make /sbin/e2fsck and /sbin/fsck_ext2fs visible in pkg catalog/"pkg which",
>     so that "pkg which /sbin/e2fsck" yields the proper result.
>   
>     * this entails symlinking from $PREFIX/sbin to /sbin, and the pkg-install
>       script will attempt to replace the symlinks by hard links if possible.
>       pkg 1.15.4 cannot deal with packaged hard links and will fail.
>   
>     * Note that it is unavoidable that these be in /sbin because /usr/local or
>       /usr may not be mounted and consequently ext2 file systems could not
>       be fsck-ed or mounted from /etc/fstab.
>   
>     There will be no port option to avoid /sbin installs for now. We have too
>     many options already and the testing effort increases exponentially.
>   
>   - make sure pkg-message appears on both install and upgrade
>   
>   - clean up and document/comment pkg-install so that armchair experts
>     will not pester me with meaningless change requests
>   
>   - bugfix/change: logic of mke2fs.conf upgrade handling to present less work for
>     users on port/package upgrades
>   
>   - bump PORTREVISION
>   
>   PR:	249284 (related)
> 
> Modified:
>   head/sysutils/e2fsprogs/Makefile
>   head/sysutils/e2fsprogs/pkg-install
>   head/sysutils/e2fsprogs/pkg-message
>   head/sysutils/e2fsprogs/pkg-plist
> 
> Modified: head/sysutils/e2fsprogs/Makefile
> ==============================================================================
> --- head/sysutils/e2fsprogs/Makefile	Wed Sep 23 12:31:14 2020	(r549722)
> +++ head/sysutils/e2fsprogs/Makefile	Wed Sep 23 12:44:16 2020	(r549723)
> @@ -3,7 +3,7 @@
>  
>  PORTNAME=	e2fsprogs
>  PORTVERSION=	1.45.6
> -PORTREVISION?=	3
> +PORTREVISION?=	4
>  CATEGORIES?=	sysutils
>  MASTER_SITES=	KERNEL_ORG/linux/kernel/people/tytso/${PORTNAME}/v${PORTVERSION}
>  
> @@ -252,7 +252,8 @@ post-build:
>  		&& ${MAKE_CMD} e2fsck V=1 \
>  		LIBS="-static-libgcc -lc -Bstatic ../lib/libsupport.a ../lib/libext2fs.a ../lib/libcom_err.a \
>  		${_staticlibs} /usr/lib/libexecinfo.a /usr/lib/libelf.a \
> -		${LOCALBASE}/lib/libblkid.a ${LOCALBASE}/lib/libuuid.a ${libintl} ../lib/libe2p.a "
> +		${LOCALBASE}/lib/libblkid.a ${LOCALBASE}/lib/libuuid.a ${libintl} ../lib/libe2p.a " \
> +		&& ${STRIP_CMD} e2fsck
>  # Regression check: avoid a port (not upstream!) regression from 1.40.5,
>  # check that e2fsck isn't dynalinked against anything but libc.so:
>  	@${ECHO_CMD} -n "===>  checking that e2fsck depends on no shared objects outside /lib: "
> @@ -292,7 +293,24 @@ post-build:
>  .endif
>  
>  post-install:
> -	${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/
> +	# pkg workaround time again;

This is not a workaround at all, can you please refrain saying those nasty
comments and even more commiting them! see below

> +	# the whole purpose of this dance is to move the necessities for
> +	# /etc/fstab fsck'ing into /sbin, and symlink to these guys
> +	# in the regular hierarchy, normally $PREFIX/sbin. Hard links may
> +	# crash the install if /usr[/local] is a separate file system from /,
> +	# and pkg 1.15.4 can't automatically unroll or install relative symlinks.

There is no reason why pkg should handle such thing. pkg is supposed to provide
always the same setup experience for everyone, so it will not try to create a
link and if it fails copy the file.

pkg is supposed to track all files it installs, with special cases for
configuration files (@sample) no try to do a weird dance.

> +	${MKDIR} ${STAGEDIR}/sbin
> +	${MV} -f ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}/sbin/ # from INSTALL_TARGET
> +	${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${STAGEDIR}/sbin/  # from port
> +	# according to TPH 6.1.1 Handling Symbolic Links, these are to be absolute,
> +	# yet stage-qa warns about these on 2020-09-16:
> +	${LN} -fs /sbin/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/
> +	${LN} -fs /sbin/e2fsck      ${STAGEDIR}${PREFIX}/sbin/

And so instead of helping the framework to improve by providing a patch to
stage-qa, or even trying to understand the logic behind those rules you find it
better to hard code a comment which complains about it.

Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-ports-head/attachments/20200923/516d2c95/attachment.sig>


More information about the svn-ports-head mailing list