[Bug 278934] net-p2p/mldonkey: duplicate index entry when GUI option is unset

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 12 May 2024 12:04:04 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278934

            Bug ID: 278934
           Summary: net-p2p/mldonkey: duplicate index entry when GUI
                    option is unset
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: danfe@FreeBSD.org
          Reporter: bob@vesterman.com
             Flags: maintainer-feedback?(danfe@FreeBSD.org)
          Assignee: danfe@FreeBSD.org

Whenever I do a "make index" (for the ports tree as a whole, not for an
individual port), I get a warning message saying:

Warning: Duplicate INDEX entry: mldonkey-core-3.1.7.2

I looked into this for a while, and I think I know what's going on. I am not
really all that familiar with the ins and outs of the build system, though, so
I'm not sure if I'm correct, but:

I found that the message is coming from within /usr/ports/Tools/make_index, and
it happens based on the "name" having already been handled. From there I tried
to figure out where this "name" was coming from. Eventually I learned that if
there are two or more ports that have the same base name (not sure that "base"
is the proper term here), they are supposed to be distinguished from each other
by "PKGNAMEPREFIX" and "PKGNAMESUFFIX" (and maybe other things too, I dunno).

So, I looked for mldonkey ports. I found three: net-p2p/mldonkey,
net-p2p/mldonkey-core, and net-p2p/mldonkey-gui. The Makefiles for the -core
and -gui ones are pretty short; each just sets a few variables (PKGNAMEPREFIX
and PKGNAMESUFFIX are not among them) and then includes the Makefile for the
main mldonkey port.

I searched mldonkey/Makefile for PKGNAME. It doesn't contain any references (at
least not obvious, direct ones) to PKGNAMEPREFIX, but it does contain a couple
to PKGNAMESUFFIX:

. if !${PORT_OPTIONS:MGUI}
PKGNAMESUFFIX=    -core

(...)

. if !${PORT_OPTIONS:MCORE}
PKGNAMESUFFIX=    -gui

Given that the message complains about a duplicate of "mldonkey-core", I am
guessing that both mldonkey-core and mldonkey-gui are hitting that ".if
!$(PORT_OPTIONS:MGUI)", and therefore both are setting PKGNAMESUFFIX to -core.

Unfortunately, due to my lack of knowledge and/or sleep, I haven't been able to
figure out where this PORT_OPTIONS:MGUI thing (or, more specifically, the lack
thereof) is coming from, but I do know this: One of the things I do in my
make.conf is OPTIONS_UNSET+=GUI.

I'm guessing that that somehow causes PORT_OPTIONS:MGUI to be false, regardless
of whether or not the actual package being analyzed is mldonkey-core or
mldonkey-gui.

-- 
You are receiving this mail because:
You are the assignee for the bug.