portindex ignores (filters out) unchanged port

Rainer Müller raimue at macports.org
Mon Dec 28 06:42:46 PST 2015


On 2015-12-28 11:06, René J.V. Bertin wrote:
> No, port DIR names become arbitrary. From what I understand the only
> reason they are not supposed to be arbitrary right now is because of
> the portdir name = port name assumption that is currently still
> required to avoid reindexing. There is no other side-effect of using
> a deviant portdir that I've been able to observe. If you ask me, the
> choice not to include the parent directory (and the category) in the
> indexing feature is just as arbitrary, yet lint does complain about a
> main category/dirname mismatch IIRC.

Yes, this is the only reason, but it is still a reason. This requirement
needs to be followed to avoid unnecessary reindexing. To decide wether
we need to reindex we need the port's name to look it up in the index.
The only way to get the name from the Portfile is to run the Tcl
interpreter on the Portfile. But parsing the Portfile is actually the
expensive step we want to avoid with this logic.

I do not see any other solution for this with the current PortIndex.

> And what's wrong with arbitrary portdir names as long as there is a
> minimum of common sense in their naming? I don't think anyone would
> chose a truly arbitrary and non-informative name for the directory in
> which they store their port files. It is true that for the vast
> majority of users, the portdir name is without any interest, maybe
> even for most port developers/maintainers. On the other hand, for
> those of the latter who maintain/develop lots of ports, there is an
> advantage in being able to organise the port tree the way that works
> best for them (= most efficiently).

The category directories in the ports tree are only used to avoid having
a single directory with >10.000 entries, which is known to cause
performance problems on older filesystems. Using the primary category
was just a habit adopted from FreeBSD ports. It could as well be the
first character of the port name, for example .../k/kate/ or .../v/vim/.
But that would be redundant as well, so you wouldn't like it either.

> Take port:kde-extra-cmake-modules. The port was called that way
> mostly to make its nature clear to those who find it gets pulled in
> when installing something, and to avoid naming conflicts with
> potential other ports that install extra modules for cmake. KDE
> (build) code refers to it as ECM, however, so `kde/ECM` works much
> better when you have to refer to its port implementation from time to
> time than `kde/kde-extra-cmake-modules` . Similarly, if you maintain
> a growing but already large number of ports for KF5 packages, you can
> get around in the port tree much more easily if all those port
> directories do not all have a name that starts the same. Be it if you
> work with an IDE like I do (and thus have the limited width of the
> filesystem tree navigator to deal with) , through a Finder window or
> even with completion in a terminal, all information that is redundant
> (to the "user", because already available elsewhere) and repeated
> adds an additional attentional load.

I don't understand your argument at all. In a list of ports that all
have the same prefix it is as easy to find something alphabetically as
it is in a list without the prefix. Maybe we just have different
preferences.

We are doing a lot of bikesheding right here. There is a technical
reason you have to use the exact same name for the port directory and in
the Portfile. Please follow the recommendation given by 'port lint'.

Rainer


More information about the macports-dev mailing list