Subject: Re: Overhaul X11 handling
To: NetBSD Packages Technical Discussion List <tech-pkg@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-pkg
Date: 04/21/2006 09:43:31
Johnny Lam <jlam@pkgsrc.org> writes:

> Dieter Baron wrote:
>> In article <20060420141938.GA1705@NetBSD.org> Johnny wrote:
>>
>> : (3) Drop support for USE_XPKGEDGE=no.  Handle the XAPPLRESDIR problem
>> :     by having packages that install X11 resource files include a
>> :     post-install action (via the INSTALL script) that symlinks or
>> :     copies the resource file into /usr/X11R6 in the X11_TYPE=native
>> :     case.
>>
>> I don't think pkgsrc should install into /usr/X11R6.  I thought
>> that was the whole point of USE_XPKGWEDGE.
>
> Like some other parts of the INSTALL scripts that do destructive
> actions outside of ${PKG_PREFIX}, this would be governed by a yes/no
> variable PKG_INSTALL_XAPPLRES that defaults to "no", but that can be
> set to "yes" during pkg_add.  Quite frankly, I saw no other general
> solution to PR pkg/28510 -- modifying xsrc, union mounts, and wrapping
> every X11 binary are all pie-in-the-sky ideas compared to just putting
> the X11 resource files where X expects to find them.

From the "regular user" point of view, I'd say the requirements are
that doing a simple install of a package with default options must
cause it to work properly.

One can say that X11 is broken for insisting that programs find
app-defaults files in /usr/X11R6 even if the programs are elsewhere,
or that pkgrsc is broken because it refuses to put X11 programs where
they "belong".

So PKG_INSTALL_XAPPLRES sounds like a good solution, but it should
default to yes.  While that's a violation of purity, it's only writing
someplace that demands to be written to.  I'd expect 99.5% of users to
want this, and in this case it's more important to be useful than
pedantic (although I in general appreciate pkgsrc's insistence on
cleanliness in an icky world).

If yes is an unacceptable default because of
writing-outside-LOCALBASE-considered-harmful (even more so that
installing programs that don't work correctly), then may I suggest a
three-valued variable yes/fail/no, where yes installs, fail aborts the
install, and no doesn't install, and default to fail.  This maintains
purity and the message will enable the 99.5% to set it to yes.

Or, we could have as a default

PKGSRC_LOCALBASE_PURITY?= no

and let people set it to yes to suppress behavior that writes out of
LOCALBASE unless that behavior is specifically enabled.  Perhaps then
rc.d file installation in /etc/rc.d could be the default on systems
that have native rc.d.


Another reasonable approach is to teach X11 in xsrc to look in
/usr/pkg as well as /usr/X11R6.  This only works for default LOCALBASE
- but the point is to not impose breakage on naive users.  But this
requires changing xsrc on all branches, and similar changes on other
systems, so I concur with you in rejecting it.

-- 
        Greg Troxel <gdt@ir.bbn.com>