From c927b2f2a9bcd8d2551759516725917b29903a28 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Dec 2015 13:41:54 +0200 Subject: Write user modules to root.build rather than to bootstrap.build Now that only "bootstrappable" modules can be loaded during bootstrap. --- bpkg/cfg-create.cxx | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'bpkg/cfg-create.cxx') 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; } -- cgit v1.1