summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorrorka900 <rorka900@gmail.com>2026-03-30 18:32:47 +0000
committerrorka900 <rorka900@gmail.com>2026-03-30 18:32:47 +0000
commitd348081a48c0849e60bc2898c8ee215f896d1414 (patch)
tree0a42ae7dc81735f9e53cacb05a0501b120f51fde /src/config.rs
parent700f13b3d404cd03db17f0bfc99c83941a907a76 (diff)
downloadror-d348081a48c0849e60bc2898c8ee215f896d1414.tar.gz
ror-d348081a48c0849e60bc2898c8ee215f896d1414.zip
feat: add musl support and dictionary-compressed ror package format
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 698d58e..0c6fc1b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -21,6 +21,10 @@ pub struct GlobalConfig {
pub allow_external_binaries: bool,
#[serde(default = "default_parallel_downloads")]
pub parallel_downloads: usize,
+ #[serde(default = "default_arch")]
+ pub arch: String,
+ #[serde(default = "default_libc")]
+ pub libc: String,
}
impl Default for GlobalConfig {
@@ -30,6 +34,8 @@ impl Default for GlobalConfig {
strict_gpg: false,
allow_external_binaries: false,
parallel_downloads: default_parallel_downloads(),
+ arch: default_arch(),
+ libc: default_libc(),
}
}
}
@@ -37,6 +43,8 @@ impl Default for GlobalConfig {
fn default_ignore_speed() -> bool { false }
fn default_strict_gpg() -> bool { false }
fn default_parallel_downloads() -> usize { 4 }
+fn default_arch() -> String { std::env::consts::ARCH.to_string() }
+fn default_libc() -> String { "glibc".to_string() }
#[derive(Debug, Deserialize, Serialize, Default, Clone)]
pub struct Config {
@@ -69,6 +77,8 @@ impl Config {
lines.push(format!("ignore_speed = {}", self.global.ignore_speed));
lines.push(format!("strict_gpg = {}", self.global.strict_gpg));
lines.push(format!("parallel_downloads = {}", self.global.parallel_downloads));
+ lines.push(format!("arch = {}", self.global.arch));
+ lines.push(format!("libc = {}", self.global.libc));
lines.push(String::new());
for (name, repo) in &self.repositories {
lines.push(format!("[repositories.{}]", name));
@@ -94,6 +104,8 @@ impl Config {
"ignore_speed = false\n",
"strict_gpg = false\n",
"parallel_downloads = 4\n",
+ "arch = x86_64\n",
+ "libc = glibc\n",
"\n",
"[repositories.rorkos]\n",
"url = \"https://github.com/RorkOS/RorkOS_package\"\n",