Description of problem: The bash completion file for this package is installed as '/etc/bash_completion.d/cabal'. According to the FHS, files under '/etc/' are for changes by the local administrator only. It should be under '/usr/share' instead. I suggest the completion script should be installed as '/usr/share/bash-completion/completions/cabal', to match the convention used by the 'bash-completion' package. Many (most?) other packages also use this convention, like 'libvirt-bash-completion', for example. Version-Release number of selected component (if applicable): Version: 2.0.0.1 Release: 10.fc29 How reproducible: Always. Steps to Reproduce: 1. Install cabal-install: 'dnf install cabal-install' 2. List the packages files: 'rpm -ql cabal-install | grep completion' Actual results: '/etc/bash_completion.d/cabal' Expected results: '/usr/share/bash-completion/completions/cabal'
Thanks a lot for reporting this, Chris
(Presumably /etc/profile.d/ is still acceptable?) Fixing initially for F30/Rawhide and F29...
> Thanks a lot for reporting this, Chris No problemo. Thank you for maintaining all these Haskell packages :^). > (Presumably /etc/profile.d/ is still acceptable?) You mean the '/etc/profile.d/cabal-install.sh' file? Didn't think of that until now. I think it makes sense to keep it there, though, since It's more of a configuration file than a script, and that's where most people will look for things that change their shells environment (other than shell specific startup files). By the way, when looking at 'cabal-install.sh' I noticed that a few parameter expansions are unquoted. Specifically the $HOME variable. This will cause the script to break if the path to a users home directory has a space in it. (For example, if $HOME comes from a network share with windows-y path names.) Simply quoting all the variables will fix this. I'll submit a new bug report with better description and a rewritten version of the 'cabal-install.sh' tomorrow after I get some sleep. (It would be best if all shell scripts sent to the Fedora package build system was automatically linted by ShellCheck. Unquoted variables are an extremely common and easy to fix syntax error.)
cabal-install-2.0.0.1-11.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-18ada39c0c
(In reply to Chris King-Parra from comment #3) > Simply quoting all the variables will fix this. I'll > submit a new bug report with better description and a > rewritten version of the 'cabal-install.sh' tomorrow > after I get some sleep. Thanks! That would be good > (It would be best if all shell scripts sent to the > Fedora package build system was automatically linted > by ShellCheck. Unquoted variables are an extremely > common and easy to fix syntax error.) That's true. Maybe some job could be added to taskotron say.
cabal-install-2.0.0.1-11.fc29 has been pushed to the Fedora 29 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-2019-18ada39c0c
> > Simply quoting all the variables will fix this. I'll > > submit a new bug report with better description and a > > rewritten version of the 'cabal-install.sh' tomorrow > > after I get some sleep. > > Thanks! That would be good Turns out that the script works as intended. That is because unquoted variables don't undergo word splitting in assignment statements. It's just unsafe to leave them unquoted in any other circumstance (eg as arguments to commands, etc.) Since it doesn't break anything, I didn't file a bug report. Here's an edited version, just in case you feel like updating it to encourage the use of quotes by local admins if they make changes. #!/bin/sh # add ~/.cabal/bin to the users PATH is it exists CABALBIN="${HOME}/.cabal/bin" if ! echo "${PATH}" | /bin/grep -q "${CABALBIN}" ; then if [ -d "${CABALBIN}" ]; then PATH="${PATH}:${CABALBIN}" export PATH fi fi
Thanks, Chris, for the attention to detail. Your changes should be in https://src.fedoraproject.org/rpms/cabal-install/c/362f69476a397a077e80877a3d1a189ba55577f3?branch=master cheers!
cabal-install-2.0.0.1-11.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.