pkg download command and patches

This commit is contained in:
2026-09-10 16:59:11 +03:00
parent c6dcbc1ca5
commit 60cf4a2523
110 changed files with 1588 additions and 332 deletions

View File

@ -11,8 +11,8 @@ pub fn patch(repo: &String, pkgname: &String) {
let pkg_md_path = &crate::commands::get_aeropkg_var().join(format!("{}/{}.md", repo, pkgname));
let patch_script = &parser::get_patch_script(pkg_md_path).unwrap_or("".to_string());
if src.join("aeropkg.applied-patch").exists() {
let src_patch = &fs::read_to_string(src.join("aeropkg.applied-patch")).unwrap_or("".to_string());
if src.join(".aeropkg.applied-patch").exists() {
let src_patch = &fs::read_to_string(src.join(".aeropkg.applied-patch")).unwrap_or("".to_string());
if patch_script == src_patch { return }
else if src_patch != "" {
fs::remove_dir_all(src).unwrap();
@ -23,5 +23,5 @@ pub fn patch(repo: &String, pkgname: &String) {
let full_env = get_install_env(repo, pkgname, pkg_md_path, "patch");
run_install_script(patch_script, src, &full_env);
run_install_script_hook(repo, "patch", &full_env);
fs::write(src.join("aeropkg.applied-patch"), &patch_script).unwrap()
fs::write(src.join(".aeropkg.applied-patch"), &patch_script).unwrap()
}