registration script involves an escape character breaking the script in dash
Task Info (Flyspray) | |
---|---|
Opened By | Nils Trubkin (zeraoo) |
Task ID | 74800 |
Type | Bug Report |
Project | Community Packages |
Category | Packages |
Version | None |
OS | All |
Opened | 2022-05-19 19:00:03 UTC |
Status | Assigned |
Assignee | Felix Yan (felixonmars) |
Details
(Edit: typos fixed as per comment 1)
Description: The package does not install (register) correctly if the /bin/sh is linked to dash instead of bash. The error message only mentions that registration failed like so:
(2/2) Registering Haskell modules... error: command failed to execute correctly
The error originates from the /usr/share/haskell/register/haskell-lens.sh script. In the haskell-lens.sh line 70 column 33 there is a "documentation/comment" piece that involves a lambda (as Haskell sees it) or an escape symbol \ as dash sees it.
Here is the entire line that is causing the issue (the 'a' in the fmap lambda is escaped): > bar f (Foo a b c) = fmap (\a''' -> Foo a''' b c) (f a)
Here is the same line without the illegal character: > bar f (Foo a b c) = fmap (a''' -> Foo a''' b c) (f a)
Running this script gives an error below:
Reading package info from stdin ... ghc-pkg: "the input" (line 68, column 5): unexpected character in input '\a' expecting field or section name or end of file
To fix this, the user should do one of the following: (1) change shebang to #!/bin/bash (2) run script as bash haskell-lens.sh (3) remove the escape character at position (70, 33)
Additional info: haskell-lens-5.1-37-x86_64
Steps to reproduce: rm /bin/sh ln -s dash /bin/sh pacman -Suy haskell-lens
This is my first bug report, and took me many hours to get to the bottom of. Let me know if I've incorrectly reported it or if this is considered as an upstream issue, thanks.