dlang / dub

Package and build management system for D
MIT License
673 stars 230 forks source link

dub remove 'xxx-package' doesn't update dub.json and dub.selections.json #1955

Open mw66 opened 4 years ago

mw66 commented 4 years ago

System information

Bug Description

dub add 'xxx-package' will add the package name to the dub.json. but dub remove 'xxx-package' doesn't update dub.json and dub.selections.json:

$ grep  arsd dub.*
dub.json:               "arsd-official": "~>7.2.0",
dub.selections.json:            "arsd-official": "7.2.0",

$ dub.exe remove arsd-official
Removing arsd-official in C:\Users\xxx\AppData\Local\dub\packages\arsd-official-7.2.0\arsd-official\
Removed package: 'arsd-official'
Removed arsd-official, version 7.2.0.

$ grep  arsd dub.*
dub.json:               "arsd-official": "~>7.2.0",
dub.selections.json:            "arsd-official": "7.2.0",

looks like it only clean the cache? it should do the opposite: remove the entry from the dub.json and dub.selections.json, but keep the cached file (then if the user want to add later, it doesn't need to download again).

How to reproduce?

dub.exe add arsd-official
grep  arsd dub.*
dub.exe remove arsd-official
grep  arsd dub.*

Expected Behavior

after removal, the grep should return empty.

Logs

(where I can find the dub working log?)

Panke commented 3 years ago

I'd second this. dub remove should be the opposite from dub add.