Subject: Re: Debugging pkg_comp
To: Aaron J. Grier <>
From: Greg Troxel <>
List: tech-pkg
Date: 04/08/2005 07:41:03
  I don't immediately know the answer this... but pkg_comp is a giant
  shell script, so it should be find-out-able.

It may be that in 2.0.2 the pkg tools are out of date, and that you've
already built pkg_install in your running system.  But, the release
sets that you got or built to make the chroot from surely have the
code from 2.0.2, and if that's older than pkgsrc wants, it will
rebuild it.

  PKG_COMP ==> Checking if pkg_install is up to date
  PKG_COMP ==> pkg_install is out of date; rebuilding

I suggest reading pkg_comp to see where it does this:

  # check_pkg_install
  #   Ensure that the version of pkg_install inside the sandbox is new
  #   enough to work with pkgsrc.  If not, rebuild it.
      local script


      # We assume filesystems are mounted!

      echo "PKG_COMP ==> Checking if pkg_install is up to date"
      script=`mktemp $DESTDIR/pkg_comp/tmp/pkg_comp-XXXX`.sh
      init_script $script
      cat >> $script <<EOF
  cd /usr/pkgsrc/pkgtools/pkg_comp
  fail=\$(make show-var VARNAME=PKG_FAIL_REASON)
  if echo \$fail | grep "package tools installed on this system are out of date" >/dev/null; then
      echo "PKG_COMP ==> pkg_install is out of date; rebuilding"
      cd /usr/pkgsrc/pkgtools/pkg_install
      make && make install && make clean
      chmod +x $script
      chroot $DESTDIR /pkg_comp/tmp/`basename $script`
      rm $script

So, it is asking the pkgsrc mk files, and doing the install in order
to avoid this happening on the first package.

        Greg Troxel <>