Skip to content

Commit 0e41d71

Browse files
Split Source constants into a new file
This will make it slightly easier to generate automatic updates to the Source list when a new prebuilt is released, since the whole `source_constants.rs` file can be generated, rather than modifying a section of `lib.rs` in-place.
1 parent 34d6867 commit 0e41d71

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed

ovmf-prebuilt/src/lib.rs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
mod error;
2222
mod fetch;
23+
mod source_constants;
2324

2425
use fetch::update_cache;
2526
use std::path::{Path, PathBuf};
@@ -36,40 +37,6 @@ pub struct Source {
3637
pub sha256: &'static str,
3738
}
3839

39-
#[allow(missing_docs)]
40-
impl Source {
41-
pub const EDK2_STABLE202408_R1: Self = Self {
42-
tag: "edk2-stable202408-r1",
43-
sha256: "63a9217ddd51fa45d0a89fd83c483cc971765de6bb08e83cf70836b0baff0d48",
44-
};
45-
46-
pub const EDK2_STABLE202408_01_R1: Self = Self {
47-
tag: "edk2-stable202408.01-r1",
48-
sha256: "1b4c7d7603517482a3c4461ba43044c4c7e0a7930274d77eb19600b7dcd9b838",
49-
};
50-
51-
pub const EDK2_STABLE202411_R1: Self = Self {
52-
tag: "edk2-stable202411-r1",
53-
sha256: "963fc6cef6a0560cec97381ed22a7d5c76f440c8212529a034cb465466cd57cc",
54-
};
55-
56-
pub const EDK2_STABLE202502_R1: Self = Self {
57-
tag: "edk2-stable202502-r1",
58-
sha256: "6d6122e88cdc09e1ffafb6a39fbdbfba668a6ded3f2a032b2cd6c0b7ff6d69df",
59-
};
60-
61-
pub const EDK2_STABLE202502_R2: Self = Self {
62-
tag: "edk2-stable202502-r2",
63-
sha256: "dd59d3d52f0a643f07a488f80ab40f89c30f360999d98cdffb30e1eba5476641",
64-
};
65-
66-
/// Latest release tag.
67-
///
68-
/// Note that this is not necessarily the latest prebuilt available
69-
/// from the git repo.
70-
pub const LATEST: Self = Self::EDK2_STABLE202502_R2;
71-
}
72-
7340
/// UEFI architecture.
7441
#[allow(missing_docs)]
7542
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]

ovmf-prebuilt/src/source_constants.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
use crate::Source;
2+
3+
#[allow(missing_docs)]
4+
impl Source {
5+
pub const EDK2_STABLE202408_R1: Self = Self {
6+
tag: "edk2-stable202408-r1",
7+
sha256: "63a9217ddd51fa45d0a89fd83c483cc971765de6bb08e83cf70836b0baff0d48",
8+
};
9+
10+
pub const EDK2_STABLE202408_01_R1: Self = Self {
11+
tag: "edk2-stable202408.01-r1",
12+
sha256: "1b4c7d7603517482a3c4461ba43044c4c7e0a7930274d77eb19600b7dcd9b838",
13+
};
14+
15+
pub const EDK2_STABLE202411_R1: Self = Self {
16+
tag: "edk2-stable202411-r1",
17+
sha256: "963fc6cef6a0560cec97381ed22a7d5c76f440c8212529a034cb465466cd57cc",
18+
};
19+
20+
pub const EDK2_STABLE202502_R1: Self = Self {
21+
tag: "edk2-stable202502-r1",
22+
sha256: "6d6122e88cdc09e1ffafb6a39fbdbfba668a6ded3f2a032b2cd6c0b7ff6d69df",
23+
};
24+
25+
pub const EDK2_STABLE202502_R2: Self = Self {
26+
tag: "edk2-stable202502-r2",
27+
sha256: "dd59d3d52f0a643f07a488f80ab40f89c30f360999d98cdffb30e1eba5476641",
28+
};
29+
30+
/// Latest release tag.
31+
///
32+
/// Note that this is not necessarily the latest prebuilt available
33+
/// from the git repo.
34+
pub const LATEST: Self = Self::EDK2_STABLE202502_R2;
35+
}

0 commit comments

Comments
 (0)