diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-12-03 09:36:48 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-12-03 09:36:50 +0100 |
commit | c09c16aa3d1aa7e84b11ff9e8f18c2ce71550dc4 (patch) | |
tree | 3251305d58b6978fb2267eeb8b0284d985c172ce /src/commands | |
parent | 28725470845a23e89fbbd84714da29cae85123e9 (diff) |
Remove variable interpolation in config file
This was unused anyways, and I am not even sure what we implemented it
for.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/build.rs | 11 | ||||
-rw-r--r-- | src/commands/db.rs | 4 | ||||
-rw-r--r-- | src/commands/dependencies_of.rs | 2 | ||||
-rw-r--r-- | src/commands/find_pkg.rs | 2 | ||||
-rw-r--r-- | src/commands/source.rs | 10 | ||||
-rw-r--r-- | src/commands/what_depends.rs | 2 |
6 files changed, 14 insertions, 17 deletions
diff --git a/src/commands/build.rs b/src/commands/build.rs index 530fd3e..32f3a42 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -27,10 +27,10 @@ use crate::source::SourceCache; use crate::util::docker::ImageName; use crate::util::progress::ProgressBars; -pub async fn build<'a>(matches: &ArgMatches, +pub async fn build(matches: &ArgMatches, progressbars: ProgressBars, database_connection: PgConnection, - config: &Configuration<'a>, + config: &Configuration, repo: Repository, repo_path: &Path, max_packages: u64) @@ -116,8 +116,7 @@ pub async fn build<'a>(matches: &ArgMatches, let bar_release_loading = progressbars.release_loading(); bar_release_loading.set_length(max_packages); - let variables = BTreeMap::new(); - let p = config.releases_directory(&variables)?; + let p = config.releases_directory(); debug!("Loading release directory: {}", p.display()); let r = ReleaseStore::load(&p, bar_release_loading.clone()); if r.is_ok() { @@ -132,13 +131,11 @@ pub async fn build<'a>(matches: &ArgMatches, let bar_staging_loading = progressbars.staging_loading(); bar_staging_loading.set_length(max_packages); - let variables = BTreeMap::new(); let p = if let Some(staging_dir) = matches.value_of("staging_dir").map(PathBuf::from) { info!("Setting staging dir to {} for this run", staging_dir.display()); staging_dir } else { - config.staging_directory(&variables)? - .join(uuid::Uuid::new_v4().hyphenated().to_string()) + config.staging_directory().join(uuid::Uuid::new_v4().hyphenated().to_string()) }; if !p.is_dir() { diff --git a/src/commands/db.rs b/src/commands/db.rs index 00530fd..30a4d42 100644 --- a/src/commands/db.rs +++ b/src/commands/db.rs @@ -25,7 +25,7 @@ use crate::db::models; use crate::log::LogItem; use crate::schema; -pub fn db<'a>(db_connection_config: DbConnectionConfig, config: &Configuration<'a>, matches: &ArgMatches) -> Result<()> { +pub fn db(db_connection_config: DbConnectionConfig, config: &Configuration, matches: &ArgMatches) -> Result<()> { match matches.subcommand() { Some(("cli", matches)) => cli(db_connection_config, matches), Some(("artifacts", matches)) => artifacts(db_connection_config, matches), @@ -271,7 +271,7 @@ fn jobs(conn_cfg: DbConnectionConfig, matches: &ArgMatches) -> Result<()> { Ok(()) } -fn job<'a>(conn_cfg: DbConnectionConfig, config: &Configuration<'a>, matches: &ArgMatches) -> Result<()> { +fn job(conn_cfg: DbConnectionConfig, config: &Configuration, matches: &ArgMatches) -> Result<()> { let highlighting_disabled = matches.is_present("script_disable_highlighting"); let configured_theme = config.script_highlight_theme(); diff --git a/src/commands/dependencies_of.rs b/src/commands/dependencies_of.rs index 355b41f..db0e3f9 100644 --- a/src/commands/dependencies_of.rs +++ b/src/commands/dependencies_of.rs @@ -6,7 +6,7 @@ use crate::config::*; use crate::package::PackageName; use crate::repository::Repository; -pub async fn dependencies_of<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: Repository) -> Result<()> { +pub async fn dependencies_of(matches: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> { use filters::filter::Filter; let package_filter = { diff --git a/src/commands/find_pkg.rs b/src/commands/find_pkg.rs index be35d43..c1f4a91 100644 --- a/src/commands/find_pkg.rs +++ b/src/commands/find_pkg.rs @@ -6,7 +6,7 @@ use crate::config::Configuration; use crate::package::Package; use crate::repository::Repository; -pub async fn find_pkg<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: Repository) -> Result<()> { +pub async fn find_pkg(matches: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> { use filters::filter::Filter; use std::io::Write; diff --git a/src/commands/source.rs b/src/commands/source.rs index 235b709..ef5b5c8 100644 --- a/src/commands/source.rs +++ b/src/commands/source.rs @@ -16,7 +16,7 @@ use crate::repository::Repository; use crate::source::*; use crate::util::progress::ProgressBars; -pub async fn source<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: Repository, progressbars: ProgressBars) -> Result<()> { +pub async fn source(matches: &ArgMatches, config: &Configuration, repo: Repository, progressbars: ProgressBars) -> Result<()> { match matches.subcommand() { Some(("verify", matches)) => verify(matches, config, repo).await, Some(("list-missing", matches)) => list_missing(matches, config, repo).await, @@ -27,7 +27,7 @@ pub async fn source<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: } } -pub async fn verify<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: Repository) -> Result<()> { +pub async fn verify(matches: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> { let source_cache_root = PathBuf::from(config.source_cache_root()); let sc = SourceCache::new(source_cache_root); let pname = matches.value_of("package_name").map(String::from).map(PackageName::from); @@ -72,7 +72,7 @@ pub (in crate::commands) async fn verify_impl<'a, I>(packages: I, sc: &SourceCac } } -pub async fn list_missing<'a>(_: &ArgMatches, config: &Configuration<'a>, repo: Repository) -> Result<()> { +pub async fn list_missing(_: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> { let sc = SourceCache::new(PathBuf::from(config.source_cache_root())); let out = std::io::stdout(); let mut outlock = out.lock(); @@ -90,7 +90,7 @@ pub async fn list_missing<'a>(_: &ArgMatches, config: &Configuration<'a>, repo: .collect() } -pub async fn url<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: Repository) -> Result<()> { +pub async fn url(matches: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> { let out = std::io::stdout(); let mut outlock = out.lock(); @@ -109,7 +109,7 @@ pub async fn url<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: Rep .collect() } -pub async fn download<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: Repository, progressbars: ProgressBars) -> Result<()> { +pub async fn download(matches: &ArgMatches, config: &Configuration, repo: Repository, progressbars: ProgressBars) -> Result<()> { let force = matches.is_present("force"); let cache = PathBuf::from(config.source_cache_root()); let sc = SourceCache::new(cache); diff --git a/src/commands/what_depends.rs b/src/commands/what_depends.rs index fc2c125..0204251 100644 --- a/src/commands/what_depends.rs +++ b/src/commands/what_depends.rs @@ -8,7 +8,7 @@ use crate::config::*; use crate::package::PackageName; use crate::repository::Repository; -pub async fn what_depends<'a>(matches: &ArgMatches, config: &Configuration<'a>, repo: Repository) -> Result<()> { +pub async fn what_depends(matches: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> { use filters::failable::filter::FailableFilter; let print_runtime_deps = getbool(matches, "dependency_type", crate::cli::IDENT_DEPENDENCY_TYPE_RUNTIME); |