Skip to content

Commit

Permalink
Merge pull request #158 from serpent-os/task/rename-collections
Browse files Browse the repository at this point in the history
Rename collections -> repositories
  • Loading branch information
ikeycode authored Mar 4, 2024
2 parents 625476b + 6879ac9 commit 82e9136
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions boulder/data/profile.d/default-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
default-x86_64:
collections:
volatile:
uri: "https://dev.serpentos.com/volatile/x86_64/stone.index"
description: "Volatile moss repo"
priority: 0
repositories:
volatile:
uri: "https://dev.serpentos.com/volatile/x86_64/stone.index"
description: "Volatile moss repo"
priority: 0
local-x86_64:
collections:
volatile:
uri: "https://dev.serpentos.com/volatile/x86_64/stone.index"
description: "Volatile moss repo"
priority: 0
local:
uri: "file:///var/cache/boulder/repos/local-x86_64/stone.index"
description: "Local development moss repo"
priority: 10
repositories:
volatile:
uri: "https://dev.serpentos.com/volatile/x86_64/stone.index"
description: "Volatile moss repo"
priority: 0
local:
uri: "file:///var/cache/boulder/repos/local-x86_64/stone.index"
description: "Local development moss repo"
priority: 10
4 changes: 2 additions & 2 deletions boulder/src/cli/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub fn list(manager: profile::Manager) -> Result<(), Error> {
println!("{id}:");

for (id, repo) in profile
.collections
.repositories
.iter()
.sorted_by(|(_, a), (_, b)| a.priority.cmp(&b.priority).reverse())
{
Expand All @@ -118,7 +118,7 @@ pub fn add<'a>(
manager.save_profile(
id.clone(),
Profile {
collections: repository::Map::with(repos),
repositories: repository::Map::with(repos),
},
)?;

Expand Down
4 changes: 2 additions & 2 deletions boulder/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl From<String> for Id {
/// Profile configuration data
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Profile {
pub collections: repository::Map,
pub repositories: repository::Map,
}

/// A map of profiles
Expand Down Expand Up @@ -106,7 +106,7 @@ impl<'a> Manager<'a> {
pub fn repositories(&self, profile: &Id) -> Result<&repository::Map, Error> {
self.profiles
.get(profile)
.map(|profile| &profile.collections)
.map(|profile| &profile.repositories)
.ok_or_else(|| Error::MissingProfile(profile.clone()))
}

Expand Down

0 comments on commit 82e9136

Please sign in to comment.