diff options
-rw-r--r-- | bpkg/cfg-create-options.cli | 4 | ||||
-rw-r--r-- | bpkg/cfg-create.cxx | 32 |
2 files changed, 29 insertions, 7 deletions
diff --git a/bpkg/cfg-create-options.cli b/bpkg/cfg-create-options.cli index 25bdd7a..fccbb57 100644 --- a/bpkg/cfg-create-options.cli +++ b/bpkg/cfg-create-options.cli @@ -25,8 +25,8 @@ namespace bpkg configuration directory to be empty or to not exist (in which case it will be created). - By default the resulting configuration only loads the \cb{config} and - \cb{install} modules. However, additional modules and, if required, + By default the resulting configuration loads the \cb{config}, \cb{test}, + and \cb{install} modules. However, additional modules and, if required, their configuration variables can be specified as the \cb{cfg-create} arguments. For example: diff --git a/bpkg/cfg-create.cxx b/bpkg/cfg-create.cxx index b25100b..db05595 100644 --- a/bpkg/cfg-create.cxx +++ b/bpkg/cfg-create.cxx @@ -75,15 +75,36 @@ namespace bpkg ofs.exceptions (ofstream::badbit | ofstream::failbit); ofs.open (f.string ()); - ofs << "# Maintained automatically by bpkg, do not edit." << endl + ofs << "# Maintained automatically by bpkg. Edit if you know what " << + "you are doing." << endl << "#" << endl << "project =" << endl << "amalgamation =" << endl + << endl << "using config" << endl + << "using test" << endl << "using install" << endl; + } + catch (const ofstream::failure&) + { + fail << "unable to write to " << f; + } + + // Write build/root.build. + // + f = b / path ("root.build"); + try + { + ofstream ofs; + ofs.exceptions (ofstream::badbit | ofstream::failbit); + ofs.open (f.string ()); + + ofs << "# Maintained automatically by bpkg. Edit if you know what " << + "you are doing." << endl + << "#" << endl; - // Load user-supplied modules in bootstrap.build instead of root.build - // since we don't know whether they can be loaded in the latter. + // Load user-supplied modules. We don't really know whether they must + // be loaded in bootstrap. // for (const string& m: mods) ofs << "using " << m << endl; @@ -95,14 +116,15 @@ namespace bpkg // Write root buildfile. // - f = path (c / path ("buildfile")); + f = c / path ("buildfile"); try { ofstream ofs; ofs.exceptions (ofstream::badbit | ofstream::failbit); ofs.open (f.string ()); - ofs << "# Maintained automatically by bpkg, do not edit." << endl + ofs << "# Maintained automatically by bpkg. Edit if you know what " << + "you are doing." << endl << "#" << endl << "./:" << endl; } |