aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/package')
-rw-r--r--crates/shirabe/src/package/comparer/comparer.rs7
-rw-r--r--crates/shirabe/src/package/version/version_selector.rs11
2 files changed, 4 insertions, 14 deletions
diff --git a/crates/shirabe/src/package/comparer/comparer.rs b/crates/shirabe/src/package/comparer/comparer.rs
index b0e01bd8..d18d82b3 100644
--- a/crates/shirabe/src/package/comparer/comparer.rs
+++ b/crates/shirabe/src/package/comparer/comparer.rs
@@ -140,12 +140,7 @@ impl Comparer {
} else if Path::new(&path).is_file() {
let size = std::fs::metadata(&path).map(|m| m.len()).unwrap_or(0);
if size > 0 {
- let algo = if shirabe_php_shim::PHP_VERSION_ID > 80100 {
- "xxh3"
- } else {
- "sha1"
- };
- let hash = shirabe_php_shim::hash_file(algo, &path);
+ let hash = shirabe_php_shim::hash_file("xxh3", &path);
array.entry(dir.to_string()).or_default().insert(file, hash);
}
}
diff --git a/crates/shirabe/src/package/version/version_selector.rs b/crates/shirabe/src/package/version/version_selector.rs
index 775aadc5..1661c749 100644
--- a/crates/shirabe/src/package/version/version_selector.rs
+++ b/crates/shirabe/src/package/version/version_selector.rs
@@ -17,10 +17,7 @@ use crate::repository::RepositoryInterface;
use crate::repository::RepositorySetInterface;
use indexmap::IndexMap;
use shirabe_pcre::Preg;
-use shirabe_php_shim::{
- CmpOp, PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, php_regex, strtolower,
- version_compare,
-};
+use shirabe_php_shim::{CmpOp, php_regex, strtolower, version_compare};
use shirabe_semver::constraint::AnyConstraint;
use shirabe_semver::constraint::SimpleConstraint;
@@ -258,10 +255,8 @@ impl VersionSelector {
package: PackageInterfaceHandle,
) -> anyhow::Result<String> {
if package.get_name().starts_with("ext-") {
- let php_version = format!(
- "{}.{}.{}",
- PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION
- );
+ let php = shirabe_php_rpc::get_php_version();
+ let php_version = format!("{}.{}.{}", php.major, php.minor, php.release);
let package_version = package.get_version();
let ext_parts: Vec<&str> = package_version.splitn(4, '.').collect();
let ext_version = ext_parts[..3.min(ext_parts.len())].join(".");