tech-pkg archive

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

Re: get rid of LOCALBASE



On 12/3/20 2:10 PM, Greg Troxel wrote:
Joerg Sonnenberger <joerg%bec.de@localhost> writes:

Well, there are good reasons for them to be historically separate, even
if we have removed many of the differences over time. pkgviews,
subprefixes etc. Ultimately, the main difference remains that LOCALBASE
is the user-settable variable and PREFIX is the infrastructure variable.
I don't really see the point in renaing the former to the latter.
So trying to take that comment, which makes sense to me, into a plan

   LOCALBASE is a user-settable variable

   PREFIX is an infrastructure-settable variable

   PREFIX should be set to LOCALBASE, absent some special reason

   any code that uses LOCALBASE (other than setting PREFIX) is arguably
   wrong and should be using RPEFIX, unless there's a good reason that is
   explained in comments after being discussed here


and this is all sort of floating a theory that our current issues are
due to confusion between user-settable and infrastructure-settable
variables, and when the infrastructure-settable one is defined.


FWIW, FreeBSD ports still uses both for reasons akin to the X11BASE mentioned earlier, but only for Linux binaries now since X11 was moved to ${LOCALBASE}.  From bsd.port.mk:

# Various directory definitions and variables to control them.
# You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
#
# LOCALBASE             - Where ports install things.
#                                 Default: /usr/local
# LINUXBASE             - Where Linux ports install things.
#                                 Default: /compat/linux
# PREFIX                - Where *this* port installs its files.
#                                 Default: ${LINUXBASE} if USE_LINUX_PREFIX is set,
#                                 otherwise ${LOCALBASE}

Under pkgsrc, help/directories.help seems to indicate the same logic as FreeBSD ports, but there does not appear to be an alternative to LOCALBASE underlying PREFIX, and PREFIX is not supposed to be overridden (not the case in FreeBSD ports, PREFIX is explicitly set in rare cases):

# PREFIX
#    This is the directory where the package should install its
#    files. This is usually LOCALBASE.
#
#    Tags: read-only, system-defined, non-overridable, etc.
#
#    See also:
#        LOCALBASE.
#

# LOCALBASE
#    This is the directory where all packages are usually installed.
#    It is set by the user, and packages must not modify it.
#

Which leaves the question of specifically when the two might actually differ.

If there are current or planned uses where PREFIX != LOCALBASE, then probably we need to keep both.




Home | Main Index | Thread Index | Old Index