[build2] Feature Requestion: "Hard-Reset" All Configuration Directories

Klaim - Joël Lamotte mjklaim at gmail.com
Thu Nov 22 22:59:02 UTC 2018


Hey all,
short summary: I would like a command to recreate all the config
directories that I just deleted.

Long version:

I often find myself in situations where I want to remove all
configuration files for a set of projects, so I simply delete them.
This makes bdep report an error each time I try to do anything with it
from one of the projects:

> bdep status
error: configuration directory E:\Projects\build2-libs\build-modules\
no longer exists
  info: use config move command if it has been moved/renamed
  info: use config remove commands if it has been removed
> bdep config list
E:\Projects\build2-libs\build-modules\ 1 default,forwarded,auto-synchronized
> bdep config remove default
error: no configurations specified
> bdep config remove 1
error: no configurations specified
> bdep config remove E:\Projects\build2-libs\build-modules\
error: no configurations specified
> bdep config remove "E:\Projects\build2-libs\build-modules\"
error: no configurations specified

(BTW what is the right argument to `bdep config remove` here?)

For several months now, my way of solving this was to delete the .dep
of each file too,
then do `bdep init -C ...` from one of the related projects.

Suggestion:
Assuming that most of the time I want no special config setup for my
config directory, I think it would be useful to be able to "reset
hard" a configuration that should exist but doesn't anymore.
Something like

> bdep init --force

Then it create a configuration exactly like if I did:

> bdep init -C <path-to-default-config>

Then if I have several configs:

> bdep init --all --force

would do `bdep init -C ` with each of the registered configurations
directory if it doesn't exist already.

I've been annoyed by that issue each time I need to do manually `bdep
init -C` after deleting config directories, in particular when I'm
using several different config dirs for several projects.
In the past I needed to delete these directories because they were in
bad state because of bugs, recently it's more to avoid issues when I
upgrade my build2 version (often a stage version currently, and always
by deleting the previous install and installing it again - just to be
sure).
I know, and bdep knows too(!!!) which configuration directories I want
to setup. So it would be nice if bdep helped with that by providing a
way to recreate them.
Also, I understand that deleting the configuration directories makes
me lose the specific config I setup there, but I'm totally fine with
that (even for real dev, not only for exploration, the default are
often what I want while I'm developing- and I can configure the
directories once they are all created - and if I'm in a more complex
setup I will simply not delete the config files or keep the scripts
that define the configuration variables).

This is why I would only expect a command to reset/recreate my
configuration directories to only relie on their path and use no
special config variables.


Side note:
I have some other related pain points to share but I think I need
another tool over bdep (or maybe an extension to bdep) to solve them,
I didn't have time yet to redact my proposal but it's coming soon.

Joël



More information about the users mailing list