Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/agama-lib/share/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"validate": "ajv compile --spec=draft2019 --verbose --all-errors -r storage.schema.json -r iscsi.schema.json -s profile.schema.json && ajv compile --spec=draft2019 --verbose --all-errors -s storage.model.schema.json"
"validate": "ajv compile --spec=draft2019 --verbose --all-errors -r storage.schema.json -r iscsi.schema.json -r software.schema.json -s profile.schema.json && ajv compile --spec=draft2019 --verbose --all-errors -s storage.model.schema.json"
},
"dependencies": {
"ajv-cli": "^5.0.0"
Expand Down
94 changes: 1 addition & 93 deletions rust/agama-lib/share/profile.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,74 +200,7 @@
}
},
"software": {
"title": "Software settings",
"type": "object",
"properties": {
"patterns": {
"anyOf": [
{ "$ref": "#/$defs/patternsArray" },
{ "$ref": "#/$defs/patternsObject" }
]
},
"packages": {
"title": "List of packages to install",
"type": "array",
"items": {
"type": "string",
"examples": ["vim"]
}
},
"onlyRequired": {
"title": "Flag if only minimal hard dependencies should be used in solver",
"type": "boolean"
},
"extraRepositories": {
"title": "List of user specified repositories that will be used on top of default ones",
"type": "array",
"items": {
"type": "object",
"required": ["alias", "url"],
"properties": {
"alias": {
"title": "alias used for repository. Acting as identifier",
"type": "string"
},
"url": {
"title": "URL pointing to repository",
"type": "string"
},
"priority": {
"title": "Repository priority",
"type": "integer"
},
"name": {
"title": "User visible name. Defaults to alias",
"type": "string"
},
"productDir": {
"title": "product directory on multi repo DVD. Usually not needed",
"type": "string"
},
"enabled": {
"title": "If repository should be enabled. Defaults to true. Useful when adding additional repo that should not be immediately use.",
"type": "boolean"
},
"allowUnsigned": {
"title": "If unsigned repositories are allowed. Mainly useful for repositories that is hand crafted without GPG signature.",
"type": "boolean"
},
"gpgFingerprints": {
"title": "List of GPG fingerprints that is accepted for this repository. Useful for own repositories with proper GPG signature.",
"type": "array",
"items": {
"type": "string",
"pattern": "^[0-9a-fA-F ]+"
}
}
}
}
}
}
"$ref": "software.schema.json"
},
"questions": {
"title": "How to handle Agama questions",
Expand Down Expand Up @@ -1081,31 +1014,6 @@
"type": "string"
}
}
},
"patternsArray": {
"title": "List of user-selected patterns to install",
"type": "array",
"items": {
"type": "string",
"examples": ["minimal_base"]
}
},
"patternsObject": {
"title": "Modifications for the list of user-selected patterns to install",
"type": "object",
"additionalProperties": false,
"properties": {
"add": {
"title": "List of user-selected patterns to add to the list",
"type": "array",
"items": { "type": "string" }
},
"remove": {
"title": "List of user-selected patterns to remove from the list",
"type": "array",
"items": { "type": "string" }
}
}
}
}
}
117 changes: 117 additions & 0 deletions rust/agama-lib/share/software.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"$comment": "Software configuration",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://github.com/agama-project/agama/blob/master/rust/agama-lib/share/software.schema.json",
"title": "Config",
"description": "Software configuration.",
"type": "object",
"properties": {
"patterns": {
"anyOf": [
{
"$ref": "#/$defs/patternsArray"
},
{
"$ref": "#/$defs/patternsObject"
}
]
},
"packages": {
"description": "List of packages to install",
"type": "array",
"items": {
"type": "string",
"examples": [
"vim"
]
}
},
"onlyRequired": {
"description": "Flag if only minimal hard dependencies should be used in solver",
"type": "boolean"
},
"extraRepositories": {
"description": "List of user specified repositories that will be used on top of default ones",
"type": "array",
"items": {
"$ref": "#/$defs/repository"
}
}
},
"$defs": {
"patternsArray": {
"description": "List of user-selected patterns to install",
"type": "array",
"items": {
"type": "string",
"examples": [
"minimal_base"
]
}
},
"patternsObject": {
"description": "Modifications for the list of user-selected patterns to install",
"type": "object",
"additionalProperties": false,
"properties": {
"add": {
"description": "List of user-selected patterns to add to the list",
"type": "array",
"items": {
"type": "string"
}
},
"remove": {
"description": "List of user-selected patterns to remove from the list",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"repository": {
"description": "Packages repository",
"type": "object",
"additionalProperties": false,
"properties": {
"alias": {
"description": "alias used for repository. Acting as identifier",
"type": "string"
},
"url": {
"description": "URL pointing to repository",
"type": "string"
},
"priority": {
"description": "Repository priority",
"type": "integer"
},
"name": {
"description": "User visible name. Defaults to alias",
"type": "string"
},
"productDir": {
"description": "product directory on multi repo DVD. Usually not needed",
"type": "string"
},
"enabled": {
"description": "If repository should be enabled. Defaults to true. Useful when adding additional repo that should not be immediately use.",
"type": "boolean"
},
"allowUnsigned": {
"description": "If unsigned repositories are allowed. Mainly useful for repositories that is hand crafted without GPG signature.",
"type": "boolean"
},
"gpgFingerprints": {
"description": "List of GPG fingerprints that is accepted for this repository. Useful for own repositories with proper GPG signature.",
"type": "array",
"items": {
"type": "string",
"pattern": "^[0-9a-fA-F ]+"
}
}
}
}
}
}
11 changes: 10 additions & 1 deletion rust/agama-software/src/model/packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ impl Resolvable {

/// Software resolvable type (package or pattern).
#[derive(
Clone, Copy, Debug, Deserialize, Serialize, strum::Display, utoipa::ToSchema, PartialEq,
Clone,
Copy,
Debug,
Deserialize,
Serialize,
strum::Display,
utoipa::ToSchema,
PartialEq,
Eq,
Hash,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: I prefer to have entries alphabetically ordered, as it is easier to read. I would apply it to all parts that do not depend on order.

)]
#[strum(serialize_all = "camelCase")]
#[serde(rename_all = "camelCase")]
Expand Down
Loading
Loading