updated gnu repo
This commit is contained in:
@ -97,10 +97,7 @@ fn upload_from_repo(repo: &String, pkgname: &String, pkg_md_path: &Path) -> Resu
|
||||
fn check_build_dependency(repo: &String, pkg_md_path: &Path) -> Result<(), bool> {
|
||||
let deps = match parser::get_build_deps(&pkg_md_path) {
|
||||
Ok(deps) => deps,
|
||||
Err(e) => {
|
||||
eprintln!("Failed to parse dependencies {}: {}", &pkg_md_path.to_str().unwrap(), e);
|
||||
return Err(false);
|
||||
}
|
||||
Err(_) => { return Ok(()) }
|
||||
};
|
||||
|
||||
for dependency in deps.lines() {
|
||||
@ -120,10 +117,7 @@ fn check_build_dependency(repo: &String, pkg_md_path: &Path) -> Result<(), bool>
|
||||
fn check_run_dependency(pkg_md_path: &Path) -> Result<(), bool> {
|
||||
let deps = match parser::get_run_deps(pkg_md_path) {
|
||||
Ok(deps) => deps,
|
||||
Err(e) => {
|
||||
eprintln!("Failed to parse dependencies {}: {}", pkg_md_path.display(), e);
|
||||
return Err(false);
|
||||
}
|
||||
Err(_) => { return Ok(()) }
|
||||
};
|
||||
|
||||
let repo_list = match parser::get_repo_list() {
|
||||
|
||||
@ -8,11 +8,5 @@ use std::path::PathBuf;
|
||||
|
||||
|
||||
pub fn get_var_path() -> PathBuf {
|
||||
let exe_path = std::env::current_exe().expect("Failed to get executable path");
|
||||
exe_path
|
||||
.parent()
|
||||
.unwrap()
|
||||
.join("../var")
|
||||
.canonicalize()
|
||||
.expect("Failed to canonicalize var path")
|
||||
PathBuf::from(env!("SEXPKG_HOME")).join("var")
|
||||
}
|
||||
|
||||
@ -57,8 +57,7 @@ pub fn get_config_script<P: AsRef<Path>>(file_path: P) -> io::Result<String> {
|
||||
|
||||
|
||||
pub fn get_repo_list() -> io::Result<Vec<String>> {
|
||||
let base_path = env!("SEXPKG_HOME");
|
||||
let file_path = PathBuf::from(base_path).join("var").join("sexpkg.md");
|
||||
let file_path = crate::commands::get_var_path().join("sexpkg.md");
|
||||
|
||||
let block = extract_block(file_path, "``` cfg *** Repository list and priority ***", "```")?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user