Обновление README.md, исходников, пакетки
This commit is contained in:
@ -1,14 +1,13 @@
|
||||
use std::fs;
|
||||
use crate::utils::fs::deletecopy::deletecopy;
|
||||
use crate::utils::fs::removelink::removelink;
|
||||
use crate::utils::shell::*;
|
||||
|
||||
pub fn disable(repo: &String, pkgname: &String) -> Result<(), String> {
|
||||
let source = crate::commands::get_aeropkg_base().join(repo).join(pkgname);
|
||||
|
||||
if source.join("disabled").exists() { return Ok(()) };
|
||||
pub fn disable(repo: &String, pkgname: &String) {
|
||||
let source = &crate::commands::get_aeropkg_base().join(repo).join(pkgname);
|
||||
if source.join("disabled").exists() { return };
|
||||
|
||||
let destination = source.parent()
|
||||
.ok_or("Failed to get parent directory for path")?
|
||||
let destination = &source.parent()
|
||||
.ok_or("Failed to get parent directory for path").unwrap()
|
||||
.to_path_buf();
|
||||
|
||||
let dirs_to_copy = vec![
|
||||
@ -20,18 +19,14 @@ pub fn disable(repo: &String, pkgname: &String) -> Result<(), String> {
|
||||
];
|
||||
|
||||
for base_system_folder_dir in dirs_to_copy {
|
||||
let src = source.join(base_system_folder_dir);
|
||||
let dest = destination.join(base_system_folder_dir);
|
||||
let src = &source.join(base_system_folder_dir);
|
||||
let dest = &destination.join(base_system_folder_dir);
|
||||
|
||||
if src.exists() {
|
||||
deletecopy(&src, &dest)
|
||||
.map_err(|e| format!("Failed to delete copy {} to {}: {}", src.display(), dest.display(), e))?;
|
||||
}
|
||||
if src.exists() { removelink(src, dest).map_err(|e| format!("Failed to remove link {} to {}: {}", src.display(), dest.display(), e)).unwrap() }
|
||||
}
|
||||
|
||||
mount_overlay(&destination)?;
|
||||
shell_update()?;
|
||||
mount_overlay();
|
||||
shell_update();
|
||||
|
||||
fs::File::create(&source.join("disabled")).ok();
|
||||
Ok(())
|
||||
fs::File::create(source.join("disabled")).ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user