mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 23:44:17 +08:00
Run cargo fetch on fetch
This commit is contained in:
parent
35d0495769
commit
4493fcb0a8
@ -306,6 +306,14 @@ pub fn fetch(recipe_dir: &Path, recipe: &Recipe, logger: &PtyOut) -> Result<Path
|
||||
}
|
||||
}
|
||||
|
||||
if let BuildKind::Cargo {
|
||||
package_path,
|
||||
cargoflags: _,
|
||||
} = &recipe.build.kind
|
||||
{
|
||||
fetch_cargo(&source_dir, package_path.as_ref(), logger)?;
|
||||
}
|
||||
|
||||
Ok(source_dir)
|
||||
}
|
||||
|
||||
@ -382,6 +390,31 @@ pub(crate) fn fetch_extract_tar(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn fetch_cargo(
|
||||
recipe_dir: &PathBuf,
|
||||
package_path: Option<&String>,
|
||||
logger: &PtyOut,
|
||||
) -> Result<(), String> {
|
||||
let mut target_dir = recipe_dir.clone();
|
||||
if let Some(package_path) = package_path {
|
||||
target_dir = target_dir.join(package_path);
|
||||
}
|
||||
|
||||
let mut command = if is_redox() {
|
||||
Command::new("cargo")
|
||||
} else {
|
||||
let cookbook_redoxer = Path::new("target/release/cookbook_redoxer")
|
||||
.canonicalize()
|
||||
.unwrap_or(PathBuf::from("/bin/false"));
|
||||
Command::new(&cookbook_redoxer)
|
||||
};
|
||||
command.arg("fetch");
|
||||
command.arg("--manifest-path");
|
||||
command.arg(target_dir.join("Cargo.toml").into_os_string());
|
||||
run_command(command, logger)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn fetch_is_patches_newer(
|
||||
recipe_dir: &Path,
|
||||
patches: &Vec<String>,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user