Bug 226373 - ports-mgmt/pkg: POST-DEINSTALL script failed: indexinfo not found
Summary: ports-mgmt/pkg: POST-DEINSTALL script failed: indexinfo not found
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-05 18:26 UTC by Sergey
Modified: 2019-04-24 12:46 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (bapt)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 Walter 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 freebsd_triage 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
Comment 7 Sergey 2019-04-24 06:22:07 UTC
Actually even deleting indexinfo from ports/Keywords/info.ucl file still triggers it with "/bin/sh: indexinfo: not found"
Comment 8 Baptiste Daroussin freebsd_committer freebsd_triage 2019-04-24 06:39:20 UTC
First of all, texinfo and info have been removed from world long ago (thus you do not need at all to specify it anymore in your src.conf)

Second indexinfo should be automatically triggered as a dependency by the ports tree. I don't know why it is not the case. And that is where the bug is.

indexinfo has been created to avoid a huge dependency on the big texinfo for the very simple task of creating the index for the info files. It is very small and thin on purpose.

The fact it is not on your system is what should be tracked down as a bug.

Now the fact pkg does not have the equivalent of the yum feature is due to the fact noone took time to provide a patch for that. it is in the todo list since day 1
Comment 9 Colin Percival freebsd_committer freebsd_triage 2019-04-24 06:48:36 UTC
(In reply to Baptiste Daroussin from comment #8)

Baptiste, the problem is that indexinfo is installed as /usr/local/bin/indexinfo but the post-install scripts don't specify the full path and pkg(8) doesn't adjust its PATH to include /usr/local/bin.
Comment 10 Baptiste Daroussin freebsd_committer freebsd_triage 2019-04-24 07:35:39 UTC
None of the keywords are doing that (adjusting the path) and we never got issue so far.
Comment 11 Colin Percival freebsd_committer freebsd_triage 2019-04-24 08:27:58 UTC
(In reply to Baptiste Daroussin from comment #10)

I've heard from several users who ran into this exact error.  I suspect the only reason you haven't heard from them is that people tend to shrug their shoulders and say "oh well I wasn't using info anyway".
Comment 12 Sergey 2019-04-24 12:28:37 UTC
(In reply to Baptiste Daroussin from comment #8)
Hello Baptiste,
As I don't have INFO pages installed on my system anyway, is there a way to disable pkg from triggering the indexinfo? I just don't use/need it.
Comment 13 Baptiste Daroussin freebsd_committer freebsd_triage 2019-04-24 12:34:29 UTC
as I was saying noone anymore has info pages installed on the system :)

no it is for now impossible to prevent triggering indexinfo at all.
Comment 14 Sergey 2019-04-24 12:46:53 UTC
(In reply to Baptiste Daroussin from comment #13)
In this case I'm closing this task,
Thank you)