Bug 1592433 - Uninstalling a package with an info page does not remove the info page from the info directory index
Summary: Uninstalling a package with an info page does not remove the info page from t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: texinfo
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jason Tibbitts
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-18 14:12 UTC by Petr Pisar
Modified: 2018-06-26 17:34 UTC (History)
7 users (show)

Fixed In Version: texinfo-6.5-4.fc28
Clone Of:
Environment:
Last Closed: 2018-06-26 17:34:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2018-06-18 14:12:25 UTC
If you install time-1.9-2.fc29 package a "Time (time)" entry appears in the info directory index. If you uninstall the package, the entry won't disappear from the index.

Please note time-1.9-2.fc29 is the first "time" package that does not call install-info explicitly from its scriptlets. 

I observe the same behavior with other packages like sharutils or cvs. It looks like a bug in info-6.5-4.fc29.x86_64.

Comment 1 Jason Tibbitts 2018-06-18 17:07:49 UTC
It would be useful to know what this gives you:

  fix-info-dir --delete /usr/share/info/dir

For me on this random F28 machine I get three errors:

Backed up dir to dir.old.
install-info: No such file or directory for LaTeX2e-fr
install-info: No such file or directory for libidn2
install-info: No such file or directory for pod2texi
0 total invalid menu item(s) were removed from /usr/share/info/dir

Running with --debug does show that it's calling

install-info --remove pod2texi dir

Adding --debug to that gives me this:

debug: reading dir file dir
debug: reading input file pod2texi
install-info: No such file or directory for pod2texi 

Which, yeah, there's no pod2texi.  Of course there isn't; that's why I want to remove it.

Looking at the install-info source, it appears that if you don't pass --remove-exactly to install-info then it tries to look at the info file it's supposed to be removing to figure out which entries to remove.

So the bug here is that fix-info-dir needs to call install-info --remove --remove-exactly, which is just a single-line patch:

diff --git a/contrib/fix-info-dir b/contrib/fix-info-dir
index 4439ada..c054787 100755
--- a/contrib/fix-info-dir
+++ b/contrib/fix-info-dir
@@ -294,7 +294,7 @@ else
        DONE_MSG="total invalid menu item(s) were removed from `pwd`/$DIR_FILE"
        for Info_Name in `comm -23 $TMP_FILE1 $TMP_FILE2`; do
                Changed="y"
-               if install-info --remove $Info_Name $DIR_FILE; then
+               if install-info --remove --remove-exactly $Info_Name $DIR_FILE; then
                        Total=`expr "$Total" + "1"`
                fi
        done

I thought this might be one of spot's packages and so I was going to say that I'd just push this fix if someone else would ack that it works for them.  However, it's not one of spot's packages, so if one of the maintainers wants me to push a fix, let me know.  Otherwise if I can get an ack that this works for someone else, I can send a PR.

Comment 2 Sergio Durigan Junior 2018-06-18 17:44:27 UTC
Confirming that GDB also suffers from this problem, and that Jason's solution fixes it.

Comment 3 Petr Pisar 2018-06-19 05:51:43 UTC
I confirm the patch fixes it for me.

Comment 4 Vitezslav Crhonek 2018-06-19 07:42:13 UTC
(In reply to Jason Tibbitts from comment #1)
> It would be useful to know what this gives you:
> 
>   fix-info-dir --delete /usr/share/info/dir
> 
> For me on this random F28 machine I get three errors:
> 
> Backed up dir to dir.old.
> install-info: No such file or directory for LaTeX2e-fr
> install-info: No such file or directory for libidn2
> install-info: No such file or directory for pod2texi
> 0 total invalid menu item(s) were removed from /usr/share/info/dir
> 
> Running with --debug does show that it's calling
> 
> install-info --remove pod2texi dir
> 
> Adding --debug to that gives me this:
> 
> debug: reading dir file dir
> debug: reading input file pod2texi
> install-info: No such file or directory for pod2texi 
> 
> Which, yeah, there's no pod2texi.  Of course there isn't; that's why I want
> to remove it.
> 
> Looking at the install-info source, it appears that if you don't pass
> --remove-exactly to install-info then it tries to look at the info file it's
> supposed to be removing to figure out which entries to remove.
> 
> So the bug here is that fix-info-dir needs to call install-info --remove
> --remove-exactly, which is just a single-line patch:
> 
> diff --git a/contrib/fix-info-dir b/contrib/fix-info-dir
> index 4439ada..c054787 100755
> --- a/contrib/fix-info-dir
> +++ b/contrib/fix-info-dir
> @@ -294,7 +294,7 @@ else
>         DONE_MSG="total invalid menu item(s) were removed from
> `pwd`/$DIR_FILE"
>         for Info_Name in `comm -23 $TMP_FILE1 $TMP_FILE2`; do
>                 Changed="y"
> -               if install-info --remove $Info_Name $DIR_FILE; then
> +               if install-info --remove --remove-exactly $Info_Name
> $DIR_FILE; then
>                         Total=`expr "$Total" + "1"`
>                 fi
>         done
> 
> I thought this might be one of spot's packages and so I was going to say
> that I'd just push this fix if someone else would ack that it works for
> them.  However, it's not one of spot's packages, so if one of the
> maintainers wants me to push a fix, let me know.  Otherwise if I can get an
> ack that this works for someone else, I can send a PR.

Thanks for investigation, Jason. Please go on and push the fix.

Comment 5 Jason Tibbitts 2018-06-19 23:43:10 UTC
OK, will do.

Also, it occurs to me that while the fix-info-dir bug is something that needs fixing anyway, another way to handle info file removal would be to use %transfiletriggerun instead of %transfiletruggerpostun, and call install-info --remove for each *.info file which is being removed.  (The file trigger scriptlet gets a list on STDIN.)

I think the end result is quite the same (assuming this bug is fixed, which I'm doing now) but if there are further issues then perhaps it's something to look at.

Comment 6 Fedora Update System 2018-06-20 00:45:15 UTC
texinfo-6.5-4.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-066a9994da

Comment 7 Vitezslav Crhonek 2018-06-20 09:13:30 UTC
(In reply to Jason Tibbitts from comment #5)
> OK, will do.
> 
> Also, it occurs to me that while the fix-info-dir bug is something that
> needs fixing anyway, another way to handle info file removal would be to use
> %transfiletriggerun instead of %transfiletruggerpostun, and call
> install-info --remove for each *.info file which is being removed.  (The
> file trigger scriptlet gets a list on STDIN.)
> 
> I think the end result is quite the same (assuming this bug is fixed, which
> I'm doing now) but if there are further issues then perhaps it's something
> to look at.

Thanks!

Comment 8 Fedora Update System 2018-06-20 16:08:46 UTC
texinfo-6.5-4.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-066a9994da

Comment 9 Fedora Update System 2018-06-26 17:34:34 UTC
texinfo-6.5-4.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.