From 5268e471d239e6cb00b07a3a4ee6be71284fc28e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2021 11:47:31 +0200 Subject: Reverse default configuration set in deinit --- bdep/deinit.cxx | 11 +++++++++++ tests/update.testscript | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bdep/deinit.cxx b/bdep/deinit.cxx index 90447ad..777e162 100644 --- a/bdep/deinit.cxx +++ b/bdep/deinit.cxx @@ -131,6 +131,17 @@ namespace bdep verify_project_packages (pp, cs); cfgs = move (cs.first); + + // If this is fallback to default configurations, then reverse them: + // this adds a bit of magic to typical tool/module development setups + // where we normally create/initialize the host/build2 configuration + // first and which needs to be deinitialized last. + // + // @@ TODO: maybe we should deinitialize/sync them all at once if they + // belong to the same configuration cluster? + // + if (cs.second) + reverse (cfgs.begin (), cfgs.end ()); } // If no packages were explicitly specified, then we deinitalize all that diff --git a/tests/update.testscript b/tests/update.testscript index 3823b9d..39d20ae 100644 --- a/tests/update.testscript +++ b/tests/update.testscript @@ -122,12 +122,12 @@ deinit += -d prj $deinit 2>>/"EOE" deinitializing in project $~/prj/ - in configuration @cfg1: - synchronizing: - drop pkg1 - in configuration @cfg2: synchronizing: drop pkg2 + + in configuration @cfg1: + synchronizing: + drop pkg1 EOE } -- cgit v1.1