Bug 226373

Summary: ports-mgmt/pkg: POST-DEINSTALL script failed: indexinfo not found
Product: Ports & Packages Reporter: Sergey <kpect>
Component: Individual Port(s)Assignee: Baptiste Daroussin <bapt>
Status: New ---    
Severity: Affects Some People CC: cperciva, portmgr, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (bapt)
Version: Latest   
Hardware: amd64   
OS: Any   

Description Sergey 2018-03-05 18:26:25 UTC
Hello.

I have following portmaster.rc config:
$ cat /usr/local/etc/portmaster.rc
NO_BACKUP=Bopt
ALWAYS_SCRUB_DISTFILES=dopt
PM_VERBOSE=vopt
PM_PACKAGES_BUILD=pmp_build
PM_DEL_BUILD_ONLY=pm_dbo
PM_NO_CONFIRM=pm_no_confirm
PM_NO_TERM_TITLE=pm_no_term_title

When I install some package build dependencies are fetched as precompiled packages and are removed at the end. I don't have print/indexinfo port installed, but it's being triggered all the time by pkg, please see below:

===>>> Deleting installed build-only dependencies
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 10 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        gmake-4.2.1_2
        help2man-1.47.6
        texinfo-6.5,1
        bison-3.0.4,1
        mpfr-3.1.6
        binutils-2.30_2,1
        nasm-2.13.03,1
        pkgconf-1.4.2,1
        xorg-macros-1.19.1
        dri3proto-1.0

Number of packages to be removed: 10

The operation will free 215 MiB.
[1/10] Deinstalling gmake-4.2.1_2...
[1/10] Deleting files for gmake-4.2.1_2: 100%
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
pkg: POST-DEINSTALL script failed
[2/10] Deinstalling help2man-1.47.6...
[2/10] Deleting files for help2man-1.47.6: 100%
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
pkg: POST-DEINSTALL script failed
[3/10] Deinstalling texinfo-6.5,1...
[3/10] Deleting files for texinfo-6.5,1: 100%
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
pkg: POST-DEINSTALL script failed
[4/10] Deinstalling bison-3.0.4,1...
[4/10] Deleting files for bison-3.0.4,1: 100%
/bin/sh: indexinfo: not found
pkg: POST-DEINSTALL script failed
[5/10] Deinstalling mpfr-3.1.6...
[5/10] Deleting files for mpfr-3.1.6: 100%
/bin/sh: indexinfo: not found
pkg: POST-DEINSTALL script failed
[6/10] Deinstalling binutils-2.30_2,1...
[6/10] Deleting files for binutils-2.30_2,1: 100%
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
/bin/sh: indexinfo: not found
pkg: POST-DEINSTALL script failed
[7/10] Deinstalling nasm-2.13.03,1...
[7/10] Deleting files for nasm-2.13.03,1: 100%
[8/10] Deinstalling pkgconf-1.4.2,1...
[8/10] Deleting files for pkgconf-1.4.2,1: 100%
[9/10] Deinstalling xorg-macros-1.19.1...
[9/10] Deleting files for xorg-macros-1.19.1: 100%
[10/10] Deinstalling dri3proto-1.0...
[10/10] Deleting files for dri3proto-1.0: 100%
Comment 1 w.schwarzenfeld freebsd_triage 2019-02-11 02:50:23 UTC
Is this still relevant?
Comment 2 Sergey 2019-02-11 06:34:17 UTC
(In reply to w.schwarzenfeld from comment #1)
To solve the issue I had to install indexinfo manually, so it's working now. But I suppose it have to be installed as a dependency if it's required for proper deinstallation.
Comment 3 Sergey 2019-02-11 06:40:26 UTC
It's a pity 'pkg' doesn't allow to get rid of different garbage which is not required all the time. Like 'yum' for example allows to set:
--setopt='tsflags=nodocs'
it'd be cool if 'pkg' would allow the same to get rid of DOCS INFO MAN LICENSE ... etc. So less dependencies would be required.
Comment 4 Colin Percival freebsd_committer 2019-02-21 02:04:11 UTC
This bug is still present, but I don't think it's pkg's fault.  This happens because ports/Keywords/info.ucl says to call "indexinfo" without providing a full path; this code makes its way into packages created by pkg(8) and as a result any attempt to install or deinstall packages containing .info files will fail to run indexinfo unless PATH contains /usr/local/bin/ .

Maybe pkg(8) should adjust its PATH but I think the solution is probably to amend the ports/Keywords/info.ucl script.  (Also possibly others -- there are some scripts for handling fonts which also seem to have the same problem.)
Comment 5 Sergey 2019-02-21 06:51:05 UTC
Maybe at least to start with something like this?

actions: [file]
post-install: <<EOD
  case "%@" in
  /*) file="%@" ;;
   *) file="%D/%@" ;;
  esac
  [ "$(which indexinfo)" ] && indexinfo ${PKG_ROOTDIR}${file%/*}
EOD
post-deinstall: <<EOD
  case "%@" in
  /*) file="%@" ;;
   *) file="%D/%@" ;;
  esac
  [ "$(which indexinfo)" ] && indexinfo ${PKG_ROOTDIR}${file%/*}
EOD
Comment 6 Sergey 2019-02-21 07:28:13 UTC
one additional note, I don't use INFO in world:

$ grep INFO /etc/src.conf
WITHOUT_INFO=YES