Re: port shares same binary and manual names with base ztest (ZFS)

From: Nuno Teixeira <eduardo_at_freebsd.org>
Date: Fri, 09 Feb 2024 17:42:17 UTC
Hello!

I've e-mailed upstream about it and this is getting interesting.
I will paste complete reply here.

######
Hello Nuno,

Nuno Teixeira wrote:
> I'm about to maintain Zutils FreeBSD port (
> https://www.freshports.org/archivers/zutils/ ) and I'm dealing with
> conflicts with base gzip and ZFS ztest.

Thank you! :-)

> Currently, port has set:
> CONFLICTS_INSTALL=      gzip # bin/zcat bin/zcmp bin/zdiff bin/zgrep
> man/man1/ztest.1.gz

My opinion about the conflict with the scripts packaged with GNU gzip is
that they should be renamed to gzcat, gzcmp, gzdiff, and gzgrep because they
just understand the formats supported by gzip. This would be in line with
other scripts like bzcat, xzdiff, zstdgrep, and even with the lzdiff and
lzgrep scripts distributed with early versions of lzip.

But meanwhile someone convinces gzip upstream of renaming their scripts, I
have copied from gzip's configure to the INSTALL file of zutils the way of
renaming the scripts:

------------------------------
-------------------------------------------
If you are installing zutils along with GNU gzip and want to keep the
gzip scripts, the recommended method is to configure gzip as follows:

    ./configure --program-transform-name='s/^z/gz/'

This renames, at installation time, the gzip scripts and man pages to
'gzcat', 'gzcat.1', etc, avoiding the name clashing with the programs and
man pages from zutils.
-------------------------------------------------------------------------

About the conflict with man/man1/ztest.1.gz, my opinion is that it should be
renamed to something like zfstest or zfs_unit_test, in line with dosfsck,
e2fsck, jfs_fsck, and reiserfsck, because it is not at all obvious that
ztest refers to a ZFS unit test.

Note that the environment variables used by ZFS's ztest already have
sensible names: ZFS_HOSTID ZFS_STACK_SIZE.

> void linux pkg renames binary names to capitals on first letter to
> deal with this.

FWIW, I don't like this idea. I find it fragile and confusing.

Hope this helps.

Antonio.
######

Tomoaki AOKI <junchoon@dec.sakura.ne.jp> escreveu (quinta, 8/02/2024
à(s) 14:19):
>
> If you don't consider FAT filesystem or shares on Windows servers
> completely, not so bad.
>
> But once you want carrying files on such as SD cards or USB memstick
> formatted with FAT* filesystem, you cannot sanely save both Zcat and
> zcat, at least by filesystem definition (case-preserving but not
> case-sensitive. Descriptions on Wikipedia [3] seems to be partially
> wrong, as filemanager like original fd on DOS [by A.Idei) could
> rename files including both upper and lower cases and it was
> displayed as saved later on, but could not create Ztst and zTst on
> the same directory).
>
> Not sure FreeBSD implementation of FAT* filesystems (aka msdosfs), but
> on Windoze, basically upper and lower cases are NOT distincted as
> different character on filesystems. (LFN is an extended feature, not
> the filesystem itself.) [2]
>
> [2] https://en.wikipedia.org/wiki/Long_filename
>
> [3] https://en.wikipedia.org/wiki/Filename
>
>
> On Thu, 8 Feb 2024 12:42:29 +0000
> Nuno Teixeira <eduardo@freebsd.org> wrote:
>
> > I've found that void linux rename binaries to first letter as capital:
> > from
> > https://github.com/void-linux/void-packages/tree/master/srcpkgs/zutils/files
> > :
> >
> > zutils in Void use a capital first letter:
> > Zcat Zcmp Zdiff Zegrep Zfgrep Zgrep Ztest Zupdate
> >
> > This way we could solve:
> > 1- CONFLICTS_INSTALL=      gzip # bin/zcat bin/zcmp bin/zdiff bin/zgrep
> > man/man1/ztest.1.gz
> > and
> > 2- ZFS ztest
> >
> > What's your opinion to introduce this change?
> >
> > Cheers,
> >
> >
> >
> >
> > Tomoaki AOKI <junchoon@dec.sakura.ne.jp> escreveu (quinta, 1/02/2024 à(s)
> > 14:05):
> >
> > > On Thu, 1 Feb 2024 13:06:15 +0000
> > > Nuno Teixeira <eduardo@freebsd.org> wrote:
> > >
> > > > Hello all,
> > > >
> > > > archivers/ztools shares binary ztest and manual ztest.1 with base ZFS.
> > > > Is there a policy to deal with it?
> > > >
> > > > If someone knows a port that shares same issue, please let me know.
> > > >
> > > > /usr/bin/ztest
> > > > /usr/share/man/man1/ztest.1.gz
> > > >
> > > > PREFIX/bin/ztest
> > > > PREFIX/man/man1/ztest.1.gz
> > > >
> > > > Thanks,
> > > >
> > > > --
> > > > Nuno Teixeira
> > > > FreeBSD Committer (ports)
> > >
> > > AFAIK, at least archivers/unzip [1] has the same issue.
> > > But base unzip and its manpage is now a symlink to bsdunzip.
> > >
> > > FYI: command other than `man /usr/local/share/man/man1/unzip.1.gz` for
> > > unzip shows `man 1 bsdunzip`. even `man -M /usr/local/share/man/man1
> > > unzip` shown bsdunzip's one.
> > >
> > >
> > > [1] https://www.freshports.org/archivers/unzip/
> > >
> > > --
> > > Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>
> > >
> > >
> >
> > --
> > Nuno Teixeira
> > FreeBSD Committer (ports)
>
>
> --
> Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>



-- 
Nuno Teixeira
FreeBSD Committer (ports)