diff --git a/scripts/setup.sh b/scripts/setup.sh index 8ceceff..1f876f0 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -14,3 +14,8 @@ if [ ! -d "/usr/pack/pack.conf" ]; then printf "Creating /usr/pack/pack.conf\n" sudo touch /usr/pack/pack.conf fi + +if [ ! -d "/usr/pack/bin/" ]; then + printf "Creating /usr/pack/bin/\n" + sudo mkdir /usr/pack/bin +fi diff --git a/src/main.rs b/src/main.rs index d119633..285723e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,6 @@ use std::result::Result; use std::process::Command; use reqwest::Client; -use reqwest::header::ETAG; fn err_and_exit(msg: String, code: i32) { println!("ERROR!: {}", msg); @@ -34,9 +33,10 @@ fn main() -> Result<(), std::io::Error> { let full_path: Vec<&str> = vec[0].split("/").collect(); let pkgname = full_path[full_path.len() - 1]; - let repo = match vec[1] { + let repo = match vec[1] { // get repo url based on command line argument "arch_core" => "http://mirrors.advancedhosters.com/archlinux/core/os/x86_64/", "arch_extra" => "http://mirrors.advancedhosters.com/archlinux/extra/os/x86_64/", + "arch_community" => "http://mirrors.advancedhosters.com/archlinux/community/os/x86_64/", _ => { println!("ERROR!: Repo {} is not supported...", vec[1]); std::process::exit(0); @@ -55,9 +55,6 @@ fn main() -> Result<(), std::io::Error> { if resp.status().is_success() { println!("OK"); - if let Some(etag) = resp.headers().get(ETAG) { - std::fs::write("etag", etag.as_bytes()).expect("Failed to write ETAG..."); - } let mut file = match File::create(format!("/usr/pack/repo/{}/tarballs/{}", vec[1], pkgname)) { Ok(res) => res,