mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #155194 - davidkna:man-version, r=clubby789
Fix manpage version replacement and use verbose version - Fix a bug where `t!(fs::copy(&page_src, &page_dst))` was called after`fs::write`, silently overwriting the substituted content with the original template (restoring the `<INSERT VERSION HERE>` placeholder verbatim) (Related rust-lang/rust#93685) - Use `rust_info().version()` instead of the bare version number, so the man page now includes the full version string with commit hash and date
This commit is contained in:
@@ -636,9 +636,9 @@ fn prepare_image(builder: &Builder<'_>, target_compiler: Compiler, image: &Path)
|
||||
let page_src = file_entry.path();
|
||||
let page_dst = man_dst.join(file_entry.file_name());
|
||||
let src_text = t!(std::fs::read_to_string(&page_src));
|
||||
let new_text = src_text.replace("<INSERT VERSION HERE>", &builder.version);
|
||||
let version = builder.rust_info().version(builder.build, &builder.version);
|
||||
let new_text = src_text.replace("<INSERT VERSION HERE>", &version);
|
||||
t!(std::fs::write(&page_dst, &new_text));
|
||||
t!(fs::copy(&page_src, &page_dst));
|
||||
}
|
||||
|
||||
// Debugger scripts
|
||||
|
||||
Reference in New Issue
Block a user