mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
v0.3.6-alpha.0 (#2680)
* v0.3.6-alpha.0 * show welcome on fresh install
This commit is contained in:
2
core/Cargo.lock
generated
2
core/Cargo.lock
generated
@@ -4949,7 +4949,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "start-os"
|
||||
version = "0.3.5-rev.2"
|
||||
version = "0.3.6-alpha.0"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"async-compression",
|
||||
|
||||
@@ -14,7 +14,7 @@ keywords = [
|
||||
name = "start-os"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/Start9Labs/start-os"
|
||||
version = "0.3.5-rev.2"
|
||||
version = "0.3.6-alpha.0"
|
||||
license = "MIT"
|
||||
|
||||
[lib]
|
||||
|
||||
@@ -31,7 +31,7 @@ use crate::{ARCH, PLATFORM};
|
||||
pub struct Public {
|
||||
pub server_info: ServerInfo,
|
||||
pub package_data: AllPackageData,
|
||||
#[ts(type = "any")]
|
||||
#[ts(type = "unknown")]
|
||||
pub ui: Value,
|
||||
}
|
||||
impl Public {
|
||||
|
||||
@@ -147,6 +147,23 @@ pub async fn execute<C: Context>(
|
||||
|
||||
overwrite |= disk.guid.is_none() && disk.partitions.iter().all(|p| p.guid.is_none());
|
||||
|
||||
if !overwrite
|
||||
&& (disk
|
||||
.guid
|
||||
.as_ref()
|
||||
.map_or(false, |g| g.starts_with("EMBASSY_"))
|
||||
|| disk
|
||||
.partitions
|
||||
.iter()
|
||||
.flat_map(|p| p.guid.as_ref())
|
||||
.any(|g| g.starts_with("EMBASSY_")))
|
||||
{
|
||||
return Err(Error::new(
|
||||
eyre!("installing over versions before 0.3.6 is unsupported"),
|
||||
ErrorKind::InvalidRequest,
|
||||
));
|
||||
}
|
||||
|
||||
let part_info = partition(&mut disk, overwrite).await?;
|
||||
|
||||
if let Some(efi) = &part_info.efi {
|
||||
|
||||
@@ -13,18 +13,19 @@ use crate::Error;
|
||||
mod v0_3_5;
|
||||
mod v0_3_5_1;
|
||||
mod v0_3_5_2;
|
||||
mod v0_3_6;
|
||||
mod v0_3_6_alpha_0;
|
||||
|
||||
pub type Current = v0_3_6::Version;
|
||||
pub type Current = v0_3_6_alpha_0::Version;
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||
#[serde(untagged)]
|
||||
#[allow(non_camel_case_types)]
|
||||
enum Version {
|
||||
LT0_3_5(LTWrapper<v0_3_5::Version>),
|
||||
V0_3_5(Wrapper<v0_3_5::Version>),
|
||||
V0_3_5_1(Wrapper<v0_3_5_1::Version>),
|
||||
V0_3_5_2(Wrapper<v0_3_5_2::Version>),
|
||||
V0_3_6(Wrapper<v0_3_6::Version>),
|
||||
V0_3_6_alpha_0(Wrapper<v0_3_6_alpha_0::Version>),
|
||||
Other(exver::Version),
|
||||
}
|
||||
|
||||
@@ -44,7 +45,7 @@ impl Version {
|
||||
Version::V0_3_5(Wrapper(x)) => x.semver(),
|
||||
Version::V0_3_5_1(Wrapper(x)) => x.semver(),
|
||||
Version::V0_3_5_2(Wrapper(x)) => x.semver(),
|
||||
Version::V0_3_6(Wrapper(x)) => x.semver(),
|
||||
Version::V0_3_6_alpha_0(Wrapper(x)) => x.semver(),
|
||||
Version::Other(x) => x.clone(),
|
||||
}
|
||||
}
|
||||
@@ -212,6 +213,19 @@ pub async fn init(
|
||||
mut progress: PhaseProgressTrackerHandle,
|
||||
) -> Result<(), Error> {
|
||||
progress.start();
|
||||
db.mutate(|db| {
|
||||
db.as_public_mut()
|
||||
.as_server_info_mut()
|
||||
.as_version_mut()
|
||||
.map_mutate(|v| {
|
||||
Ok(if v == exver::Version::new([0, 3, 6], []) {
|
||||
v0_3_6_alpha_0::Version::new().semver()
|
||||
} else {
|
||||
v
|
||||
})
|
||||
})
|
||||
})
|
||||
.await?; // TODO: remove before releasing 0.3.6
|
||||
let version = Version::from_exver_version(
|
||||
db.peek()
|
||||
.await
|
||||
@@ -231,7 +245,7 @@ pub async fn init(
|
||||
Version::V0_3_5(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
|
||||
Version::V0_3_5_1(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
|
||||
Version::V0_3_5_2(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
|
||||
Version::V0_3_6(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
|
||||
Version::V0_3_6_alpha_0(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
|
||||
Version::Other(_) => {
|
||||
return Err(Error::new(
|
||||
eyre!("Cannot downgrade"),
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
use exver::VersionRange;
|
||||
use exver::{PreReleaseSegment, VersionRange};
|
||||
|
||||
use super::v0_3_5::V0_3_0_COMPAT;
|
||||
use super::{v0_3_5_1, VersionT};
|
||||
use super::{v0_3_5_2, VersionT};
|
||||
use crate::db::model::Database;
|
||||
use crate::prelude::*;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref V0_3_6: exver::Version = exver::Version::new([0, 3, 6], []);
|
||||
static ref V0_3_6_alpha_0: exver::Version = exver::Version::new(
|
||||
[0, 3, 6],
|
||||
[PreReleaseSegment::String("alpha".into()), 0.into()]
|
||||
);
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Version;
|
||||
|
||||
impl VersionT for Version {
|
||||
type Previous = v0_3_5_1::Version;
|
||||
type Previous = v0_3_5_2::Version;
|
||||
fn new() -> Self {
|
||||
Version
|
||||
}
|
||||
fn semver(&self) -> exver::Version {
|
||||
V0_3_6.clone()
|
||||
V0_3_6_alpha_0.clone()
|
||||
}
|
||||
fn compat(&self) -> &'static VersionRange {
|
||||
&V0_3_0_COMPAT
|
||||
Reference in New Issue
Block a user