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