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

@ -31,8 +31,8 @@ pub fn build(repo: &String, pkgname: &String) {
if build_script == builded_script { return }
}
if src.join("aeropkg.applied-build").exists() {
let src_build = fs::read_to_string(src.join("aeropkg.applied-build")).unwrap_or("".to_string());
if src.join(".aeropkg.applied-build").exists() {
let src_build = fs::read_to_string(src.join(".aeropkg.applied-build")).unwrap_or("".to_string());
if build_script == src_build {
return
} else {
@ -51,21 +51,21 @@ pub fn build(repo: &String, pkgname: &String) {
let dest_path = &dest_dir.join("build-script.md");
fs::remove_file(dest_path).ok();
if let Err(e) = fs::hard_link(pkg_md_path, dest_path) { panic!("Failed to copy build script to destination: {}", e) }
fs::write(src.join("aeropkg.build-script"), &build_script).unwrap();
fs::write(src.join(".aeropkg.applied-build"), &build_script).unwrap();
let save_source_flag = full_env.get("save_source").map_or(false, |v| v == "true");
let save_source_flag = full_env.get("save_source").is_some();
if !save_source_flag {
if let Err(e) = fs::remove_dir_all(&src) { panic!("Failed to remove source directory: {}", e) }
}
hook(repo, pkgname);
let link_flag = full_env.get("disable").map_or(true, |v| v != "true");
if !link_flag {
if !full_env.get("disable").is_some() {
let _ = fs::File::create(crate::commands::get_aeropkg_base().join(repo).join(pkgname).join("disabled"));
} else {
link(repo, pkgname)
}
link(repo, pkgname)
}