mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 23:44:17 +08:00
Merge branch 'patch1' into 'master'
fix(cook): copy source only if newer See merge request redox-os/cookbook!440
This commit is contained in:
commit
0afb194125
@ -228,14 +228,17 @@ fn fetch(recipe_dir: &Path, source: &Option<SourceRecipe>) -> Result<PathBuf, St
|
||||
}
|
||||
}
|
||||
Some(SourceRecipe::Path { path }) => {
|
||||
copy_dir_all(path, &source_dir).map_err(|e| {
|
||||
format!(
|
||||
"Couldn't copy source from {} to {}: {}",
|
||||
path,
|
||||
source_dir.display(),
|
||||
e
|
||||
)
|
||||
})?;
|
||||
if modified_dir(Path::new(path))? > modified_dir(&source_dir)? {
|
||||
eprintln!("[DEBUG]: {} is newer than {}", path, source_dir.display());
|
||||
copy_dir_all(path, &source_dir).map_err(|e| {
|
||||
format!(
|
||||
"Couldn't copy source from {} to {}: {}",
|
||||
path,
|
||||
source_dir.display(),
|
||||
e
|
||||
)
|
||||
})?;
|
||||
}
|
||||
}
|
||||
Some(SourceRecipe::Git {
|
||||
git,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user