cabal v2-install does not re-register a package unregistered by ghc-pkg
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
If a package is unregistered by ghc-pkg, cabal v2-install does not register the package again.
v2-install seems to check the package directory in the store, but not package db.
**To Reproduce**
Steps to reproduce the behavior:
1. In package source directory, cabal v2-install
2. ghc-pkg unregister --package-db=$HOME/.cabal/store/ghc-8.8.1/package.db
3. In package source directory, cabal v2-install ==> just print "up to date"
4. ghc-pkg list --package-db=$HOME/.cabal/store/ghc-8.8.1/package.db ==> no that package
```
$ ghc-pkg list --package-db=/home/esrevinu/.cabal/store/ghc-8.8.1/package.db
/home/esrevinu/.cabal/store/ghc-8.8.1/package.db
hakyll-4.13.0.1
lrucache-1.2.0.1
time-locale-compat-0.1.1.5
$ ghc-pkg unregister hakyll --package-db=/home/esrevinu/.cabal/store/ghc-8.8.1/package.db
$ ghc-pkg list --package-db=/home/esrevinu/.cabal/store/ghc-8.8.1/package.db
/home/esrevinu/.cabal/store/ghc-8.8.1/package.db
lrucache-1.2.0.1
time-locale-compat-0.1.1.5
$ cabal v2-install --disable-documentation --ghc-option=-dynamic --allow-newer
Wrote tarball sdist to
/home/esrevinu/local/hakyll/dist-newstyle/sdist/hakyll-4.13.0.1.tar.gz
Resolving dependencies...
Up to date
Symlinking 'hakyll-init'
cabal v2-install --disable-documentation --ghc-option=-dynamic --allow-newer 4.92s user 0.51s system 99% cpu 5.459 total
$ ghc-pkg list --package-db=/home/esrevinu/.cabal/store/ghc-8.8.1/package.db
/home/esrevinu/.cabal/store/ghc-8.8.1/package.db
lrucache-1.2.0.1
time-locale-compat-0.1.1.5
```
**Expected behavior**
The package should be re-added in the package db.
**System information**
- Operating system : Arch Linux
- `cabal`, `ghc` versions : cabal-install version 3.0.0.0
compiled using version 3.0.0.0 of the Cabal library
Contributor guide
Assessment
This issue has not been assessed yet.