diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-04-05 09:41:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-04-08 12:51:00 +0200 |
commit | 01d848149c22a69a62eada5fedc2406c54d95ba8 (patch) | |
tree | 66a3b59619f32f7f7244200f810f4d4cc9115ca5 /build2/cc/pkgconfig.cxx | |
parent | 3392226a2248b5cd93a899afb986917ce9e7ad74 (diff) |
Support for --dry-run|-n mode, perform update part
Diffstat (limited to 'build2/cc/pkgconfig.cxx')
-rw-r--r-- | build2/cc/pkgconfig.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx index eef1271..6f30dc9 100644 --- a/build2/cc/pkgconfig.cxx +++ b/build2/cc/pkgconfig.cxx @@ -1234,9 +1234,6 @@ namespace build2 auto* t (find_adhoc_member<pc> (l)); assert (t != nullptr); - const path& p (t->path ()); - auto_rmfile arm (p); - // By default we assume things go into install.{include, lib}. // using install::resolve_dir; @@ -1244,9 +1241,16 @@ namespace build2 dir_path idir (resolve_dir (l, cast<dir_path> (l["install.include"]))); dir_path ldir (resolve_dir (l, cast<dir_path> (l["install.lib"]))); + const path& p (t->path ()); + if (verb >= 2) text << "cat >" << p; + if (dry_run) + return; + + auto_rmfile arm (p); + try { ofdstream os (p); |