tech-pkg archive

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

make bin-install fails to set automatic=yes



It's useful to have

  DEPENDS_TARGET=         bin-install clean

so that it is then reasonable to "pkgin ar" regularly, without causing
recompilation of things that haven't changed, when they are later needed
as dependency.

However, I find that things show up in "pkgin sk", lacking
automatic=yes, and I've seen this happen when something is bin-install'd
as a dependency.

Looking at mk/bsd.pkg.mk:

  .if defined(_AUTOMATIC) && !empty(_AUTOMATIC:M[Yy][Ee][Ss])
  _BIN_INSTALL_FLAGS+=    -A
  .endif

but I don't see _AUTOMATIC defined anywhere.   Is this about if pkg_add
supports -A?  User preference?

The line "_BIN_INSTALL_FLAGS+= -A" is from 2005.  Making it conditional
on _AUTOMATIC is from 2009:

  revision 1.1957
  date: 2009-05-26 02:03:02 -0400;  author: obache;  state: Exp;  lines: +2 -2;
  Accept _AUTOMATIC=yes.
  At least, set as "yes" in mk/flavor/pkg/depends.mk,
  and accept both "YES" and "yes" in flavor/pkg/install.mk.

  Fixes PR 41422.

http://gnats.netbsd.org/41422

I see in mk/pkgformat/pkg/depends.mk:

                    ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes $$target;       \

but when it gets to the code in bin-install.mk (with an extra print
line):

        ${RUN} ${_BIN_INSTALL_PREPARE_CMD}                              \
        pkgpattern=${PKGNAME_REQD:Q};                                   \
        ${STEP_MSG} "Installing $$pkgpattern from $$pkg_path";          \
        ${STEP_MSG} "flags ${_BIN_INSTALL_FLAGS} automatic ${_AUTOMATIC}";              \
        if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKGTOOLS_ENV} ${PKG_ADD} ${_BIN_INSTALL_FLAGS} "$$pkgpattern"; then \
                installed=`${PKG_INFO} -e "$$pkgpattern"`;              \
                ${ECHO} "$$installed successfully installed.";          \
        fi

then flags does not have _A and _AUTOMATIC is empty.

I'm not following the maze of twisty make targets.  Can anyone spot the
bug?



Home | Main Index | Thread Index | Old Index