Removed ETAGS
This commit is contained in:
parent
0e61d31f43
commit
f68a48e8c9
2 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue