Remove RelPath::DOWNLOAD

This commit is contained in:
bjorn3 2024-09-12 18:48:08 +00:00
parent 4f213adf09
commit 5763c09be1
3 changed files with 4 additions and 7 deletions

View file

@ -1,4 +1,4 @@
use crate::path::{Dirs, RelPath};
use crate::path::Dirs;
use crate::prepare::GitRepo;
use crate::utils::{CargoProject, Compiler, spawn_and_wait};
use crate::{CodegenBackend, SysrootKind, build_sysroot};
@ -20,7 +20,7 @@ pub(crate) fn run(
rustup_toolchain_name: Option<&str>,
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.patch(dirs);

View file

@ -14,7 +14,6 @@ pub(crate) struct Dirs {
#[derive(Debug, Copy, Clone)]
pub(crate) enum PathBase {
Source,
Download,
Build,
Dist,
}
@ -23,7 +22,6 @@ impl PathBase {
fn to_path(self, dirs: &Dirs) -> PathBuf {
match self {
PathBase::Source => dirs.source_dir.clone(),
PathBase::Download => dirs.download_dir.clone(),
PathBase::Build => dirs.build_dir.clone(),
PathBase::Dist => dirs.dist_dir.clone(),
}
@ -38,7 +36,6 @@ pub(crate) enum RelPath {
impl RelPath {
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 DIST: RelPath = RelPath::Base(PathBase::Dist);

View file

@ -8,7 +8,7 @@ use crate::path::{Dirs, RelPath};
use crate::utils::{copy_dir_recursively, ensure_empty_dir, spawn_and_wait};
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::REGEX_REPO.fetch(dirs);
}
@ -79,7 +79,7 @@ impl GitRepo {
fn download_dir(&self, dirs: &Dirs) -> PathBuf {
match self.url {
GitRepoUrl::Github { user: _, repo } => RelPath::DOWNLOAD.join(repo).to_path(dirs),
GitRepoUrl::Github { user: _, repo } => dirs.download_dir.join(repo),
}
}