pkgsrc-Users archive

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

Re: pkg_chk confused by new configurable PKG_DBDIR



On 3/21/22 6:05 PM, Greg Troxel wrote:

Louis Guillaume <louis%zabrico.com@localhost> writes:

Since the shift to a PKG_DBDIR being configurable, the pkg_chk
script's hard-coded paths to PKG_DBDIR break things.

pkg_chk is a package that when build should substitute in the value from
mk.conf (or default).

subst.mk seems to include the PKG_DBDIR path on all the PKG_ variables
at build time. Is there a way to avoid that?

Are you asking for a way for tools to dynamicallyf find the value, so
that you can  change the dir and not rebuild things?  pkgsrc in general
does not support that.

I understand that's true for things like SYSCONFBASE and even PREFIX, which are deeply embedded into the system.

But in this case, for pkg_chk, these are just string values subst'd into a deliverable shell script at build time.

Surely we can separate the `-K /hard/coded/path' and make it `-K ${PKG_DBDIR}', so that gets resolved at runtime.

It's not clear to me where/when the SUBST_VARS get their value, or if it's modifiable at all.

If, for example, @PKG_INFO@ would resolve to "/usr/pkg/sbin/pkg_info" without the -K argument, then instead of:

  test -n "$PKG_INFO"   || PKG_INFO="@PKG_INFO@"

we could have something like :

  : ${PKG_INFO:=@PKG_INFO@ -K ${PKG_DBDIR:=@PKG_DBDIR@}}


How do we represent *just* the pkg_info binary in @PKG_INFO@, without the -K argument?

Any guidance as to where to look for the "subst" magic would be great.

--
Louis





Home | Main Index | Thread Index | Old Index