mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 15:34:18 +08:00
Check pinned rev to fix reload on TUI
This commit is contained in:
parent
b356334d14
commit
35288e173d
@ -717,7 +717,7 @@ fn parse_args(args: Vec<String>) -> Result<(CliConfig, CliCommand, Vec<CookRecip
|
||||
.flatten()
|
||||
{
|
||||
if let Some(SourceRecipe::Git { rev, branch, .. }) = &mut recipe.recipe.source {
|
||||
*rev = Some(gitrev);
|
||||
*rev = Some(gitrev.clone());
|
||||
*branch = None;
|
||||
} else {
|
||||
println!(
|
||||
@ -725,6 +725,7 @@ fn parse_args(args: Vec<String>) -> Result<(CliConfig, CliCommand, Vec<CookRecip
|
||||
recipe.name.as_str()
|
||||
);
|
||||
}
|
||||
recipe.pinned = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,6 +187,8 @@ pub struct CookRecipe {
|
||||
/// If false, it's listed on install config
|
||||
pub is_deps: bool,
|
||||
pub rule: String,
|
||||
/// whether if this recipe is pinned from cookbook.lock
|
||||
pub pinned: bool,
|
||||
}
|
||||
|
||||
impl Recipe {
|
||||
@ -244,6 +246,7 @@ impl CookRecipe {
|
||||
target,
|
||||
is_deps: false,
|
||||
rule: "".into(),
|
||||
pinned: false,
|
||||
})
|
||||
}
|
||||
|
||||
@ -426,6 +429,10 @@ impl CookRecipe {
|
||||
}
|
||||
|
||||
pub fn reload_recipe(&mut self) -> Result<(), PackageError> {
|
||||
if self.pinned {
|
||||
// TODO: print?
|
||||
return Ok(());
|
||||
}
|
||||
self.recipe = Self::from_path(&self.dir, true, self.name.is_host())?.recipe;
|
||||
let _ = self.apply_filesystem_config(&self.rule.clone());
|
||||
Ok(())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user