haskell / haskell/cabal

'cabal install mypkg.tar.gz' should also work if contained directory has no version suffix

Open
#1,822 4 comments 0 reactions 0 assignees View on GitHub
cabal-install: v2-build system meta: easy old-milestone: ⊥ type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

When I create tarball with darcs like

```
gnuplot$ darcs dist
Created dist as .../gnuplot/gnuplot.tar.gz
gnuplot$ cabal install gnuplot.tar.gz
...
cabal: Error: some packages failed to install:
gnuplot-0.5.3 failed while unpacking the package. The exception was:
user error (File in tar archive is not in the expected directory. Expected:
"gnuplot-0.5.3" but got the following hierarchy: ["gnuplot"])
```

To me this seems to be overly strict, since if I unpack the tarball then I can install the package without renaming the directory.

```
/tmp$ tar xfz gnuplot.tar.gz
/tmp$ cabal install gnuplot/
```

This works.

Thus I propose to remove the check that the directory contains the version suffix. I think it is even ok to omit any check of the directory name and accept any tarball with a directory containing a Cabal package description file.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.