aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-10 13:41:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-10 13:41:54 +0200
commitc927b2f2a9bcd8d2551759516725917b29903a28 (patch)
tree054dbdc0e8e5a7c1816ddea8bed0a010809390a1
parent4243d26ab9245b64f141c3733726f931c32eccdc (diff)
Write user modules to root.build rather than to bootstrap.build
Now that only "bootstrappable" modules can be loaded during bootstrap.
-rw-r--r--bpkg/cfg-create-options.cli4
-rw-r--r--bpkg/cfg-create.cxx32
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;
}