Copied license files may be overwritten
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**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
```
2. Then, install this project
```
$ cabal install ...
```
3. In the directory `~/.cabal/store/ghc-x.y.z//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
https://github.com/haskell/cabal/blob/f465da4d27a488796d357a478bdf454110c4cf3e/Cabal/src/Distribution/Simple/Install.hs#L179-L185
**Additional context**
I intend to fix this in #9172 as well.
Contributor guide
Assessment
This issue has not been assessed yet.