diff options
-rw-r--r-- | bdep/sync.cli | 10 | ||||
-rw-r--r-- | bdep/sync.cxx | 12 |
2 files changed, 18 insertions, 4 deletions
diff --git a/bdep/sync.cli b/bdep/sync.cli index fd5a375..bf0fbb5 100644 --- a/bdep/sync.cli +++ b/bdep/sync.cli @@ -224,8 +224,14 @@ namespace bdep "\h|ENVIRONMENT| - To avoid recursive re-synchronization, the \cb{sync} command maintains the - \cb{BDEP_SYNCED_CONFIGS} environment variable. It contains a + The \cb{BDEP_SYNC} environment variable can be used to suppress automatic + synchronization on build system invocation. If set, auto-synchronization + will only be performed if the variable's value is \cb{true} or \cb{1}. The + ability to suppress auto-synchronization can be useful when you don't have + usable \cb{bdep} and/or \cb{bpkg}. + + To avoid recursive re-synchronization, the \cb{sync} command also maintains + the \cb{BDEP_SYNCED_CONFIGS} environment variable. It contains a space-separated, \cb{\"}-quoted list of configuration paths that have been or are being synchronized by the current \cb{bdep} invocation chain. The \cb{sync} command examines this variable and silently ignores diff --git a/bdep/sync.cxx b/bdep/sync.cxx index 8cfdc7a..1620555 100644 --- a/bdep/sync.cxx +++ b/bdep/sync.cxx @@ -436,14 +436,22 @@ namespace bdep // if! $null($cfgs) // cfgs = [dir_paths] $regex.split($cfgs, ' *"([^"]*)" *', '\1') // + // Also note that we try to avoid setting any variables in order + // not to pollute the configuration's root scope. + // os << "# Created automatically by bdep." << endl << "#" << endl << "if ($build.meta_operation != 'info' && \\" << endl << " $build.meta_operation != 'configure' && \\" << endl << " $build.meta_operation != 'disfigure')" << endl - << " run '" << argv0 << "' sync --hook=1 " << + << "{" << endl + << " if ($getenv('BDEP_SYNC') == [null] || \\" << endl + << " $getenv('BDEP_SYNC') == true || \\" << endl + << " $getenv('BDEP_SYNC') == 1)" << endl + << " run '" << argv0 << "' sync --hook=1 " << "--verbose $build.verbosity " << - "--config \"$out_root\"" << endl; + "--config \"$out_root\"" << endl + << "}" << endl; os.close (); } |