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/22/22 1:10 PM, Greg Troxel wrote:

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

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

Yes, but that's an implementation detail, and not conceptually different
from strings baked into a C program.

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.

To understand:

   the big hint is that @FOO@ is substituted with a value

   read pkgsrc/pkgtools/pkg_chk/Makefile

   egrep PKG_DBDIR files/pkg_chk.sh

   diff -u files/pkg_chk.sh /usr/pkg/sbin/pkg_chk


Thanks Greg - I get that aspect of it (the substitution itself) - What I'm looking for is where the replacement *values* for @PKG_INFO@ and friends are set. There has to be a place where these values are generated and assigned to the vars for substitution. I'm currently making my way through mk/ to understand better.

--
Louis


Home | Main Index | Thread Index | Old Index