diff --git a/Makefile b/Makefile index 5e39c066fe..d7d7dfd78f 100644 --- a/Makefile +++ b/Makefile @@ -28,40 +28,37 @@ else docs_run := endif -.PHONY: help all shell docs-serve test unit functional clean image docs gpg +.PHONY: help all shell serve-docs test unit functional clean image docs gpg .DEFAULT_GOAL := all all: image ## builds the project's Rust components - $(run) cargo build --manifest-path components/core/Cargo.toml - $(run) cargo build --manifest-path components/bldr/Cargo.toml - $(run) cargo build --manifest-path components/depot-core/Cargo.toml + $(run) cargo build --manifest-path components/sup/Cargo.toml $(run) cargo build --manifest-path components/depot/Cargo.toml - $(run) cargo build --manifest-path components/depot-client/Cargo.toml test: image ## tests the project's Rust components $(run) cargo test --manifest-path components/core/Cargo.toml - $(run) cargo test --manifest-path components/bldr/Cargo.toml $(run) cargo test --manifest-path components/depot-core/Cargo.toml - $(run) cargo test --manifest-path components/depot/Cargo.toml $(run) cargo test --manifest-path components/depot-client/Cargo.toml + $(run) cargo test --manifest-path components/sup/Cargo.toml + $(run) cargo test --manifest-path components/depot/Cargo.toml unit: image ## executes the components' unit test suites $(run) cargo test --lib --manifest-path components/core/Cargo.toml - $(run) cargo test --lib --manifest-path components/bldr/Cargo.toml $(run) cargo test --lib --manifest-path components/depot-core/Cargo.toml - $(run) cargo test --lib --manifest-path components/depot/Cargo.toml $(run) cargo test --lib --manifest-path components/depot-client/Cargo.toml + $(run) cargo test --lib --manifest-path components/sup/Cargo.toml + $(run) cargo test --lib --manifest-path components/depot/Cargo.toml functional: image ## executes the components' functional test suites - $(run) cargo test --test functional --manifest-path components/bldr/Cargo.toml + $(run) cargo test --test functional --manifest-path components/sup/Cargo.toml $(run) cargo test --test functional --manifest-path components/depot/Cargo.toml clean: ## cleans up the project tree $(run) cargo clean --manifest-path components/core/Cargo.toml - $(run) cargo clean --manifest-path components/bldr/Cargo.toml $(run) cargo clean --manifest-path components/depot-core/Cargo.toml - $(run) cargo clean --manifest-path components/depot/Cargo.toml $(run) cargo clean --manifest-path components/depot-client/Cargo.toml + $(run) cargo clean --manifest-path components/sup/Cargo.toml + $(run) cargo clean --manifest-path components/depot/Cargo.toml help: @perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' @@ -72,7 +69,7 @@ shell: image ## launches a development shell serve-docs: docs ## serves the project documentation from an HTTP server @echo "==> View the docs at:\n\n http://`\ echo $(docs_host) | sed -e 's|^tcp://||' -e 's|:[0-9]\{1,\}$$||'`:9633/\n\n" - $(docs_run) sh -c 'set -e; cd ./components/bldr/target/doc; python -m SimpleHTTPServer 9633;' + $(docs_run) sh -c 'set -e; cd ./components/sup/target/doc; python -m SimpleHTTPServer 9633;' ifneq ($(IN_DOCKER),) distclean: ## fully cleans up project tree and any associated Docker images and containers @@ -97,11 +94,11 @@ endif docs: image ## build the docs $(run) sh -c 'set -ex; \ - cargo doc --manifest-path components/bldr/Cargo.toml; \ - rustdoc --crate-name bldr README.md -o ./components/bldr/target/doc/bldr; \ - docco -e .sh -o components/bldr/target/doc/bldr/bldr-build plans/bldr-build; \ - cp -r images ./components/bldr/target/doc/bldr; \ - echo "" > components/bldr/target/doc/index.html;' + cargo doc --manifest-path components/sup/Cargo.toml; \ + rustdoc --crate-name habitat_sup README.md -o ./components/sup/target/doc/habitat_sup; \ + docco -e .sh -o components/sup/target/doc/habitat_sup/bldr-build plans/bldr-build; \ + cp -r images ./components/sup/target/doc/habitat_sup; \ + echo "" > components/sup/target/doc/index.html;' gpg: ## installs gpg signing keys, only run this in a Studio (cd plans && make gpg) diff --git a/components/bldr/tests/fixtures/simple_service_without_config/plan.sh b/components/bldr/tests/fixtures/simple_service_without_config/plan.sh deleted file mode 100644 index 8648803167..0000000000 --- a/components/bldr/tests/fixtures/simple_service_without_config/plan.sh +++ /dev/null @@ -1,35 +0,0 @@ -pkg_name=simple_service_without_config -pkg_origin=test -pkg_version=0.0.1 -pkg_license=('Apache2') -pkg_maintainer="Adam Jacob " -pkg_source=http://example.com/releases/${pkg_name}-${pkg_version}.tar.bz2 -pkg_filename=${pkg_name}-${pkg_version}.tar.bz2 -pkg_shasum=0e21be5d7c5e6ab6adcbed257619897db59be9e1ded7ef6fd1582d0cdb5e5bb7 -pkg_gpg_key=3853DA6B -pkg_bin_dirs=(bin) -pkg_deps=(chef/gpgme chef/libassuan chef/libgpg-error) -pkg_service_run="bin/simple_service_without_config" -pkg_docker_build="auto" -pkg_docker_build_no_cache="true" - -do_begin() { - tar -cjvf $BLDR_SRC_CACHE/${pkg_name}-${pkg_version}.tar.bz2 --exclude 'plans' --exclude '.git' --exclude '.gitignore' --exclude 'target' --transform "s,^\.,simple_service_without_config-0.0.1," . - pkg_shasum=$(trim $(sha256sum /opt/bldr/cache/src/simple_service_without_config-0.0.1.tar.bz2 | cut -d " " -f 1)) -} - -do_download() { - return 0 -} - -do_build() { - return 0 -} - -do_install() { - cp -r /src/components/bldr/target/debug/bldr $pkg_prefix/bin - cp -r $BLDR_SRC_CACHE/$pkg_dirname/bin $pkg_prefix - chmod 755 $pkg_path/bin - chmod 755 $pkg_path/bin/* - return 0 -} diff --git a/components/core/Cargo.lock b/components/core/Cargo.lock index 600c40989e..f123b790a0 100644 --- a/components/core/Cargo.lock +++ b/components/core/Cargo.lock @@ -1,5 +1,5 @@ [root] -name = "bldr_core" +name = "habitat_core" version = "0.4.0" dependencies = [ "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/components/core/Cargo.toml b/components/core/Cargo.toml index 8e38c3e82b..3fbd281000 100644 --- a/components/core/Cargo.toml +++ b/components/core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bldr_core" +name = "habitat_core" version = "0.4.0" authors = ["Adam Jacob ", "Jamie Winsor ", "Fletcher Nichol ", "Joshua Timberman ", "Dave Parfitt "] diff --git a/components/core/src/error.rs b/components/core/src/error.rs index af376db20f..8ef50af39b 100644 --- a/components/core/src/error.rs +++ b/components/core/src/error.rs @@ -22,7 +22,7 @@ pub type Result = result::Result; /// Core error types #[derive(Debug)] pub enum Error { - /// Occurs when a `bldr_core::package::PackageArchive` is being read. + /// Occurs when a `habitat_core::package::PackageArchive` is being read. ArchiveError(libarchive::error::ArchiveError), /// Occurs when a file that should exist does not or could not be read. FileNotFound(String), diff --git a/components/depot-client/Cargo.lock b/components/depot-client/Cargo.lock index 4a7ffdf44c..40e0ad004c 100644 --- a/components/depot-client/Cargo.lock +++ b/components/depot-client/Cargo.lock @@ -1,9 +1,9 @@ [root] -name = "bldr_depot_client" +name = "habitat_depot_client" version = "0.4.0" dependencies = [ - "bldr_core 0.4.0", - "bldr_depot_core 0.4.0", + "habitat_core 0.4.0", + "habitat_depot_core 0.4.0", "hyper 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", @@ -22,30 +22,6 @@ name = "bitflags" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bldr_core" -version = "0.4.0" -dependencies = [ - "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "libarchive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bldr_depot_core" -version = "0.4.0" -dependencies = [ - "bldr_core 0.4.0", - "hyper 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lmdb-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cookie" version = "0.2.2" @@ -99,6 +75,30 @@ dependencies = [ "libgpg-error-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "habitat_core" +version = "0.4.0" +dependencies = [ + "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libarchive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.58 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "habitat_depot_core" +version = "0.4.0" +dependencies = [ + "habitat_core 0.4.0", + "hyper 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lmdb-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hpack" version = "0.2.0" diff --git a/components/depot-client/Cargo.toml b/components/depot-client/Cargo.toml index 55090df8b5..016e5688cb 100644 --- a/components/depot-client/Cargo.toml +++ b/components/depot-client/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bldr_depot_client" +name = "habitat_depot_client" version = "0.4.0" authors = ["Adam Jacob ", "Jamie Winsor ", "Fletcher Nichol ", "Joshua Timberman ", "Dave Parfitt "] @@ -8,8 +8,8 @@ hyper = "*" log = "*" rustc-serialize = "*" -[dependencies.bldr_core] +[dependencies.habitat_core] path = "../core" -[dependencies.bldr_depot_core] +[dependencies.habitat_depot_core] path = "../depot-core" diff --git a/components/depot-client/src/error.rs b/components/depot-client/src/error.rs index 0985dacdf8..cdb9fab6b7 100644 --- a/components/depot-client/src/error.rs +++ b/components/depot-client/src/error.rs @@ -11,11 +11,11 @@ use std::result; use hyper; -use bldr::{self, package}; +use hcore::{self, package}; #[derive(Debug)] pub enum Error { - BldrCore(bldr::Error), + HabitatCore(hcore::Error), HTTP(hyper::status::StatusCode), HyperError(hyper::error::Error), IO(io::Error), @@ -30,7 +30,7 @@ pub type Result = result::Result; impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let msg = match *self { - Error::BldrCore(ref e) => format!("{}", e), + Error::HabitatCore(ref e) => format!("{}", e), Error::HTTP(ref e) => format!("{}", e), Error::HyperError(ref err) => format!("{}", err), Error::IO(ref e) => format!("{}", e), @@ -55,7 +55,7 @@ impl fmt::Display for Error { impl error::Error for Error { fn description(&self) -> &str { match *self { - Error::BldrCore(ref err) => err.description(), + Error::HabitatCore(ref err) => err.description(), Error::HTTP(_) => "Received an HTTP error", Error::HyperError(ref err) => err.description(), Error::IO(ref err) => err.description(), @@ -67,9 +67,9 @@ impl error::Error for Error { } } -impl From for Error { - fn from(err: bldr::Error) -> Error { - Error::BldrCore(err) +impl From for Error { + fn from(err: hcore::Error) -> Error { + Error::HabitatCore(err) } } diff --git a/components/depot-client/src/lib.rs b/components/depot-client/src/lib.rs index 525fc7c16c..769aa2c0ea 100644 --- a/components/depot-client/src/lib.rs +++ b/components/depot-client/src/lib.rs @@ -4,8 +4,8 @@ // this file ("Licensee") apply to Licensee's use of the Software until such time that the Software // is made available under an open source license such as the Apache 2.0 License. -extern crate bldr_core as bldr; -extern crate bldr_depot_core as depot_core; +extern crate habitat_core as hcore; +extern crate habitat_depot_core as depot_core; #[macro_use] extern crate hyper; #[macro_use] @@ -20,7 +20,7 @@ use std::fs::{self, File}; use std::io::{Read, Write, BufWriter, Seek, SeekFrom}; use std::path::{Path, PathBuf}; -use bldr::package::{PackageArchive, PackageIdent}; +use hcore::package::{PackageArchive, PackageIdent}; use depot_core::{XFileName, data_object}; use hyper::client::{Client, Body}; use hyper::status::StatusCode; @@ -50,10 +50,7 @@ pub fn fetch_key(depot: &str, key: &str, path: &str) -> Result { /// * Package cannot be found /// * Remote Depot is not available /// * File cannot be created and written to -pub fn fetch_package(depot: &str, - package: &PackageIdent, - store: &str) - -> Result { +pub fn fetch_package(depot: &str, package: &PackageIdent, store: &str) -> Result { let url = format!("{}/pkgs/{}/download", depot, package); match download(&package.name, &url, store) { Ok(file) => { diff --git a/components/depot-core/Cargo.lock b/components/depot-core/Cargo.lock index 5bb34f2ccc..64f1578269 100644 --- a/components/depot-core/Cargo.lock +++ b/components/depot-core/Cargo.lock @@ -1,8 +1,8 @@ [root] -name = "bldr_depot_core" +name = "habitat_depot_core" version = "0.4.0" dependencies = [ - "bldr_core 0.4.0", + "habitat_core 0.4.0", "hyper 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "lmdb-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -22,19 +22,6 @@ name = "bitflags" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bldr_core" -version = "0.4.0" -dependencies = [ - "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "libarchive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cookie" version = "0.2.2" @@ -88,6 +75,19 @@ dependencies = [ "libgpg-error-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "habitat_core" +version = "0.4.0" +dependencies = [ + "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libarchive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.58 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hpack" version = "0.2.0" diff --git a/components/depot-core/Cargo.toml b/components/depot-core/Cargo.toml index eafe7d6701..b9d4b6bed1 100644 --- a/components/depot-core/Cargo.toml +++ b/components/depot-core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bldr_depot_core" +name = "habitat_depot_core" version = "0.4.0" authors = ["Adam Jacob ", "Jamie Winsor ", "Fletcher Nichol ", "Joshua Timberman ", "Dave Parfitt "] @@ -9,5 +9,5 @@ libc = "*" lmdb-sys = "*" rustc-serialize = "*" -[dependencies.bldr_core] +[dependencies.habitat_core] path = "../core" diff --git a/components/depot-core/src/data_object.rs b/components/depot-core/src/data_object.rs index ec09413a60..b6f5acbf54 100644 --- a/components/depot-core/src/data_object.rs +++ b/components/depot-core/src/data_object.rs @@ -8,7 +8,7 @@ use std::fmt; use std::result; use std::slice; -use bldr::{package, Error, Result}; +use hcore::{package, Error, Result}; use libc::c_void; use lmdb_sys; use rustc_serialize::{Encoder, Decoder, Encodable, Decodable}; diff --git a/components/depot-core/src/lib.rs b/components/depot-core/src/lib.rs index c51619e880..55f46efd23 100644 --- a/components/depot-core/src/lib.rs +++ b/components/depot-core/src/lib.rs @@ -4,7 +4,7 @@ // this file ("Licensee") apply to Licensee's use of the Software until such time that the Software // is made available under an open source license such as the Apache 2.0 License. -extern crate bldr_core as bldr; +extern crate habitat_core as hcore; #[macro_use] extern crate hyper; extern crate libc; diff --git a/components/depot/Cargo.lock b/components/depot/Cargo.lock index dce30701ba..b976c0314b 100644 --- a/components/depot/Cargo.lock +++ b/components/depot/Cargo.lock @@ -1,14 +1,14 @@ [root] -name = "bldr_depot" +name = "habitat_depot" version = "0.4.0" dependencies = [ "bincode 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bldr_core 0.4.0", - "bldr_depot_core 0.4.0", "clap 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "habitat_core 0.4.0", + "habitat_depot_core 0.4.0", "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "iron 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -63,30 +63,6 @@ name = "bitflags" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bldr_core" -version = "0.4.0" -dependencies = [ - "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "libarchive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bldr_depot_core" -version = "0.4.0" -dependencies = [ - "bldr_core 0.4.0", - "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lmdb-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bodyparser" version = "0.2.0" @@ -195,6 +171,30 @@ dependencies = [ "libgpg-error-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "habitat_core" +version = "0.4.0" +dependencies = [ + "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libarchive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "habitat_depot_core" +version = "0.4.0" +dependencies = [ + "habitat_core 0.4.0", + "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lmdb-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hpack" version = "0.2.0" diff --git a/components/depot/Cargo.toml b/components/depot/Cargo.toml index 0f76b0b8c2..b4beaa9700 100644 --- a/components/depot/Cargo.toml +++ b/components/depot/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "bldr_depot" +name = "habitat_depot" version = "0.4.0" authors = ["Adam Jacob ", "Jamie Winsor ", "Fletcher Nichol ", "Joshua Timberman ", "Dave Parfitt "] [[bin]] -name = "bldr-depot" +name = "hab-depot" doc = false [dependencies] @@ -32,10 +32,10 @@ walkdir = "*" [dependencies.clap] features = [ "suggestions", "color", "unstable" ] -[dependencies.bldr_core] +[dependencies.habitat_core] path = "../core" -[dependencies.bldr_depot_core] +[dependencies.habitat_depot_core] path = "../depot-core" [dev-dependencies] diff --git a/components/depot/src/data_store.rs b/components/depot/src/data_store.rs index e181df376c..1637ac4dd3 100644 --- a/components/depot/src/data_store.rs +++ b/components/depot/src/data_store.rs @@ -1631,7 +1631,7 @@ mod tests { use super::*; use error::Error; use depot_core::data_object::*; - use bldr::package; + use hcore::package; // JW TODO: This test is ignored while I track down a bug preventing multiple transactions // being opened from different threads. diff --git a/components/depot/src/doctor.rs b/components/depot/src/doctor.rs index 3e496fb12c..1cb04ffb71 100644 --- a/components/depot/src/doctor.rs +++ b/components/depot/src/doctor.rs @@ -9,8 +9,8 @@ use std::io; use std::path::PathBuf; use std::str::FromStr; -use bldr; -use bldr::package::{self, PackageArchive}; +use hcore; +use hcore::package::{self, PackageArchive}; use depot_core::data_object::{self, DataObject}; use time; use walkdir::WalkDir; @@ -112,7 +112,7 @@ pub enum OperationType { #[derive(Debug)] pub enum Reason { BadArchive, - BadMetadata(bldr::Error), + BadMetadata(hcore::Error), BadPermissions, IO(io::Error), FileExists, diff --git a/components/depot/src/error.rs b/components/depot/src/error.rs index 1165250fd4..b36eeeb840 100644 --- a/components/depot/src/error.rs +++ b/components/depot/src/error.rs @@ -10,7 +10,7 @@ use std::io; use std::fmt; use std::result; -use bldr::{self, package}; +use hcore::{self, package}; use hyper; use data_store; @@ -18,8 +18,8 @@ use data_store; #[derive(Debug)] pub enum Error { BadPort(String), - BldrCore(bldr::Error), DbInvalidPath, + HabitatCore(hcore::Error), HTTP(hyper::status::StatusCode), InvalidPackageIdent(String), IO(io::Error), @@ -37,8 +37,8 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let msg = match *self { Error::BadPort(ref e) => format!("{} is an invalid port. Valid range 1-65535.", e), - Error::BldrCore(ref e) => format!("{}", e), Error::DbInvalidPath => format!("Invalid filepath to internal datastore"), + Error::HabitatCore(ref e) => format!("{}", e), Error::HTTP(ref e) => format!("{}", e), Error::InvalidPackageIdent(ref e) => { format!("Invalid package identifier: {:?}. A valid identifier is in the form \ @@ -70,8 +70,8 @@ impl error::Error for Error { fn description(&self) -> &str { match *self { Error::BadPort(_) => "Received an invalid port or a number outside of the valid range.", - Error::BldrCore(ref err) => err.description(), Error::DbInvalidPath => "A bad filepath was provided for an internal datastore", + Error::HabitatCore(ref err) => err.description(), Error::HTTP(_) => "Received an HTTP error", Error::InvalidPackageIdent(_) => "Package identifiers must be in origin/name format (example: chef/redis)", Error::IO(ref err) => err.description(), @@ -85,9 +85,9 @@ impl error::Error for Error { } } -impl From for Error { - fn from(err: bldr::Error) -> Error { - Error::BldrCore(err) +impl From for Error { + fn from(err: hcore::Error) -> Error { + Error::HabitatCore(err) } } diff --git a/components/depot/src/lib.rs b/components/depot/src/lib.rs index 7578c145cc..9f0baedc6d 100644 --- a/components/depot/src/lib.rs +++ b/components/depot/src/lib.rs @@ -4,8 +4,8 @@ // this file ("Licensee") apply to Licensee's use of the Software until such time that the Software // is made available under an open source license such as the Apache 2.0 License. -extern crate bldr_core as bldr; -extern crate bldr_depot_core as depot_core; +extern crate habitat_core as hcore; +extern crate habitat_depot_core as depot_core; extern crate bincode; #[macro_use] extern crate bitflags; @@ -44,7 +44,7 @@ use crypto::sha2::Sha256; use crypto::digest::Digest; use self::data_store::{DataStore, Database}; -use bldr::package::{self, PackageArchive}; +use hcore::package::{self, PackageArchive}; pub struct Depot { pub path: String, diff --git a/components/depot/src/main.rs b/components/depot/src/main.rs index 6d46a17a22..d179017f6c 100644 --- a/components/depot/src/main.rs +++ b/components/depot/src/main.rs @@ -4,8 +4,8 @@ // this file ("Licensee") apply to Licensee's use of the Software until such time that the Software // is made available under an open source license such as the Apache 2.0 License. -extern crate bldr_depot as depot; -extern crate bldr_depot_core as depot_core; +extern crate habitat_depot as depot; +extern crate habitat_depot_core as depot_core; #[macro_use] extern crate clap; extern crate env_logger; @@ -162,7 +162,7 @@ fn repo_list(config: &Config) -> Result<()> { let mut cursor = try!(txn.cursor_ro()); match cursor.first() { Err(Error::MdbError(data_store::MdbError::NotFound)) => { - println!("No repositories. Create one with `bldr-depot repo create`."); + println!("No repositories. Create one with `hab-depot repo create`."); return Ok(()); } Err(e) => return Err(e), diff --git a/components/depot/src/server.rs b/components/depot/src/server.rs index e119a03a58..82c423418a 100644 --- a/components/depot/src/server.rs +++ b/components/depot/src/server.rs @@ -21,7 +21,7 @@ use super::Depot; use config::Config; use data_store::{self, Cursor, Database, Transaction}; use error::{Error, Result}; -use bldr::package::{self, PackageArchive}; +use hcore::package::{self, PackageArchive}; fn write_file(filename: &PathBuf, body: &mut Body) -> Result { let path = filename.parent().unwrap(); @@ -91,8 +91,8 @@ fn upload_package(depot: &Depot, req: &mut Request) -> IronResult { // This should never happen. Writing the package to disk and recording it's existence // in the metadata is a transactional operation and one cannot exist without the other. // - // JW TODO: write the depot repair tool and wire it into the `bldr-depot repair` command - panic!("Inconsistent package metadata! Exit and run `bldr-depot repair` to fix data integrity."); + // JW TODO: write the depot repair tool and wire it into the `hab-depot repair` command + panic!("Inconsistent package metadata! Exit and run `hab-depot repair` to fix data integrity."); } } @@ -182,8 +182,8 @@ fn download_package(depot: &Depot, req: &mut Request) -> IronResult { // This should never happen. Writing the package to disk and recording it's existence // in the metadata is a transactional operation and one cannot exist without the other. // - // JW TODO: write the depot repair tool and wire it into the `bldr-depot repair` command - panic!("Inconsistent package metadata! Exit and run `bldr-depot repair` to fix data integrity."); + // JW TODO: write the depot repair tool and wire it into the `hab-depot repair` command + panic!("Inconsistent package metadata! Exit and run `hab-depot repair` to fix data integrity."); } } Err(Error::MdbError(data_store::MdbError::NotFound)) => { @@ -474,7 +474,7 @@ impl From for IronError { fn from(err: Error) -> IronError { IronError { error: Box::new(err), - response: Response::with((status::InternalServerError, "Internal bldr error")), + response: Response::with((status::InternalServerError, "Internal Habitat error")), } } } diff --git a/components/depot/tests/server.rs b/components/depot/tests/server.rs index 1cb2159934..396d716839 100644 --- a/components/depot/tests/server.rs +++ b/components/depot/tests/server.rs @@ -8,7 +8,7 @@ extern crate regex; extern crate time; extern crate hyper; extern crate url; -extern crate bldr_core as core; +extern crate habitat_core as core; extern crate uuid; extern crate rustc_serialize; diff --git a/components/bldr/Cargo.lock b/components/sup/Cargo.lock similarity index 98% rename from components/bldr/Cargo.lock rename to components/sup/Cargo.lock index e664db4910..a09c580050 100644 --- a/components/bldr/Cargo.lock +++ b/components/sup/Cargo.lock @@ -1,14 +1,14 @@ [root] -name = "bldr" +name = "habitat_sup" version = "0.4.0" dependencies = [ "ansi_term 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bldr_core 0.4.0", - "bldr_depot_client 0.4.0", - "bldr_depot_core 0.4.0", "clap 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "habitat_core 0.4.0", + "habitat_depot_client 0.4.0", + "habitat_depot_core 0.4.0", "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "iron 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -63,41 +63,6 @@ name = "bitflags" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bldr_core" -version = "0.4.0" -dependencies = [ - "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "libarchive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bldr_depot_client" -version = "0.4.0" -dependencies = [ - "bldr_core 0.4.0", - "bldr_depot_core 0.4.0", - "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bldr_depot_core" -version = "0.4.0" -dependencies = [ - "bldr_core 0.4.0", - "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lmdb-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bodyparser" version = "0.2.0" @@ -204,6 +169,41 @@ dependencies = [ "libgpg-error-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "habitat_core" +version = "0.4.0" +dependencies = [ + "gpgme 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libarchive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "habitat_depot_client" +version = "0.4.0" +dependencies = [ + "habitat_core 0.4.0", + "habitat_depot_core 0.4.0", + "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "habitat_depot_core" +version = "0.4.0" +dependencies = [ + "habitat_core 0.4.0", + "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lmdb-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hpack" version = "0.2.0" diff --git a/components/bldr/Cargo.toml b/components/sup/Cargo.toml similarity index 85% rename from components/bldr/Cargo.toml rename to components/sup/Cargo.toml index 00754b5a05..bdd440d299 100644 --- a/components/bldr/Cargo.toml +++ b/components/sup/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "bldr" +name = "habitat_sup" version = "0.4.0" authors = ["Adam Jacob ", "Jamie Winsor ", "Fletcher Nichol ", "Joshua Timberman ", "Dave Parfitt "] exclude = ["plans/**/*","web/**/*"] [lib] -name = "bldr" +name = "habitat_sup" [[bin]] -name = "bldr" +name = "hab-sup" doc = false [[test]] @@ -37,13 +37,13 @@ threadpool = "*" urlencoded = "*" openssl = "*" -[dependencies.bldr_core] +[dependencies.habitat_core] path = "../core" -[dependencies.bldr_depot_core] +[dependencies.habitat_depot_core] path = "../depot-core" -[dependencies.bldr_depot_client] +[dependencies.habitat_depot_client] path = "../depot-client" [dependencies.wonder] diff --git a/components/bldr/src/census.rs b/components/sup/src/census.rs similarity index 100% rename from components/bldr/src/census.rs rename to components/sup/src/census.rs diff --git a/components/bldr/src/command/configure.rs b/components/sup/src/command/configure.rs similarity index 100% rename from components/bldr/src/command/configure.rs rename to components/sup/src/command/configure.rs diff --git a/components/bldr/src/command/inject.rs b/components/sup/src/command/inject.rs similarity index 100% rename from components/bldr/src/command/inject.rs rename to components/sup/src/command/inject.rs diff --git a/components/bldr/src/command/install.rs b/components/sup/src/command/install.rs similarity index 97% rename from components/bldr/src/command/install.rs rename to components/sup/src/command/install.rs index 0fa5ff646a..39a2bf4508 100644 --- a/components/bldr/src/command/install.rs +++ b/components/sup/src/command/install.rs @@ -29,8 +29,8 @@ use std::fs; -use core::fs::PACKAGE_CACHE; -use core::package::PackageIdent; +use hcore::fs::PACKAGE_CACHE; +use hcore::package::PackageIdent; use depot_core::data_object; use depot_client; diff --git a/components/bldr/src/command/key.rs b/components/sup/src/command/key.rs similarity index 99% rename from components/bldr/src/command/key.rs rename to components/sup/src/command/key.rs index a921b8f363..f26fbe7770 100644 --- a/components/bldr/src/command/key.rs +++ b/components/sup/src/command/key.rs @@ -9,9 +9,9 @@ use std::path::Path; use std::process::{Command, Stdio, Child}; use ansi_term::Colour::{Yellow, Red}; -use core::package::PackageIdent; -use core::fs::KEY_CACHE; -use core::gpg; +use hcore::package::PackageIdent; +use hcore::fs::KEY_CACHE; +use hcore::gpg; use depot_client; use time::strptime; use rpassword::read_password; diff --git a/components/bldr/src/command/mod.rs b/components/sup/src/command/mod.rs similarity index 100% rename from components/bldr/src/command/mod.rs rename to components/sup/src/command/mod.rs diff --git a/components/bldr/src/command/start.rs b/components/sup/src/command/start.rs similarity index 99% rename from components/bldr/src/command/start.rs rename to components/sup/src/command/start.rs index 7c60807bec..05d9d56f67 100644 --- a/components/bldr/src/command/start.rs +++ b/components/sup/src/command/start.rs @@ -51,7 +51,7 @@ use std::env; use ansi_term::Colour::Yellow; -use core::fs::PACKAGE_CACHE; +use hcore::fs::PACKAGE_CACHE; use depot_client; use error::{BldrResult, ErrorKind}; diff --git a/components/bldr/src/command/upload.rs b/components/sup/src/command/upload.rs similarity index 99% rename from components/bldr/src/command/upload.rs rename to components/sup/src/command/upload.rs index 79bf150f3e..6816a6856c 100644 --- a/components/bldr/src/command/upload.rs +++ b/components/sup/src/command/upload.rs @@ -22,7 +22,7 @@ use std::path::PathBuf; -use core::package::PackageArchive; +use hcore::package::PackageArchive; use depot_client; use hyper::status::StatusCode; diff --git a/components/bldr/src/config.rs b/components/sup/src/config.rs similarity index 99% rename from components/bldr/src/config.rs rename to components/sup/src/config.rs index c7f2bdcd55..84179e4586 100644 --- a/components/bldr/src/config.rs +++ b/components/sup/src/config.rs @@ -14,7 +14,7 @@ use std::str::FromStr; -use core::package::PackageIdent; +use hcore::package::PackageIdent; use error::{BldrError, ErrorKind}; use gossip::server::GOSSIP_DEFAULT_PORT; diff --git a/components/bldr/src/config_file.rs b/components/sup/src/config_file.rs similarity index 99% rename from components/bldr/src/config_file.rs rename to components/sup/src/config_file.rs index 2ca529eba4..f0a837d54a 100644 --- a/components/bldr/src/config_file.rs +++ b/components/sup/src/config_file.rs @@ -10,7 +10,7 @@ use std::fs::{self, File}; use std::io::prelude::*; use std::path::{Path, PathBuf}; -use core::fs::SERVICE_HOME; +use hcore::fs::SERVICE_HOME; use openssl::crypto::hash as openssl_hash; use rustc_serialize::hex::ToHex; use time::{SteadyTime, Duration}; diff --git a/components/bldr/src/discovery/etcd.rs b/components/sup/src/discovery/etcd.rs similarity index 94% rename from components/bldr/src/discovery/etcd.rs rename to components/sup/src/discovery/etcd.rs index e55cd24ceb..dafd02e4f9 100644 --- a/components/bldr/src/discovery/etcd.rs +++ b/components/sup/src/discovery/etcd.rs @@ -183,40 +183,39 @@ pub fn watch_mock_thread(key: &str, watcher_tx: Sender>, watcher_rx: Receiver) { let key = String::from(key); - let _newthread = - thread::Builder::new().name(format!("etcdmock:{}", key)).spawn(move || { - let preamble = format!("etcd:{}", key); - if let Err(_e) = watcher_tx.send(None) { - debug!("{}: aborting watch on failed send - peer went away", - preamble); - return; - } - loop { - let stop_time = util::stop_time(reconnect_interval as i64); + let _newthread = thread::Builder::new().name(format!("etcdmock:{}", key)).spawn(move || { + let preamble = format!("etcd:{}", key); + if let Err(_e) = watcher_tx.send(None) { + debug!("{}: aborting watch on failed send - peer went away", + preamble); + return; + } + loop { + let stop_time = util::stop_time(reconnect_interval as i64); - loop { - match watcher_rx.try_recv() { - Ok(_stop) => { - debug!(" {}: Watch exiting", preamble); - return; - } - Err(TryRecvError::Empty) => {} - Err(e) => { - debug!(" {}: Watch exiting - watcher disappeared - {:?}", - preamble, - e); - return; - } + loop { + match watcher_rx.try_recv() { + Ok(_stop) => { + debug!(" {}: Watch exiting", preamble); + return; } - let time = time::now_utc().to_timespec(); - if time > stop_time { - break; - } else { - thread::sleep(Duration::from_millis(100)); + Err(TryRecvError::Empty) => {} + Err(e) => { + debug!(" {}: Watch exiting - watcher disappeared - {:?}", + preamble, + e); + return; } } + let time = time::now_utc().to_timespec(); + if time > stop_time { + break; + } else { + thread::sleep(Duration::from_millis(100)); + } } - }); + } + }); } pub fn watch_thread(key: &str, diff --git a/components/bldr/src/discovery/mod.rs b/components/sup/src/discovery/mod.rs similarity index 100% rename from components/bldr/src/discovery/mod.rs rename to components/sup/src/discovery/mod.rs diff --git a/components/bldr/src/election.rs b/components/sup/src/election.rs similarity index 99% rename from components/bldr/src/election.rs rename to components/sup/src/election.rs index 80a30592c3..ba5fdc800c 100644 --- a/components/bldr/src/election.rs +++ b/components/sup/src/election.rs @@ -45,7 +45,6 @@ impl fmt::Display for ElectionStatus { }; write!(f, "{}", output) } - } /// The election struct. diff --git a/components/bldr/src/error.rs b/components/sup/src/error.rs similarity index 97% rename from components/bldr/src/error.rs rename to components/sup/src/error.rs index fbc57b4a9e..4c5d825b3b 100644 --- a/components/bldr/src/error.rs +++ b/components/sup/src/error.rs @@ -37,7 +37,7 @@ use std::ffi; use std::sync::mpsc; use std::str; -use core::{self, package}; +use hcore::{self, package}; use depot_client; use gpgme; use uuid; @@ -87,7 +87,6 @@ impl BldrError { #[derive(Debug)] pub enum ErrorKind { ActorError(actor::ActorError), - BldrCore(core::Error), CommandNotImplemented, ConfigFileRelativePath(String), DbInvalidPath, @@ -95,6 +94,7 @@ pub enum ErrorKind { FileNameError, FileNotFound(String), GPGError(gpgme::Error), + HabitatCore(hcore::Error), HealthCheck(String), HookFailed(HookType, i32, String), HTTP(hyper::status::StatusCode), @@ -138,7 +138,7 @@ impl fmt::Display for BldrError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let content = match self.err { ErrorKind::ActorError(ref err) => format!("Actor returned error: {:?}", err), - ErrorKind::BldrCore(ref err) => format!("{}", err), + ErrorKind::HabitatCore(ref err) => format!("{}", err), ErrorKind::CommandNotImplemented => format!("Command is not yet implemented!"), ErrorKind::ConfigFileRelativePath(ref s) => { format!("Path for configuration file cannot have relative components (eg: ..): {}", @@ -233,7 +233,7 @@ impl Error for BldrError { fn description(&self) -> &str { match self.err { ErrorKind::ActorError(_) => "A running actor responded with an error", - ErrorKind::BldrCore(ref err) => err.description(), + ErrorKind::HabitatCore(ref err) => err.description(), ErrorKind::CommandNotImplemented => "Command is not yet implemented!", ErrorKind::ConfigFileRelativePath(_) => "Path for configuration file cannot have relative components (eg: ..)", ErrorKind::DbInvalidPath => "A bad filepath was provided for an internal datastore", @@ -285,9 +285,9 @@ fn toml_parser_string(errs: &Vec) -> String { return errors; } -impl From for BldrError { - fn from(err: core::Error) -> BldrError { - bldr_error!(ErrorKind::BldrCore(err)) +impl From for BldrError { + fn from(err: hcore::Error) -> BldrError { + bldr_error!(ErrorKind::HabitatCore(err)) } } diff --git a/components/bldr/src/gossip/client.rs b/components/sup/src/gossip/client.rs similarity index 100% rename from components/bldr/src/gossip/client.rs rename to components/sup/src/gossip/client.rs diff --git a/components/bldr/src/gossip/detector.rs b/components/sup/src/gossip/detector.rs similarity index 100% rename from components/bldr/src/gossip/detector.rs rename to components/sup/src/gossip/detector.rs diff --git a/components/bldr/src/gossip/lamport_clock.rs b/components/sup/src/gossip/lamport_clock.rs similarity index 100% rename from components/bldr/src/gossip/lamport_clock.rs rename to components/sup/src/gossip/lamport_clock.rs diff --git a/components/bldr/src/gossip/member.rs b/components/sup/src/gossip/member.rs similarity index 100% rename from components/bldr/src/gossip/member.rs rename to components/sup/src/gossip/member.rs diff --git a/components/bldr/src/gossip/mod.rs b/components/sup/src/gossip/mod.rs similarity index 100% rename from components/bldr/src/gossip/mod.rs rename to components/sup/src/gossip/mod.rs diff --git a/components/bldr/src/gossip/rumor.rs b/components/sup/src/gossip/rumor.rs similarity index 100% rename from components/bldr/src/gossip/rumor.rs rename to components/sup/src/gossip/rumor.rs diff --git a/components/bldr/src/gossip/server.rs b/components/sup/src/gossip/server.rs similarity index 100% rename from components/bldr/src/gossip/server.rs rename to components/sup/src/gossip/server.rs diff --git a/components/bldr/src/health_check.rs b/components/sup/src/health_check.rs similarity index 100% rename from components/bldr/src/health_check.rs rename to components/sup/src/health_check.rs diff --git a/components/bldr/src/lib.rs b/components/sup/src/lib.rs similarity index 98% rename from components/bldr/src/lib.rs rename to components/sup/src/lib.rs index 0dd480951d..5cc6c5fccb 100644 --- a/components/bldr/src/lib.rs +++ b/components/sup/src/lib.rs @@ -32,9 +32,9 @@ //! * [The bldr Depot; http based package repository](depot) //! -extern crate bldr_core as core; -extern crate bldr_depot_client as depot_client; -extern crate bldr_depot_core as depot_core; +extern crate habitat_core as hcore; +extern crate habitat_depot_client as depot_client; +extern crate habitat_depot_core as depot_core; #[macro_use] extern crate hyper; #[macro_use] diff --git a/components/bldr/src/main.rs b/components/sup/src/main.rs similarity index 98% rename from components/bldr/src/main.rs rename to components/sup/src/main.rs index 4189f627c7..a9c22e3c96 100644 --- a/components/bldr/src/main.rs +++ b/components/sup/src/main.rs @@ -5,8 +5,8 @@ // is made available under an open source license such as the Apache 2.0 License. #[macro_use] -extern crate bldr; -extern crate bldr_core as core; +extern crate habitat_sup as sup; +extern crate habitat_core as hcore; extern crate rustc_serialize; #[macro_use] extern crate log; @@ -22,13 +22,13 @@ use std::ptr; use std::str::FromStr; use ansi_term::Colour::Yellow; -use core::package::PackageIdent; use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, SubCommand}; +use hcore::package::PackageIdent; -use bldr::config::{Command, Config, UpdateStrategy}; -use bldr::error::{BldrResult, BldrError, ErrorKind}; -use bldr::command::*; -use bldr::topology::Topology; +use sup::config::{Command, Config, UpdateStrategy}; +use sup::error::{BldrResult, BldrError, ErrorKind}; +use sup::command::*; +use sup::topology::Topology; /// Our output key static LOGKEY: &'static str = "MN"; @@ -128,16 +128,16 @@ fn config_from_args(args: &ArgMatches, } config.set_version_number(value_t!(sub_args, "version-number", u64).unwrap_or(0)); if args.value_of("verbose").is_some() { - bldr::output::set_verbose(true); + sup::output::set_verbose(true); } if args.value_of("no-color").is_some() { - bldr::output::set_no_color(true); + sup::output::set_no_color(true); } debug!("Config:\n{:?}", config); Ok(config) } -type Handler = fn(&Config) -> Result<(), bldr::error::BldrError>; +type Handler = fn(&Config) -> Result<(), sup::error::BldrError>; /// The primary loop for bldr. /// diff --git a/components/bldr/src/output.rs b/components/sup/src/output.rs similarity index 100% rename from components/bldr/src/output.rs rename to components/sup/src/output.rs diff --git a/components/bldr/src/package/hooks.rs b/components/sup/src/package/hooks.rs similarity index 100% rename from components/bldr/src/package/hooks.rs rename to components/sup/src/package/hooks.rs diff --git a/components/bldr/src/package/mod.rs b/components/sup/src/package/mod.rs similarity index 99% rename from components/bldr/src/package/mod.rs rename to components/sup/src/package/mod.rs index ecab4df369..f673b5020d 100644 --- a/components/bldr/src/package/mod.rs +++ b/components/sup/src/package/mod.rs @@ -24,10 +24,10 @@ use std::os::unix::fs::MetadataExt; use time; use time::Timespec; -use core::fs::{PACKAGE_CACHE, PACKAGE_HOME, SERVICE_HOME}; -use core::package::{version_sort, MetaFile, PackageIdent}; -use core::util; use depot_core::data_object; +use hcore::fs::{PACKAGE_CACHE, PACKAGE_HOME, SERVICE_HOME}; +use hcore::package::{version_sort, MetaFile, PackageIdent}; +use hcore::util; use self::hooks::HookTable; use error::{BldrResult, BldrError, ErrorKind}; diff --git a/components/bldr/src/package/updater.rs b/components/sup/src/package/updater.rs similarity index 98% rename from components/bldr/src/package/updater.rs rename to components/sup/src/package/updater.rs index e11a22a23a..98d0c50688 100644 --- a/components/bldr/src/package/updater.rs +++ b/components/sup/src/package/updater.rs @@ -7,9 +7,9 @@ use std::sync::{Arc, RwLock}; use std::str::FromStr; -use core::fs::PACKAGE_CACHE; -use core::package::PackageIdent; use depot_client; +use hcore::fs::PACKAGE_CACHE; +use hcore::package::PackageIdent; use wonder; use wonder::actor::{GenServer, InitResult, HandleResult, ActorSender, ActorResult}; diff --git a/components/bldr/src/service_config.rs b/components/sup/src/service_config.rs similarity index 100% rename from components/bldr/src/service_config.rs rename to components/sup/src/service_config.rs diff --git a/components/bldr/src/sidecar.rs b/components/sup/src/sidecar.rs similarity index 100% rename from components/bldr/src/sidecar.rs rename to components/sup/src/sidecar.rs diff --git a/components/bldr/src/state_machine.rs b/components/sup/src/state_machine.rs similarity index 100% rename from components/bldr/src/state_machine.rs rename to components/sup/src/state_machine.rs diff --git a/components/bldr/src/topology/initializer.rs b/components/sup/src/topology/initializer.rs similarity index 100% rename from components/bldr/src/topology/initializer.rs rename to components/sup/src/topology/initializer.rs diff --git a/components/bldr/src/topology/leader.rs b/components/sup/src/topology/leader.rs similarity index 100% rename from components/bldr/src/topology/leader.rs rename to components/sup/src/topology/leader.rs diff --git a/components/bldr/src/topology/mod.rs b/components/sup/src/topology/mod.rs similarity index 100% rename from components/bldr/src/topology/mod.rs rename to components/sup/src/topology/mod.rs diff --git a/components/bldr/src/topology/standalone.rs b/components/sup/src/topology/standalone.rs similarity index 99% rename from components/bldr/src/topology/standalone.rs rename to components/sup/src/topology/standalone.rs index 16e629c37f..6286e947cc 100644 --- a/components/bldr/src/topology/standalone.rs +++ b/components/sup/src/topology/standalone.rs @@ -18,7 +18,7 @@ use std::thread; use std::process::{Command, Stdio, Child}; use std::io::prelude::*; -use core::fs::SERVICE_HOME; +use hcore::fs::SERVICE_HOME; use error::{BldrResult, BldrError, ErrorKind}; use package::Package; diff --git a/components/bldr/src/user_config.rs b/components/sup/src/user_config.rs similarity index 100% rename from components/bldr/src/user_config.rs rename to components/sup/src/user_config.rs diff --git a/components/bldr/src/util/convert.rs b/components/sup/src/util/convert.rs similarity index 100% rename from components/bldr/src/util/convert.rs rename to components/sup/src/util/convert.rs diff --git a/components/bldr/src/util/mod.rs b/components/sup/src/util/mod.rs similarity index 100% rename from components/bldr/src/util/mod.rs rename to components/sup/src/util/mod.rs diff --git a/components/bldr/src/util/signals.rs b/components/sup/src/util/signals.rs similarity index 99% rename from components/bldr/src/util/signals.rs rename to components/sup/src/util/signals.rs index 259795a3ab..28a8d66bcd 100644 --- a/components/bldr/src/util/signals.rs +++ b/components/sup/src/util/signals.rs @@ -177,13 +177,14 @@ fn set_signal_handlers() { } /// send a Unix signal to a pid -pub fn send_signal_to_pid(pid: i32, sig: Signal) -> BldrResult<()> { +pub fn send_signal_to_pid(pid: i32, sig: Signal) -> BldrResult<()> { let s = sig as u32; debug!("sending signal {} to pid {}", s, pid); - unsafe { let result = kill(pid, s); + unsafe { + let result = kill(pid, s); match result { 0 => Ok(()), - _ => return Err(bldr_error!(ErrorKind::SignalFailed)) + _ => return Err(bldr_error!(ErrorKind::SignalFailed)), } } } diff --git a/components/bldr/src/util/sys.rs b/components/sup/src/util/sys.rs similarity index 100% rename from components/bldr/src/util/sys.rs rename to components/sup/src/util/sys.rs diff --git a/components/bldr/tests/bldr/gossip.rs b/components/sup/tests/bldr/gossip.rs similarity index 100% rename from components/bldr/tests/bldr/gossip.rs rename to components/sup/tests/bldr/gossip.rs diff --git a/components/bldr/tests/bldr/key.rs b/components/sup/tests/bldr/key.rs similarity index 99% rename from components/bldr/tests/bldr/key.rs rename to components/sup/tests/bldr/key.rs index d60f5fc6dc..8671d71ee6 100644 --- a/components/bldr/tests/bldr/key.rs +++ b/components/sup/tests/bldr/key.rs @@ -300,7 +300,7 @@ fn mk_tmp_filename() -> String { #[test] fn kt_find_key() { - use core::gpg; + use hcore::gpg; let cache_dir = gen_test_gpg_cache(); // let cache_dir = "/opt/bldr/cache/gpg/"; diff --git a/components/bldr/tests/bldr/mod.rs b/components/sup/tests/bldr/mod.rs similarity index 100% rename from components/bldr/tests/bldr/mod.rs rename to components/sup/tests/bldr/mod.rs diff --git a/components/bldr/tests/bldr/start.rs b/components/sup/tests/bldr/start.rs similarity index 100% rename from components/bldr/tests/bldr/start.rs rename to components/sup/tests/bldr/start.rs diff --git a/components/bldr/tests/bldr/topology/leader.rs b/components/sup/tests/bldr/topology/leader.rs similarity index 100% rename from components/bldr/tests/bldr/topology/leader.rs rename to components/sup/tests/bldr/topology/leader.rs diff --git a/components/bldr/tests/bldr/topology/mod.rs b/components/sup/tests/bldr/topology/mod.rs similarity index 100% rename from components/bldr/tests/bldr/topology/mod.rs rename to components/sup/tests/bldr/topology/mod.rs diff --git a/components/bldr/tests/bldr_build/mod.rs b/components/sup/tests/bldr_build/mod.rs similarity index 85% rename from components/bldr/tests/bldr_build/mod.rs rename to components/sup/tests/bldr_build/mod.rs index e85d50efa4..da4c32ecb9 100644 --- a/components/bldr/tests/bldr_build/mod.rs +++ b/components/sup/tests/bldr_build/mod.rs @@ -13,11 +13,10 @@ use setup; fn builds_a_service() { setup::gpg_import(); - let mut simple_service = - match util::command::bldr_build(&util::path::fixture_as_string("bldr_build")) { - Ok(cmd) => cmd, - Err(e) => panic!("{:?}", e), - }; + let mut simple_service = match util::command::bldr_build(&util::path::fixture_as_string("bldr_build")) { + Ok(cmd) => cmd, + Err(e) => panic!("{:?}", e), + }; simple_service.wait_with_output(); assert_cmd_exit_code!(simple_service, [0]); diff --git a/components/bldr/tests/fixtures/bldr_build/bin/simple_service b/components/sup/tests/fixtures/bldr_build/bin/simple_service similarity index 100% rename from components/bldr/tests/fixtures/bldr_build/bin/simple_service rename to components/sup/tests/fixtures/bldr_build/bin/simple_service diff --git a/components/bldr/tests/fixtures/bldr_build/bldr b/components/sup/tests/fixtures/bldr_build/bldr similarity index 100% rename from components/bldr/tests/fixtures/bldr_build/bldr rename to components/sup/tests/fixtures/bldr_build/bldr diff --git a/components/bldr/tests/fixtures/bldr_build/config/simple.conf b/components/sup/tests/fixtures/bldr_build/config/simple.conf similarity index 100% rename from components/bldr/tests/fixtures/bldr_build/config/simple.conf rename to components/sup/tests/fixtures/bldr_build/config/simple.conf diff --git a/components/bldr/tests/fixtures/bldr_build/default.toml b/components/sup/tests/fixtures/bldr_build/default.toml similarity index 100% rename from components/bldr/tests/fixtures/bldr_build/default.toml rename to components/sup/tests/fixtures/bldr_build/default.toml diff --git a/components/bldr/tests/fixtures/bldr_build/plan.sh b/components/sup/tests/fixtures/bldr_build/plan.sh similarity index 88% rename from components/bldr/tests/fixtures/bldr_build/plan.sh rename to components/sup/tests/fixtures/bldr_build/plan.sh index 30d433086f..20267205e1 100644 --- a/components/bldr/tests/fixtures/bldr_build/plan.sh +++ b/components/sup/tests/fixtures/bldr_build/plan.sh @@ -31,7 +31,7 @@ do_build() { do_install() { cp -r $PLAN_CONTEXT/bin $pkg_prefix - cp -r /src/components/bldr/target/debug/bldr $pkg_prefix/bin + cp -r /src/components/sup/target/debug/hab-sup $pkg_prefix/bin chmod 755 $pkg_prefix/bin chmod 755 $pkg_prefix/bin/* return 0 diff --git a/components/bldr/tests/fixtures/chef-private.gpg b/components/sup/tests/fixtures/chef-private.gpg similarity index 100% rename from components/bldr/tests/fixtures/chef-private.gpg rename to components/sup/tests/fixtures/chef-private.gpg diff --git a/components/bldr/tests/fixtures/chef-public.gpg b/components/sup/tests/fixtures/chef-public.gpg similarity index 100% rename from components/bldr/tests/fixtures/chef-public.gpg rename to components/sup/tests/fixtures/chef-public.gpg diff --git a/components/bldr/tests/fixtures/simple_service/bin/simple_service b/components/sup/tests/fixtures/simple_service/bin/simple_service similarity index 100% rename from components/bldr/tests/fixtures/simple_service/bin/simple_service rename to components/sup/tests/fixtures/simple_service/bin/simple_service diff --git a/components/bldr/tests/fixtures/simple_service/bldr b/components/sup/tests/fixtures/simple_service/bldr similarity index 100% rename from components/bldr/tests/fixtures/simple_service/bldr rename to components/sup/tests/fixtures/simple_service/bldr diff --git a/components/bldr/tests/fixtures/simple_service/config/simple.conf b/components/sup/tests/fixtures/simple_service/config/simple.conf similarity index 100% rename from components/bldr/tests/fixtures/simple_service/config/simple.conf rename to components/sup/tests/fixtures/simple_service/config/simple.conf diff --git a/components/bldr/tests/fixtures/simple_service/default.toml b/components/sup/tests/fixtures/simple_service/default.toml similarity index 100% rename from components/bldr/tests/fixtures/simple_service/default.toml rename to components/sup/tests/fixtures/simple_service/default.toml diff --git a/components/bldr/tests/fixtures/simple_service/plan.sh b/components/sup/tests/fixtures/simple_service/plan.sh similarity index 79% rename from components/bldr/tests/fixtures/simple_service/plan.sh rename to components/sup/tests/fixtures/simple_service/plan.sh index 79a74e1a66..bf289c2896 100644 --- a/components/bldr/tests/fixtures/simple_service/plan.sh +++ b/components/sup/tests/fixtures/simple_service/plan.sh @@ -2,12 +2,12 @@ pkg_name=simple_service pkg_origin=test pkg_version=0.0.1 pkg_license=('Apache2') -pkg_maintainer="Adam Jacob " +pkg_maintainer="The Habitat Maintainers " pkg_source=nosuchfile.tar.gz -pkg_gpg_key=3853DA6B pkg_bin_dirs=(bin) pkg_deps=() pkg_service_run="bin/simple_service" +pkg_gpg_key=3853DA6B do_download() { return 0 @@ -31,9 +31,7 @@ do_build() { do_install() { cp -r $PLAN_CONTEXT/bin $pkg_prefix - cp -r /src/components/bldr/target/debug/bldr $pkg_prefix/bin + cp -r /src/components/sup/target/debug/hab-sup $pkg_prefix/bin chmod 755 $pkg_prefix/bin chmod 755 $pkg_prefix/bin/* - return 0 } - diff --git a/components/bldr/tests/fixtures/simple_service_gossip/bin/simple_service b/components/sup/tests/fixtures/simple_service_gossip/bin/simple_service similarity index 100% rename from components/bldr/tests/fixtures/simple_service_gossip/bin/simple_service rename to components/sup/tests/fixtures/simple_service_gossip/bin/simple_service diff --git a/components/bldr/tests/fixtures/simple_service_gossip/bldr b/components/sup/tests/fixtures/simple_service_gossip/bldr similarity index 100% rename from components/bldr/tests/fixtures/simple_service_gossip/bldr rename to components/sup/tests/fixtures/simple_service_gossip/bldr diff --git a/components/bldr/tests/fixtures/simple_service_gossip/config/simple.conf b/components/sup/tests/fixtures/simple_service_gossip/config/simple.conf similarity index 100% rename from components/bldr/tests/fixtures/simple_service_gossip/config/simple.conf rename to components/sup/tests/fixtures/simple_service_gossip/config/simple.conf diff --git a/components/bldr/tests/fixtures/simple_service_gossip/default.toml b/components/sup/tests/fixtures/simple_service_gossip/default.toml similarity index 100% rename from components/bldr/tests/fixtures/simple_service_gossip/default.toml rename to components/sup/tests/fixtures/simple_service_gossip/default.toml diff --git a/components/bldr/tests/fixtures/simple_service_gossip/plan.sh b/components/sup/tests/fixtures/simple_service_gossip/plan.sh similarity index 79% rename from components/bldr/tests/fixtures/simple_service_gossip/plan.sh rename to components/sup/tests/fixtures/simple_service_gossip/plan.sh index 26ce17917f..da84e31ed0 100644 --- a/components/bldr/tests/fixtures/simple_service_gossip/plan.sh +++ b/components/sup/tests/fixtures/simple_service_gossip/plan.sh @@ -2,12 +2,12 @@ pkg_name=simple_service_gossip pkg_origin=test pkg_version=0.0.1 pkg_license=('Apache2') -pkg_maintainer="Adam Jacob " +pkg_maintainer="The Habitat Maintainers " pkg_source=nosuchfile.tar.gz -pkg_gpg_key=3853DA6B pkg_bin_dirs=(bin) pkg_deps=(chef/iptables) pkg_service_run="bin/simple_service" +pkg_gpg_key=3853DA6B do_download() { return 0 @@ -31,10 +31,7 @@ do_build() { do_install() { cp -r $PLAN_CONTEXT/bin $pkg_prefix - cp -r /src/components/bldr/target/debug/bldr $pkg_prefix/bin + cp -r /src/components/sup/target/debug/hab-sup $pkg_prefix/bin chmod 755 $pkg_prefix/bin chmod 755 $pkg_prefix/bin/* - return 0 } - - diff --git a/components/bldr/tests/fixtures/simple_service_without_config/bin/simple_service_without_config b/components/sup/tests/fixtures/simple_service_without_config/bin/simple_service_without_config similarity index 100% rename from components/bldr/tests/fixtures/simple_service_without_config/bin/simple_service_without_config rename to components/sup/tests/fixtures/simple_service_without_config/bin/simple_service_without_config diff --git a/components/bldr/tests/fixtures/simple_service_without_config/bldr b/components/sup/tests/fixtures/simple_service_without_config/bldr similarity index 100% rename from components/bldr/tests/fixtures/simple_service_without_config/bldr rename to components/sup/tests/fixtures/simple_service_without_config/bldr diff --git a/components/sup/tests/fixtures/simple_service_without_config/plan.sh b/components/sup/tests/fixtures/simple_service_without_config/plan.sh new file mode 100644 index 0000000000..9c2cbc085e --- /dev/null +++ b/components/sup/tests/fixtures/simple_service_without_config/plan.sh @@ -0,0 +1,31 @@ +pkg_name=simple_service_without_config +pkg_origin=test +pkg_version=0.0.1 +pkg_license=('Apache2') +pkg_maintainer="The Habitat Maintainers " +pkg_source=nosuchfile.tar.gz +pkg_deps=(chef/gpgme chef/libassuan chef/libgpg-error) +pkg_bin_dirs=(bin) +pkg_service_run="bin/simple_service_without_config" +pkg_gpg_key=3853DA6B + +do_begin() { + archive="$BLDR_SRC_CACHE/${pkg_name}-${pkg_version}.tar.bz2" + tar -cjvf $archive --exclude 'plans' --exclude '.git' --exclude '.gitignore' --exclude 'target' --transform "s,^\.,simple_service_without_config-0.0.1," . + pkg_shasum=$(trim $(sha256sum $archive | cut -d " " -f 1)) +} + +do_download() { + return 0 +} + +do_build() { + return 0 +} + +do_install() { + cp -r /src/components/sup/target/debug/hab-sup $pkg_prefix/bin + cp -r $BLDR_SRC_CACHE/$pkg_dirname/bin $pkg_prefix + chmod 755 $pkg_path/bin + chmod 755 $pkg_path/bin/* +} diff --git a/components/bldr/tests/functional.rs b/components/sup/tests/functional.rs similarity index 97% rename from components/bldr/tests/functional.rs rename to components/sup/tests/functional.rs index a9d5247cc3..670225e2bf 100644 --- a/components/bldr/tests/functional.rs +++ b/components/sup/tests/functional.rs @@ -9,8 +9,8 @@ extern crate tempdir; extern crate time; extern crate hyper; extern crate url; -extern crate bldr as bldr_lib; -extern crate bldr_core as core; +extern crate habitat_sup as sup; +extern crate habitat_core as hcore; extern crate uuid; extern crate rustc_serialize; @@ -72,15 +72,17 @@ mod setup { pub fn simple_service() { static ONCE: Once = ONCE_INIT; ONCE.call_once(|| { - let mut simple_service = match util::command::bldr_build(&util::path::fixture_as_string("simple_service")) { - Ok(cmd) => cmd, - Err(e) => panic!("{:?}", e), - }; + let mut simple_service = + match util::command::bldr_build(&util::path::fixture_as_string("simple_service")) { + Ok(cmd) => cmd, + Err(e) => panic!("{:?}", e), + }; simple_service.wait_with_output(); if !simple_service.status.unwrap().success() { panic!("Failed to build simple service"); } - let mut docker = match util::command::studio_run("dockerize", &["test/simple_service"]) { + let mut docker = match util::command::studio_run("dockerize", + &["test/simple_service"]) { Ok(cmd) => cmd, Err(e) => panic!("{:?}", e), }; diff --git a/components/bldr/tests/util/command.rs b/components/sup/tests/util/command.rs similarity index 100% rename from components/bldr/tests/util/command.rs rename to components/sup/tests/util/command.rs diff --git a/components/bldr/tests/util/discovery.rs b/components/sup/tests/util/discovery.rs similarity index 100% rename from components/bldr/tests/util/discovery.rs rename to components/sup/tests/util/discovery.rs diff --git a/components/bldr/tests/util/docker.rs b/components/sup/tests/util/docker.rs similarity index 100% rename from components/bldr/tests/util/docker.rs rename to components/sup/tests/util/docker.rs diff --git a/components/bldr/tests/util/mod.rs b/components/sup/tests/util/mod.rs similarity index 100% rename from components/bldr/tests/util/mod.rs rename to components/sup/tests/util/mod.rs diff --git a/components/bldr/tests/util/path.rs b/components/sup/tests/util/path.rs similarity index 92% rename from components/bldr/tests/util/path.rs rename to components/sup/tests/util/path.rs index c3d8fe8217..7525c13523 100644 --- a/components/bldr/tests/util/path.rs +++ b/components/sup/tests/util/path.rs @@ -37,5 +37,5 @@ pub fn bldr_plan() -> String { } pub fn bldr() -> String { - root().parent().unwrap().join("target/debug/bldr").to_string_lossy().into_owned() + root().parent().unwrap().join("target/debug/hab-sup").to_string_lossy().into_owned() } diff --git a/components/bldr/tests/util/supervisor.rs b/components/sup/tests/util/supervisor.rs similarity index 95% rename from components/bldr/tests/util/supervisor.rs rename to components/sup/tests/util/supervisor.rs index 0f3b47e152..2dd5152a35 100644 --- a/components/bldr/tests/util/supervisor.rs +++ b/components/sup/tests/util/supervisor.rs @@ -13,7 +13,7 @@ use hyper::client::Client; use std::io::Read; use regex::Regex; -use bldr_lib::gossip::server::GOSSIP_DEFAULT_PORT; +use sup::gossip::server::GOSSIP_DEFAULT_PORT; #[allow(dead_code)] #[derive(Debug)] @@ -63,7 +63,8 @@ impl Supervisor { pub fn with_peer_permanent_topology(peer: &Supervisor, topology: &str) -> Supervisor { Supervisor::from_docker(docker::run_with_peer_permanent_topology("test/simple_service_gossip", - &peer.peer_addr, topology)) + &peer.peer_addr, + topology)) } pub fn from_docker(sup: Docker) -> Supervisor { @@ -304,11 +305,13 @@ impl Supervisor { self.wait_for_it(Duration::seconds(5), || { let election = self.election(); match election.find_path(&["mine", "status"]) { - Some(status) => match status.as_string() { - Some("Finished") => true, - Some(_) => false, - None => false, - }, + Some(status) => { + match status.as_string() { + Some("Finished") => true, + Some(_) => false, + None => false, + } + } None => false, } }) @@ -318,11 +321,13 @@ impl Supervisor { self.wait_for_it(Duration::seconds(5), || { let election = self.election(); match election.find_path(&["mine", "status"]) { - Some(status) => match status.as_string() { - Some("Running") => true, - Some(_) => false, - None => false, - }, + Some(status) => { + match status.as_string() { + Some("Running") => true, + Some(_) => false, + None => false, + } + } None => false, } })