Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
207fc0bb
R
Rust
项目概览
int
/
Rust
接近 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
207fc0bb
编写于
12月 04, 2017
作者:
Z
Zack M. Davis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
template month/year, version into man pages while building dist tarball
This is meant to resolve #25689.
上级
a4fa23a5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
6 deletion
+35
-6
src/bootstrap/dist.rs
src/bootstrap/dist.rs
+17
-2
src/bootstrap/util.rs
src/bootstrap/util.rs
+16
-2
src/doc/man/rustc.1
src/doc/man/rustc.1
+1
-1
src/doc/man/rustdoc.1
src/doc/man/rustdoc.1
+1
-1
未找到文件。
src/bootstrap/dist.rs
浏览文件 @
207fc0bb
...
...
@@ -28,7 +28,7 @@
use
{
Build
,
Compiler
,
Mode
};
use
channel
;
use
util
::{
cp_r
,
libdir
,
is_dylib
,
cp_filtered
,
copy
};
use
util
::{
cp_r
,
libdir
,
is_dylib
,
cp_filtered
,
copy
,
replace_in_file
};
use
builder
::{
Builder
,
RunConfig
,
ShouldRun
,
Step
};
use
compile
;
use
tool
::{
self
,
Tool
};
...
...
@@ -434,7 +434,22 @@ fn prepare_image(builder: &Builder, compiler: Compiler, image: &Path) {
// Man pages
t!
(
fs
::
create_dir_all
(
image
.join
(
"share/man/man1"
)));
cp_r
(
&
build
.src
.join
(
"src/doc/man"
),
&
image
.join
(
"share/man/man1"
));
let
man_src
=
build
.src
.join
(
"src/doc/man"
);
let
man_dst
=
image
.join
(
"share/man/man1"
);
let
date_output
=
output
(
Command
::
new
(
"date"
)
.arg
(
"+%B %Y"
));
let
month_year
=
date_output
.trim
();
// don't use our `bootstrap::util::{copy, cp_r}`, because those try
// to hardlink, and we don't want to edit the source templates
for
entry_result
in
t!
(
fs
::
read_dir
(
man_src
))
{
let
file_entry
=
t!
(
entry_result
);
let
page_src
=
file_entry
.path
();
let
page_dst
=
man_dst
.join
(
file_entry
.file_name
());
t!
(
fs
::
copy
(
&
page_src
,
&
page_dst
));
// template in month/year and version number
replace_in_file
(
&
page_dst
,
&
[(
"<INSERT DATE HERE>"
,
month_year
),
(
"<INSERT VERSION HERE>"
,
channel
::
CFG_RELEASE_NUM
)]);
}
// Debugger scripts
builder
.ensure
(
DebuggerScripts
{
...
...
src/bootstrap/util.rs
浏览文件 @
207fc0bb
...
...
@@ -15,8 +15,8 @@
use
std
::
env
;
use
std
::
str
;
use
std
::
fs
::{
self
,
File
};
use
std
::
io
::{
self
,
Read
,
Write
};
use
std
::
fs
::{
self
,
File
,
OpenOptions
};
use
std
::
io
::{
self
,
Read
,
Write
,
Seek
,
SeekFrom
};
use
std
::
path
::{
Path
,
PathBuf
};
use
std
::
process
::
Command
;
use
std
::
time
::{
SystemTime
,
Instant
};
...
...
@@ -51,6 +51,20 @@ pub fn copy(src: &Path, dst: &Path) {
t!
(
filetime
::
set_file_times
(
dst
,
atime
,
mtime
));
}
/// Search-and-replaces within a file. (Not maximally efficiently: allocates a
/// new string for each replacement.)
pub
fn
replace_in_file
(
path
:
&
Path
,
replacements
:
&
[(
&
str
,
&
str
)])
{
let
mut
contents
=
String
::
new
();
let
mut
file
=
t!
(
OpenOptions
::
new
()
.read
(
true
)
.write
(
true
)
.open
(
path
));
t!
(
file
.read_to_string
(
&
mut
contents
));
for
&
(
target
,
replacement
)
in
replacements
{
contents
=
contents
.replace
(
target
,
replacement
);
}
t!
(
file
.seek
(
SeekFrom
::
Start
(
0
)));
t!
(
file
.set_len
(
0
));
t!
(
file
.write_all
(
contents
.as_bytes
()));
}
pub
fn
read_stamp_file
(
stamp
:
&
Path
)
->
Vec
<
PathBuf
>
{
let
mut
paths
=
Vec
::
new
();
let
mut
contents
=
Vec
::
new
();
...
...
src/doc/man/rustc.1
浏览文件 @
207fc0bb
.TH RUSTC "1" "
September 2016" "rustc 1.13.0
" "User Commands"
.TH RUSTC "1" "
<INSERT DATE HERE>" "rustc <INSERT VERSION HERE>
" "User Commands"
.SH NAME
rustc \- The Rust compiler
.SH SYNOPSIS
...
...
src/doc/man/rustdoc.1
浏览文件 @
207fc0bb
.TH RUSTDOC "1" "
May 2017" "rustdoc 1.19.0
" "User Commands"
.TH RUSTDOC "1" "
<INSERT DATE HERE>" "rustdoc <INSERT VERSION HERE>
" "User Commands"
.SH NAME
rustdoc \- generate documentation from Rust source code
.SH SYNOPSIS
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录