Add cookbook pkgar support

parent 6a49914f
This diff is collapsed.
......@@ -24,6 +24,7 @@ arg_parser = "0.1.0"
redox_liner = "0.5.1"
libc = "0.2.66"
failure = "0.1.6"
pkgar = "0.1"
rand = "0.7.3"
redox_pkgutils = "0.1.5"
redoxfs = "0.4.0"
......
......@@ -103,10 +103,20 @@ fn install_packages<S: AsRef<str>>(config: &Config, dest: &str, cookbook: Option
for (packagename, _package) in &config.packages {
println!("Installing package {}", packagename);
let path = format!("{}/{}/repo/{}/{}.tar.gz",
env::current_dir().unwrap().to_string_lossy(),
cookbook.as_ref(), target, packagename);
Package::from_path(&path).unwrap().install(dest).unwrap();
let pkgar_path = format!("{}/{}/repo/{}/{}.pkgar",
env::current_dir().unwrap().to_string_lossy(),
cookbook.as_ref(), target, packagename);
if Path::new(&pkgar_path).exists() {
let public_path = format!("{}/{}/build/public.key",
env::current_dir().unwrap().to_string_lossy(),
cookbook.as_ref());
pkgar::bin::extract(&public_path, &pkgar_path, dest).unwrap();
} else {
let path = format!("{}/{}/repo/{}/{}.tar.gz",
env::current_dir().unwrap().to_string_lossy(),
cookbook.as_ref(), target, packagename);
Package::from_path(&path).unwrap().install(dest).unwrap();
}
}
} else {
for (packagename, _package) in &config.packages {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment