From 5521a0edd9a2ba8429f7d2e48f754c9d6f66cc3b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Aug 2020 12:04:33 +0200 Subject: Add mvfile() filesystem utility function --- libbuild2/version/init.cxx | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'libbuild2/version/init.cxx') diff --git a/libbuild2/version/init.cxx b/libbuild2/version/init.cxx index 7cb5a48..43b6b92 100644 --- a/libbuild2/version/init.cxx +++ b/libbuild2/version/init.cxx @@ -370,25 +370,13 @@ namespace build2 // The plan is simple: fixing up the version in a temporary file then // move it to the original. // - try - { - auto_rmfile t (fixup_manifest (rs.ctx, - f, - path::temp_path ("manifest"), - m.version)); - - mvfile (t.path, f, (cpflags::overwrite_content | - cpflags::overwrite_permissions)); - t.cancel (); - } - catch (const io_error& e) - { - fail << "unable to overwrite " << f << ": " << e; - } - catch (const system_error& e) // EACCES, etc. - { - fail << "unable to overwrite " << f << ": " << e; - } + auto_rmfile t (fixup_manifest (rs.ctx, + f, + path::temp_path ("manifest"), + m.version)); + + mvfile (t.path, f, verb_never); + t.cancel (); } static const module_functions mod_functions[] = -- cgit v1.1