aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/repository')
-rw-r--r--crates/shirabe/src/repository/artifact_repository.rs7
-rw-r--r--crates/shirabe/src/repository/platform_repository.rs2
-rw-r--r--crates/shirabe/src/repository/repository_interface.rs8
-rw-r--r--crates/shirabe/src/repository/vcs/forgejo_driver.rs5
-rw-r--r--crates/shirabe/src/repository/vcs/fossil_driver.rs3
-rw-r--r--crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs5
-rw-r--r--crates/shirabe/src/repository/vcs/git_driver.rs3
-rw-r--r--crates/shirabe/src/repository/vcs/github_driver.rs11
-rw-r--r--crates/shirabe/src/repository/vcs/gitlab_driver.rs9
-rw-r--r--crates/shirabe/src/repository/vcs/hg_driver.rs3
-rw-r--r--crates/shirabe/src/repository/vcs_repository.rs11
11 files changed, 38 insertions, 29 deletions
diff --git a/crates/shirabe/src/repository/artifact_repository.rs b/crates/shirabe/src/repository/artifact_repository.rs
index a9832a1..d869156 100644
--- a/crates/shirabe/src/repository/artifact_repository.rs
+++ b/crates/shirabe/src/repository/artifact_repository.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Repository/ArtifactRepository.php
+use crate::io::io_interface;
use std::path::Path;
use indexmap::IndexMap;
@@ -111,7 +112,7 @@ impl ArtifactRepository {
basename
),
true,
- IOInterface::VERBOSE,
+ io_interface::VERBOSE,
);
}
Some(package) => {
@@ -123,7 +124,7 @@ impl ArtifactRepository {
basename,
),
true,
- IOInterface::VERBOSE,
+ io_interface::VERBOSE,
);
self.inner.add_package(package);
}
@@ -168,7 +169,7 @@ impl ArtifactRepository {
self.io.write(
&format!("Failed loading package {}: {}", pathname, exception),
false,
- IOInterface::VERBOSE,
+ io_interface::VERBOSE,
);
}
}
diff --git a/crates/shirabe/src/repository/platform_repository.rs b/crates/shirabe/src/repository/platform_repository.rs
index 5c6bec7..cda3401 100644
--- a/crates/shirabe/src/repository/platform_repository.rs
+++ b/crates/shirabe/src/repository/platform_repository.rs
@@ -160,7 +160,7 @@ impl PlatformRepository {
composer.set_description("Composer package".to_string());
self.add_package(Box::new(composer))?;
- pretty_version = <dyn PluginInterface>::PLUGIN_API_VERSION.to_string();
+ pretty_version = plugin_interface::PLUGIN_API_VERSION.to_string();
version = self
.version_parser
.as_ref()
diff --git a/crates/shirabe/src/repository/repository_interface.rs b/crates/shirabe/src/repository/repository_interface.rs
index 15c85f0..777d3f6 100644
--- a/crates/shirabe/src/repository/repository_interface.rs
+++ b/crates/shirabe/src/repository/repository_interface.rs
@@ -35,11 +35,11 @@ pub struct ProviderInfo {
pub r#type: String,
}
-pub trait RepositoryInterface: Countable {
- const SEARCH_FULLTEXT: i64 = 0;
- const SEARCH_NAME: i64 = 1;
- const SEARCH_VENDOR: i64 = 2;
+pub const SEARCH_FULLTEXT: i64 = 0;
+pub const SEARCH_NAME: i64 = 1;
+pub const SEARCH_VENDOR: i64 = 2;
+pub trait RepositoryInterface: Countable {
fn has_package(&self, package: &dyn PackageInterface) -> bool;
fn find_package(
diff --git a/crates/shirabe/src/repository/vcs/forgejo_driver.rs b/crates/shirabe/src/repository/vcs/forgejo_driver.rs
index c03f217..2efbfb7 100644
--- a/crates/shirabe/src/repository/vcs/forgejo_driver.rs
+++ b/crates/shirabe/src/repository/vcs/forgejo_driver.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Repository/Vcs/ForgejoDriver.php
+use crate::io::io_interface;
use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::preg::Preg;
@@ -489,7 +490,7 @@ impl ForgejoDriver {
url
)),
true,
- IOInterface::VERBOSE,
+ io_interface::VERBOSE,
);
return false;
@@ -655,7 +656,7 @@ impl ForgejoDriver {
ssh_url
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
Err(e)
}
diff --git a/crates/shirabe/src/repository/vcs/fossil_driver.rs b/crates/shirabe/src/repository/vcs/fossil_driver.rs
index f1e6a89..cd3ae3a 100644
--- a/crates/shirabe/src/repository/vcs/fossil_driver.rs
+++ b/crates/shirabe/src/repository/vcs/fossil_driver.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Repository/Vcs/FossilDriver.php
+use crate::io::io_interface;
use chrono::{DateTime, Utc};
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::preg::Preg;
@@ -133,7 +134,7 @@ impl FossilDriver {
self.inner.process.get_error_output()
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
}
} else {
diff --git a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
index 0e16ced..fb667b7 100644
--- a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
+++ b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php
+use crate::io::io_interface;
use anyhow::Result;
use chrono::{DateTime, Utc};
use indexmap::IndexMap;
@@ -843,8 +844,8 @@ impl GitBitbucketDriver {
url
),
);
- // PHP: writeError(..., true, IOInterface::VERBOSE)
- // TODO(phase-b): IOInterface::VERBOSE verbosity argument
+ // PHP: writeError(..., true, io_interface::VERBOSE)
+ // TODO(phase-b): io_interface::VERBOSE verbosity argument
return false;
}
diff --git a/crates/shirabe/src/repository/vcs/git_driver.rs b/crates/shirabe/src/repository/vcs/git_driver.rs
index 48aa4c1..40ad179 100644
--- a/crates/shirabe/src/repository/vcs/git_driver.rs
+++ b/crates/shirabe/src/repository/vcs/git_driver.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Repository/Vcs/GitDriver.php
+use crate::io::io_interface;
use chrono::TimeZone;
use chrono::{DateTime, Utc};
use indexmap::IndexMap;
@@ -117,7 +118,7 @@ impl GitDriver {
self.inner.url
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
}
diff --git a/crates/shirabe/src/repository/vcs/github_driver.rs b/crates/shirabe/src/repository/vcs/github_driver.rs
index 233e3ea..7bf15bf 100644
--- a/crates/shirabe/src/repository/vcs/github_driver.rs
+++ b/crates/shirabe/src/repository/vcs/github_driver.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Repository/Vcs/GitHubDriver.php
+use crate::io::io_interface;
use anyhow::Result;
use chrono::{DateTime, Utc};
use indexmap::IndexMap;
@@ -628,7 +629,7 @@ impl GitHubDriver {
item_url
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
keys_to_remove.push(key_idx);
}
@@ -901,7 +902,7 @@ impl GitHubDriver {
url
)),
true,
- IOInterface::VERBOSE,
+ io_interface::VERBOSE,
);
return false;
@@ -1062,7 +1063,7 @@ impl GitHubDriver {
self.inner.url
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
return Err(e);
}
@@ -1091,7 +1092,7 @@ impl GitHubDriver {
],
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
}
@@ -1211,7 +1212,7 @@ impl GitHubDriver {
self.generate_ssh_url()
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
Err(setup_err)
}
diff --git a/crates/shirabe/src/repository/vcs/gitlab_driver.rs b/crates/shirabe/src/repository/vcs/gitlab_driver.rs
index 583f221..dea1bf6 100644
--- a/crates/shirabe/src/repository/vcs/gitlab_driver.rs
+++ b/crates/shirabe/src/repository/vcs/gitlab_driver.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Repository/Vcs/GitLabDriver.php
+use crate::io::io_interface;
use anyhow::Result;
use chrono::{DateTime, Utc};
use indexmap::IndexMap;
@@ -684,7 +685,7 @@ impl GitLabDriver {
url
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
Err(e)
}
@@ -785,7 +786,7 @@ impl GitLabDriver {
.to_string(),
),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
self.attempt_clone_fallback()
@@ -887,7 +888,7 @@ impl GitLabDriver {
self.namespace, self.repository, e.message
)),
true,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
git_lab_util.authorize_oauth_interactively(
&self.scheme,
@@ -969,7 +970,7 @@ impl GitLabDriver {
url
)),
true,
- IOInterface::VERBOSE,
+ io_interface::VERBOSE,
);
return false;
diff --git a/crates/shirabe/src/repository/vcs/hg_driver.rs b/crates/shirabe/src/repository/vcs/hg_driver.rs
index a8fc70a..3f27d7a 100644
--- a/crates/shirabe/src/repository/vcs/hg_driver.rs
+++ b/crates/shirabe/src/repository/vcs/hg_driver.rs
@@ -2,6 +2,7 @@
use crate::cache::Cache;
use crate::config::Config;
+use crate::io::io_interface;
use crate::io::io_interface::IOInterface;
use crate::repository::vcs::vcs_driver::VcsDriverBase;
use crate::util::filesystem::Filesystem;
@@ -79,7 +80,7 @@ impl HgDriver {
self.inner.io.write_error(
format!("<error>Failed to update {}, package information from this repository may be outdated ({})</error>", self.inner.url, self.inner.process.get_error_output()).into(),
true,
- crate::io::io_interface::IOInterface::NORMAL,
+ crate::io::io_interface::io_interface::NORMAL,
);
}
} else {
diff --git a/crates/shirabe/src/repository/vcs_repository.rs b/crates/shirabe/src/repository/vcs_repository.rs
index 57e44a5..961ea55 100644
--- a/crates/shirabe/src/repository/vcs_repository.rs
+++ b/crates/shirabe/src/repository/vcs_repository.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Repository/VcsRepository.php
+use crate::io::io_interface;
use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::preg::Preg;
@@ -397,7 +398,7 @@ impl VcsRepository {
PhpMixed::String(msg.clone()),
false,
None,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
}
@@ -556,7 +557,7 @@ impl VcsRepository {
PhpMixed::String(String::new()),
false,
None,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
}
@@ -592,7 +593,7 @@ impl VcsRepository {
PhpMixed::String(msg.clone()),
false,
None,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
}
@@ -738,7 +739,7 @@ impl VcsRepository {
PhpMixed::String(String::new()),
false,
None,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
}
@@ -910,7 +911,7 @@ impl VcsRepository {
PhpMixed::String(msg.clone()),
false,
None,
- IOInterface::NORMAL,
+ io_interface::NORMAL,
);
}