Re: cvs commit: ports/sysutils/fusefs-kmod Makefile pkg-message pkg-plist ports/sysutils/fusefs-kmod/files fusefs.in pkg-message.in

From: Ruslan Ermilov <ru_at_FreeBSD.org>
Date: Wed, 7 Nov 2007 14:42:56 +0300
On Tue, Oct 30, 2007 at 03:10:09AM +0000, Alejandro Pulver wrote:
> alepulver    2007-10-30 03:10:09 UTC
> 
>   FreeBSD ports repository
> 
>   Modified files:
>     sysutils/fusefs-kmod Makefile pkg-plist 
>     sysutils/fusefs-kmod/files fusefs.in 
>   Added files:
>     sysutils/fusefs-kmod/files pkg-message.in 
>   Removed files:
>     sysutils/fusefs-kmod pkg-message 
>   Log:
[...]
>   - Create a symlink of ${PREFIX}/sbin/mount_fusefs to /usr/sbin to allow
>     mounting from /etc/fstab.

This change results in a broken package because sbin/mount_fusefs
now appears in the tarball twice, first as a binary file, and then
as a symlink.  This causes /usr/local/sbin/mount_fusefs to be a
symlink to itself when installing a package:

: $ tar tvf fusefs-kmod-0.3.9.p1_1.tbz
: -rw-r--r--  0 root   wheel      23 Nov  1 13:41 +COMMENT
: -rw-r--r--  0 root   wheel      75 Nov  1 13:41 +DESC
: -rw-r--r--  0 root   wheel     660 Nov  1 13:41 +DISPLAY
: -rw-r--r--  0 root   wheel   17501 Nov  1 13:41 +MTREE_DIRS
: -r--r--r--  0 root   wheel    4815 Nov  1 13:41 man/man8/mount_fusefs.8.gz
: -r-xr-xr-x  0 root   wheel   63463 Nov  1 13:41 modules/fuse.ko
: -r-xr-xr-x  0 root   wheel   12996 Nov  1 13:41 sbin/mount_fusefs
: [...]
: lrwxr-xr-x  0 root   wheel       0 Nov  1 13:41 sbin/mount_fusefs -> /usr/local/sbin/mount_fusefs
: -r-xr-xr-x  0 root   wheel     692 Nov  1 13:41 etc/rc.d/fusefs

The following patch fixes it (an approach similar to the one
in lang/perl5.8):

%%%
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/fusefs-kmod/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile	30 Oct 2007 03:10:09 -0000	1.15
+++ Makefile	7 Nov 2007 10:11:34 -0000
_at__at_ -86,7 +86,7 _at__at_ pre-install:
 	_at_${MKDIR} ${KMODDIR}
 
 post-install:
-	_at_${LN} -s ${PREFIX}/sbin/mount_fusefs /usr/sbin
+	_at_${LN} -fs ${PREFIX}/sbin/mount_fusefs /usr/sbin
 .if defined(WITH_AUTOSETUP) && !defined(PACKAGE_BUILDING)
 	_at_${SED} -e 's|_at__at_PREFIX_at__at_|${PREFIX}|g' \
 		${FILESDIR}/${SETUP} > ${WRKDIR}/${SETUP}
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/sysutils/fusefs-kmod/pkg-plist,v
retrieving revision 1.6
diff -u -p -r1.6 pkg-plist
--- pkg-plist	30 Oct 2007 03:10:09 -0000	1.6
+++ pkg-plist	7 Nov 2007 10:11:14 -0000
_at__at_ -1,5 +1,7 _at__at_
 modules/fuse.ko
 sbin/mount_fusefs
+_at_exec ln -fs %D/%F /usr/sbin
+_at_unexec rm -f /usr/sbin/mount_fusefs 2>&1 >/dev/null || true
 _at_unexec kldxref %D/modules
 _at_dirrmtry modules
 %%PORTDOCS%%%%DOCSDIR%%/kmod/doc.text
_at__at_ -21,5 +23,3 _at__at_ sbin/mount_fusefs
 %%PORTDOCS%%_at_dirrm %%DOCSDIR%%/kmod/html
 %%PORTDOCS%%_at_dirrm %%DOCSDIR%%/kmod
 _at_dirrmtry %%DOCSDIR%%
-_at_cwd /usr
-sbin/mount_fusefs
%%%

(A similar problem exists in some other fusefs-* ports.)


Cheers,
-- 
Ruslan Ermilov
ru_at_FreeBSD.org
FreeBSD committer
Received on Wed Nov 07 2007 - 12:23:17 UTC