tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Failure message when inconsistent X11_TYPE



Greg Troxel wrote:
I am not sure what I really think yet, but:

  It's somewhat or more, perhaps entirely, reasonable for pkgsrc to
  assume that an xbase set file implies that the sets are present.

  If one sets X11_TYPE to modular, do the tools that you listed depend
on the pkgsrc versions in a clean manner? (Surely this must be true.)
Good point. I tested and X11BASE == LOCALBASE when X11_TYPE=modular. Therefore the test was wrong. I fix it below.

  Files that are evaluated for every package should strive to be lean
There are already several tests for each tool in a big forloop. I add the supplementary test in this loop.

So if the only problem is that some tools are taken from native X if
X11_TYPE=native (and work fine with modular), then a single if for the
set config file in tools seems preferable to looping over all tools and
checking, as a tradeoff of avoiding runtime at the expense of assuming
consistency.
Actually, there are several forloops to test the tools. If I am correct the precedences ensure that only X11-related tools are tested for the existence of the file. I don't think there is a significant impact on runtime performance.

Which I think brings me back to your original suggestion, which is to
just check for the set file in platform.mk
After reflection, I have the feeling that my previous suggestions were sort of hacks because it was only for NetBSD and only in the case where the mtree for X11 files is /etc/mtree/set.xbase. What happens if this file is renamed in future? If someone manually copy X11R7 directory without copying mtree file? If pkgsrc can handle native X11 of FreeBSD/OpenBSD?

I would really like to hear what other people think; this is not an easy
issue to deal with.
If there is no objection, I will commit the following patch to fix PR pkg/56299:

--- mk/tools/replace.mk	6 Oct 2020 17:36:50 -0000	1.291
+++ mk/tools/replace.mk	17 Jul 2021 19:14:04 -0000
@@ -1276,6 +1276,16 @@
 ######################################################################

 .for _t_ in ${_USE_TOOLS}
+###
+### For each tool that depends on X11 for its native version, make
+### sure it is really installed (i.e. xbase has been installed).
+###
+.  if defined(TOOLS_PATH.${_t_}) && !empty(X11_TYPE:Mnative)
+. if !exists(${TOOLS_PATH.${_t_}}) && !empty(TOOLS_PATH.${_t_}:M${X11BASE}*) +PKG_FAIL_REASON+= "${X11BASE}: X11_TYPE=native but xbase set is not installed. Either set X11_TYPE to modular or install xbase."
+.    endif
+.  endif
+
 .  if !empty(_TOOLS_USE_PKGSRC.${_t_}:M[yY][eE][sS]) && \
       !defined(TOOLS_IGNORE.${_t_})
 #####


Home | Main Index | Thread Index | Old Index