mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
committed by
Aiden McClelland
parent
6eb2dfbb5e
commit
d55586755d
7
appmgr/Cargo.lock
generated
7
appmgr/Cargo.lock
generated
@@ -874,6 +874,7 @@ dependencies = [
|
|||||||
"patch-db",
|
"patch-db",
|
||||||
"pbkdf2",
|
"pbkdf2",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
|
"platforms",
|
||||||
"prettytable-rs",
|
"prettytable-rs",
|
||||||
"proptest",
|
"proptest",
|
||||||
"proptest-derive",
|
"proptest-derive",
|
||||||
@@ -2210,6 +2211,12 @@ version = "0.3.20"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb"
|
checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "platforms"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ppv-lite86"
|
name = "ppv-lite86"
|
||||||
version = "0.2.10"
|
version = "0.2.10"
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ patch-db = { version = "*", path = "../patch-db/patch-db", features = [
|
|||||||
] }
|
] }
|
||||||
pbkdf2 = "0.9.0"
|
pbkdf2 = "0.9.0"
|
||||||
pin-project = "1.0.8"
|
pin-project = "1.0.8"
|
||||||
|
platforms = "1.1.0"
|
||||||
prettytable-rs = "0.8.0"
|
prettytable-rs = "0.8.0"
|
||||||
proptest = "1.0.0"
|
proptest = "1.0.0"
|
||||||
proptest-derive = "0.3.0"
|
proptest-derive = "0.3.0"
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ use crate::s9pk::reader::S9pkReader;
|
|||||||
use crate::status::{MainStatus, Status};
|
use crate::status::{MainStatus, Status};
|
||||||
use crate::util::io::copy_and_shutdown;
|
use crate::util::io::copy_and_shutdown;
|
||||||
use crate::util::{display_none, display_serializable, AsyncFileExt, Version};
|
use crate::util::{display_none, display_serializable, AsyncFileExt, Version};
|
||||||
|
use crate::version::{Current, VersionT};
|
||||||
use crate::volume::asset_dir;
|
use crate::volume::asset_dir;
|
||||||
use crate::{Error, ResultExt};
|
use crate::{Error, ResultExt};
|
||||||
|
|
||||||
@@ -83,12 +84,20 @@ pub async fn install(
|
|||||||
let reg_url = ctx.package_registry_url().await?;
|
let reg_url = ctx.package_registry_url().await?;
|
||||||
let (man_res, s9pk) = tokio::try_join!(
|
let (man_res, s9pk) = tokio::try_join!(
|
||||||
reqwest::get(format!(
|
reqwest::get(format!(
|
||||||
"{}/package/manifest/{}?version={}",
|
"{}/package/manifest/{}?version={}&eos-version={}&arch={}",
|
||||||
reg_url, pkg_id, version
|
reg_url,
|
||||||
|
pkg_id,
|
||||||
|
version,
|
||||||
|
Current::new().semver(),
|
||||||
|
platforms::TARGET_ARCH,
|
||||||
)),
|
)),
|
||||||
reqwest::get(format!(
|
reqwest::get(format!(
|
||||||
"{}/package/{}.s9pk?version={}",
|
"{}/package/{}.s9pk?version={}&eos-version={}&arch={}",
|
||||||
reg_url, pkg_id, version
|
reg_url,
|
||||||
|
pkg_id,
|
||||||
|
version,
|
||||||
|
Current::new().semver(),
|
||||||
|
platforms::TARGET_ARCH,
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
.with_kind(crate::ErrorKind::Registry)?;
|
.with_kind(crate::ErrorKind::Registry)?;
|
||||||
@@ -386,8 +395,12 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin>(
|
|||||||
let reg_url = ctx.package_registry_url().await?;
|
let reg_url = ctx.package_registry_url().await?;
|
||||||
for (dep, info) in &manifest.dependencies.0 {
|
for (dep, info) in &manifest.dependencies.0 {
|
||||||
let manifest: Option<Manifest> = match reqwest::get(format!(
|
let manifest: Option<Manifest> = match reqwest::get(format!(
|
||||||
"{}/package/manifest/{}?version={}",
|
"{}/package/manifest/{}?version={}&eos-version={}&arch={}",
|
||||||
reg_url, dep, info.version
|
reg_url,
|
||||||
|
dep,
|
||||||
|
info.version,
|
||||||
|
Current::new().semver(),
|
||||||
|
platforms::TARGET_ARCH,
|
||||||
))
|
))
|
||||||
.await
|
.await
|
||||||
.with_kind(crate::ErrorKind::Registry)?
|
.with_kind(crate::ErrorKind::Registry)?
|
||||||
@@ -412,8 +425,12 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin>(
|
|||||||
if tokio::fs::metadata(&icon_path).await.is_err() {
|
if tokio::fs::metadata(&icon_path).await.is_err() {
|
||||||
tokio::fs::create_dir_all(&dir).await?;
|
tokio::fs::create_dir_all(&dir).await?;
|
||||||
let icon = reqwest::get(format!(
|
let icon = reqwest::get(format!(
|
||||||
"{}/package/icon/{}?version={}",
|
"{}/package/icon/{}?version={}&eos-version={}&arch={}",
|
||||||
reg_url, dep, info.version
|
reg_url,
|
||||||
|
dep,
|
||||||
|
info.version,
|
||||||
|
Current::new().semver(),
|
||||||
|
platforms::TARGET_ARCH,
|
||||||
))
|
))
|
||||||
.await
|
.await
|
||||||
.with_kind(crate::ErrorKind::Registry)?;
|
.with_kind(crate::ErrorKind::Registry)?;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ use crate::db::util::WithRevision;
|
|||||||
use crate::notifications::NotificationLevel;
|
use crate::notifications::NotificationLevel;
|
||||||
use crate::update::latest_information::LatestInformation;
|
use crate::update::latest_information::LatestInformation;
|
||||||
use crate::util::Invoke;
|
use crate::util::Invoke;
|
||||||
|
use crate::version::{Current, VersionT};
|
||||||
use crate::{Error, ErrorKind, ResultExt};
|
use crate::{Error, ErrorKind, ResultExt};
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
@@ -177,13 +178,18 @@ lazy_static! {
|
|||||||
#[instrument(skip(ctx))]
|
#[instrument(skip(ctx))]
|
||||||
async fn maybe_do_update(ctx: RpcContext) -> Result<Option<Arc<Revision>>, Error> {
|
async fn maybe_do_update(ctx: RpcContext) -> Result<Option<Arc<Revision>>, Error> {
|
||||||
let mut db = ctx.db.handle();
|
let mut db = ctx.db.handle();
|
||||||
let latest_version = reqwest::get(format!("{}/eos/latest", ctx.eos_registry_url().await?))
|
let latest_version = reqwest::get(format!(
|
||||||
.await
|
"{}/eos/latest?eos-version={}&arch={}",
|
||||||
.with_kind(ErrorKind::Network)?
|
ctx.eos_registry_url().await?,
|
||||||
.json::<LatestInformation>()
|
Current::new().semver(),
|
||||||
.await
|
platforms::TARGET_ARCH,
|
||||||
.with_kind(ErrorKind::Network)?
|
))
|
||||||
.version;
|
.await
|
||||||
|
.with_kind(ErrorKind::Network)?
|
||||||
|
.json::<LatestInformation>()
|
||||||
|
.await
|
||||||
|
.with_kind(ErrorKind::Network)?
|
||||||
|
.version;
|
||||||
let current_version = crate::db::DatabaseModel::new()
|
let current_version = crate::db::DatabaseModel::new()
|
||||||
.server_info()
|
.server_info()
|
||||||
.version()
|
.version()
|
||||||
@@ -321,7 +327,14 @@ struct EosUrl {
|
|||||||
}
|
}
|
||||||
impl std::fmt::Display for EosUrl {
|
impl std::fmt::Display for EosUrl {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
write!(f, "{}/eos/eos.img?version=={}", self.base, self.version)
|
write!(
|
||||||
|
f,
|
||||||
|
"{}/eos/eos.img?version=={}&eos-version={}&arch={}",
|
||||||
|
self.base,
|
||||||
|
self.version,
|
||||||
|
Current::new().semver(),
|
||||||
|
platforms::TARGET_ARCH,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user