Verified Commit 364867de authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add cookbook_redoxer, a wrapper to make it simpler to user redoxer

parent 9fefdef3
This diff is collapsed.
......@@ -3,6 +3,7 @@ name = "redox_cookbook"
version = "0.1.0"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
edition = "2018"
default-run = "cook"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
......@@ -10,6 +11,10 @@ edition = "2018"
name = "cook"
path = "src/bin/cook.rs"
[[bin]]
name = "cookbook_redoxer"
path = "src/bin/cookbook_redoxer.rs"
[lib]
name = "cookbook"
path = "src/lib.rs"
......@@ -18,6 +23,7 @@ path = "src/lib.rs"
blake3 = "0.3.3"
pbr = "1.0.2"
pkgar = "0.1.6"
redoxer = "0.2.18"
serde = { version = "1.0", features = ["derive"] }
sha2 = "0.8.1"
termion = "1.5.5"
......
......@@ -361,7 +361,7 @@ export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
# cargo template
COOKBOOK_CARGO="redoxer"
COOKBOOK_CARGO="target/release/cookbook_redoxer"
COOKBOOK_CARGO_FLAGS=(
--path "${COOKBOOK_SOURCE}"
--root "${COOKBOOK_STAGE}"
......@@ -410,7 +410,7 @@ fi
};
let command = {
let mut command = Command::new("redoxer");
let mut command = Command::new("target/release/cookbook_redoxer");
command.arg("env");
command.arg("bash").arg("-ex");
......@@ -447,6 +447,13 @@ fn package(recipe_dir: &Path, stage_dir: &Path, package: &PackageRecipe) -> Resu
let secret_path = "build/secret.key";
let public_path = "build/public.key";
if ! Path::new(secret_path).is_file() || ! Path::new(public_path).is_file() {
if ! Path::new("build").is_dir() {
fs::create_dir("build").map_err(|err| format!(
"failed to create 'build': {}\n{:?}",
err,
err
))?;
}
pkgar::bin::keygen(secret_path, public_path).map_err(|err| format!(
"failed to generate pkgar keys: {:?}",
err
......
use std::env;
fn main() {
let mut args: Vec<String> = env::args().collect();
// Ensure all flags go to cargo
if args.len() >= 2 {
args.insert(2, "--".to_string());
}
redoxer::main(&args);
}
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