fix pkg disable ignoring mount overlay flag
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
use std::fs;
|
||||
use crate::utils::fs::removelink::removelink;
|
||||
use crate::utils::shell::*;
|
||||
use crate::utils::parser::env::get_install_env;
|
||||
|
||||
pub fn disable(repo: &String, pkgname: &String) {
|
||||
let source = &crate::commands::get_aeropkg_base().join(repo).join(pkgname);
|
||||
@ -23,7 +24,10 @@ pub fn disable(repo: &String, pkgname: &String) {
|
||||
if src.exists() { removelink(src, dest).map_err(|e| format!("Failed to remove link {} to {}: {}", src.display(), dest.display(), e)).unwrap() }
|
||||
}
|
||||
|
||||
mount_overlay();
|
||||
let builded_pkg_md_path = &crate::commands::get_aeropkg_base().join(repo).join(pkgname).join("build-script.md");
|
||||
let full_env = get_install_env(repo, pkgname, builded_pkg_md_path, "link");
|
||||
let mount_usr_dir_flag = full_env.get("mount_usr_dir").is_some();
|
||||
if mount_usr_dir_flag { mount_overlay() }
|
||||
shell_update();
|
||||
|
||||
fs::File::create(source.join("disabled")).ok();
|
||||
|
||||
@ -29,10 +29,7 @@ pub fn link(repo: &String, pkgname: &String) {
|
||||
|
||||
let builded_pkg_md_path = &crate::commands::get_aeropkg_base().join(repo).join(pkgname).join("build-script.md");
|
||||
let full_env = get_install_env(repo, pkgname, builded_pkg_md_path, "link");
|
||||
|
||||
let mount_usr_dir_flag = full_env.get("mount_usr_dir").is_some();
|
||||
if mount_usr_dir_flag {
|
||||
mount_overlay();
|
||||
}
|
||||
if mount_usr_dir_flag { mount_overlay() }
|
||||
shell_update()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user