mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Remove RelPath::DOWNLOAD
This commit is contained in:
parent
4f213adf09
commit
5763c09be1
@ -1,4 +1,4 @@
|
|||||||
use crate::path::{Dirs, RelPath};
|
use crate::path::Dirs;
|
||||||
use crate::prepare::GitRepo;
|
use crate::prepare::GitRepo;
|
||||||
use crate::utils::{CargoProject, Compiler, spawn_and_wait};
|
use crate::utils::{CargoProject, Compiler, spawn_and_wait};
|
||||||
use crate::{CodegenBackend, SysrootKind, build_sysroot};
|
use crate::{CodegenBackend, SysrootKind, build_sysroot};
|
||||||
@ -20,7 +20,7 @@ pub(crate) fn run(
|
|||||||
rustup_toolchain_name: Option<&str>,
|
rustup_toolchain_name: Option<&str>,
|
||||||
bootstrap_host_compiler: &Compiler,
|
bootstrap_host_compiler: &Compiler,
|
||||||
) {
|
) {
|
||||||
RelPath::DOWNLOAD.ensure_exists(dirs);
|
std::fs::create_dir_all(&dirs.download_dir).unwrap();
|
||||||
ABI_CAFE_REPO.fetch(dirs);
|
ABI_CAFE_REPO.fetch(dirs);
|
||||||
ABI_CAFE_REPO.patch(dirs);
|
ABI_CAFE_REPO.patch(dirs);
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ pub(crate) struct Dirs {
|
|||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub(crate) enum PathBase {
|
pub(crate) enum PathBase {
|
||||||
Source,
|
Source,
|
||||||
Download,
|
|
||||||
Build,
|
Build,
|
||||||
Dist,
|
Dist,
|
||||||
}
|
}
|
||||||
@ -23,7 +22,6 @@ impl PathBase {
|
|||||||
fn to_path(self, dirs: &Dirs) -> PathBuf {
|
fn to_path(self, dirs: &Dirs) -> PathBuf {
|
||||||
match self {
|
match self {
|
||||||
PathBase::Source => dirs.source_dir.clone(),
|
PathBase::Source => dirs.source_dir.clone(),
|
||||||
PathBase::Download => dirs.download_dir.clone(),
|
|
||||||
PathBase::Build => dirs.build_dir.clone(),
|
PathBase::Build => dirs.build_dir.clone(),
|
||||||
PathBase::Dist => dirs.dist_dir.clone(),
|
PathBase::Dist => dirs.dist_dir.clone(),
|
||||||
}
|
}
|
||||||
@ -38,7 +36,6 @@ pub(crate) enum RelPath {
|
|||||||
|
|
||||||
impl RelPath {
|
impl RelPath {
|
||||||
pub(crate) const SOURCE: RelPath = RelPath::Base(PathBase::Source);
|
pub(crate) const SOURCE: RelPath = RelPath::Base(PathBase::Source);
|
||||||
pub(crate) const DOWNLOAD: RelPath = RelPath::Base(PathBase::Download);
|
|
||||||
pub(crate) const BUILD: RelPath = RelPath::Base(PathBase::Build);
|
pub(crate) const BUILD: RelPath = RelPath::Base(PathBase::Build);
|
||||||
pub(crate) const DIST: RelPath = RelPath::Base(PathBase::Dist);
|
pub(crate) const DIST: RelPath = RelPath::Base(PathBase::Dist);
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ use crate::path::{Dirs, RelPath};
|
|||||||
use crate::utils::{copy_dir_recursively, ensure_empty_dir, spawn_and_wait};
|
use crate::utils::{copy_dir_recursively, ensure_empty_dir, spawn_and_wait};
|
||||||
|
|
||||||
pub(crate) fn prepare(dirs: &Dirs) {
|
pub(crate) fn prepare(dirs: &Dirs) {
|
||||||
RelPath::DOWNLOAD.ensure_exists(dirs);
|
std::fs::create_dir_all(&dirs.download_dir).unwrap();
|
||||||
crate::tests::RAND_REPO.fetch(dirs);
|
crate::tests::RAND_REPO.fetch(dirs);
|
||||||
crate::tests::REGEX_REPO.fetch(dirs);
|
crate::tests::REGEX_REPO.fetch(dirs);
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ impl GitRepo {
|
|||||||
|
|
||||||
fn download_dir(&self, dirs: &Dirs) -> PathBuf {
|
fn download_dir(&self, dirs: &Dirs) -> PathBuf {
|
||||||
match self.url {
|
match self.url {
|
||||||
GitRepoUrl::Github { user: _, repo } => RelPath::DOWNLOAD.join(repo).to_path(dirs),
|
GitRepoUrl::Github { user: _, repo } => dirs.download_dir.join(repo),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user