Added arch setup script and reconfigured i to use it
This commit is contained in:
parent
995d39c70b
commit
c524408856
3 changed files with 24 additions and 1 deletions
13
scripts/arch.sh
Executable file
13
scripts/arch.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PREFIX="/imperfect/repo"
|
||||||
|
|
||||||
|
if [ ! -d "$PREFIX/arch" ]; then
|
||||||
|
printf "Creating $PREFIX/arch\n"
|
||||||
|
sudo mkdir "$PREFIX/arch"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$PREFIX/arch/tarballs" ]; then
|
||||||
|
printf "Creating $PREFIX/arch/tarballs\n"
|
||||||
|
sudo mkdir "$PREFIX/arch/tarballs"
|
||||||
|
fi
|
|
@ -10,6 +10,16 @@ if [ ! -d "/imperfect/repo" ]; then
|
||||||
sudo mkdir /imperfect/repo
|
sudo mkdir /imperfect/repo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "/imperfect/repo/imperfect" ]; then
|
||||||
|
printf "Creating /imperfect/repo/imperfect\n"
|
||||||
|
sudo mkdir /imperfect/repo/imperfect
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "/imperfect/repo/imperfect/tarballs" ]; then
|
||||||
|
printf "Creating /imperfect/repo/imperfect/tarballs\n"
|
||||||
|
sudo mkdir /imperfect/repo/imperfect/tarballs
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d "/imperfect/etc" ]; then
|
if [ ! -d "/imperfect/etc" ]; then
|
||||||
printf "Creating /imperfect/etc/\n"
|
printf "Creating /imperfect/etc/\n"
|
||||||
sudo mkdir /imperfect/etc
|
sudo mkdir /imperfect/etc
|
||||||
|
|
|
@ -21,7 +21,7 @@ fn main() -> Result<(), std::io::Error> {
|
||||||
std::fs::write("etag", etag.as_bytes()).expect("Failed to write ETAG...");
|
std::fs::write("etag", etag.as_bytes()).expect("Failed to write ETAG...");
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut file = File::create("/imperfect/repo/arch/tarballs/bash.pkg.tar.xz").expect("file creation failed");
|
let mut file = File::create("/imperfect/repo/arch/tarballs/bash.pkg.tar.xz").expect("file creation failed. Did you setup arch? Do you have permission?");
|
||||||
resp.copy_to(&mut file).expect("failed to write file");
|
resp.copy_to(&mut file).expect("failed to write file");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue