fix pkg disable ignoring mount overlay flag
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
use std::fs;
|
use std::fs;
|
||||||
use crate::utils::fs::removelink::removelink;
|
use crate::utils::fs::removelink::removelink;
|
||||||
use crate::utils::shell::*;
|
use crate::utils::shell::*;
|
||||||
|
use crate::utils::parser::env::get_install_env;
|
||||||
|
|
||||||
pub fn disable(repo: &String, pkgname: &String) {
|
pub fn disable(repo: &String, pkgname: &String) {
|
||||||
let source = &crate::commands::get_aeropkg_base().join(repo).join(pkgname);
|
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() }
|
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();
|
shell_update();
|
||||||
|
|
||||||
fs::File::create(source.join("disabled")).ok();
|
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 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 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();
|
let mount_usr_dir_flag = full_env.get("mount_usr_dir").is_some();
|
||||||
if mount_usr_dir_flag {
|
if mount_usr_dir_flag { mount_overlay() }
|
||||||
mount_overlay();
|
|
||||||
}
|
|
||||||
shell_update()
|
shell_update()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user