Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copied license files may be overwritten #9184

Open
L-TChen opened this issue Aug 18, 2023 · 0 comments · May be fixed by #9249
Open

Copied license files may be overwritten #9184

L-TChen opened this issue Aug 18, 2023 · 0 comments · May be fixed by #9249

Comments

@L-TChen
Copy link

L-TChen commented Aug 18, 2023

Describe the bug
Multiple license files are allowed in a cabal package description, but their relative paths are not preserved when installing.
Therefore, if the same file name is used in different directories, then only the last entry will be kept.

To Reproduce
Steps to reproduce the behavior:

  1. Consider any .cabal file with an entry:
  license-files: LICENSE somedir/LICENSE
  1. Then, install this project
$ cabal install ...
  1. In the directory ~/.cabal/store/ghc-x.y.z/<mingled_pkgname>/share/doc/, there will be only one LICENSE which is a copy of the last LICENSE.

Expected behavior
Their relative path should be kept.

In particular, takeFileName should be removed from L185 in

let lfiles = licenseFiles pkg_descr
unless (null lfiles) $ do
createDirectoryIfMissingVerbose verbosity True docPref
for_ lfiles $ \lfile' -> do
let lfile :: FilePath
lfile = getSymbolicPath lfile'
installOrdinaryFile verbosity lfile (docPref </> takeFileName lfile)

Additional context
I intend to fix this in #9172 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants