Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#72579 - [lesspipe] conflict with python-html2text as optional dependency

Attached to Project: Community Packages
Opened by lemen (lmn) - Friday, 29 October 2021, 17:14 GMT
Last edited by Konstantin Gizdov (kgizdov) - Friday, 26 November 2021, 14:15 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Konstantin Gizdov (kgizdov)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The lesspipe package lists html2text as an optional dependency. The only package in the standard repos that provide html2text is python-html2text.
This version of html2text does not work with lesspipe as it uses a different syntax and breaks lesspipe, see [1]. In fact many programs have converged on the name html2text.
The problem arises from the fact that lesspipe only searches for an executable with the name html2text.

A proposed fix would be to remove the optional dependency on html2text and replace it with one of the other alternatives:
(1) lynx
(2) w3m
(3) elinks
(4) links
all of which are provided in the standard repositories, and add a conflict with python-html2text.
As is stands now html2text is the first program tried by lesspipe and causes it to fail.

There will still be a lingering problem if a user has none of the above but (a wrong) html2text installed as the presence of html2text enables html parsing.
See the upstram bug report [1] for more information on this. My proposed patch [2] tries to enable a workaround for this specific issue.

To partially remedy this at the moment you could change line 419 to 'html2text<TAB>N' and use the --fixed option for building.
Another approach would be to patch lesspipe.sh.in with the correct syntax for the provided html2text.

The intended html2text can be found here [4]. I have written a PKGBUILD for this version and could upload this to the AUR if this is required (I attach the PKGBUILD for now).


Additional info:
[1] The forum discussion revealing this: https://bbs.archlinux.org/viewtopic.php?id=270122
[2] upstream bug report: https://github.com/wofr06/lesspipe/issues/60
[3] upstram patch proposal: https://github.com/wofr06/lesspipe/pull/63
[4] https://github.com/grobian/html2text

Steps to reproduce:
install lesspipe and python-html2text
lesspipe.sh some.pdf
This task depends upon

Closed by  Konstantin Gizdov (kgizdov)
Friday, 26 November 2021, 14:15 GMT
Reason for closing:  Fixed
Comment by lemen (lmn) - Friday, 29 October 2021, 17:21 GMT
I forgot to add the package version: lesspipe 1.89-1
and the uploaded PKGBUILD.
   PKGBUILD (0.6 KiB)
Comment by Konstantin Gizdov (kgizdov) - Sunday, 21 November 2021, 02:39 GMT
Could you try this lesspipe 1.91-2?
Comment by lemen (lmn) - Wednesday, 24 November 2021, 17:13 GMT
The issue still persists in lesspipe 1.91-2 and python-html2text 2020.1.16-3.
The problem is that lesspipe still presumes any executable with the name html2text to be the one in [4].
Comment by Konstantin Gizdov (kgizdov) - Wednesday, 24 November 2021, 22:30 GMT
Sorry, I don't understand. The html2text call is adjusted as the hints in the respective upstream discussion. It should also conform to what Arch's python-html2text expects. It won't be feasible to have a conflict with python-html2text nor will it be feasible to ship the package in [4]. Could you provide me with a test case - like input, commands and expected output that fails, so I can debug more? Thanks.
Comment by lemen (lmn) - Thursday, 25 November 2021, 15:51 GMT
I should have read the PKGBUILD instead of just looking at the package.
The patch is correct but is then overwritten by the the `configure` command, which creates a new `lesspipe.sh`.
The only change to be made is to patch `lesspipe.sh.in` instead of `lesspipe.sh`.

Steps to reproduce:
(1) uninstall python-html2text
(2) lesspipe.sh any.pdf
Works as expected.
(3) install python-html2text
(4) lesspipe.sh any.pdf
Displays the error message in [1].
Thank you.

Comment by Konstantin Gizdov (kgizdov) - Friday, 26 November 2021, 12:48 GMT
completely my bad. I patched the wrong file - try lesspipe 1.91-3
Comment by lemen (lmn) - Friday, 26 November 2021, 14:09 GMT
Works as expected in lesspipe 1.91-3. Thank you.

Loading...