Skip to content

Commit

Permalink
introduce weak dependencies: recommends, supplements, suggests, and e…
Browse files Browse the repository at this point in the history
…nhances
  • Loading branch information
cat-in-136 committed Jul 7, 2024
1 parent 2b1467a commit 92de52e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ from [the `Cargo.toml` file](https://doc.rust-lang.org/cargo/reference/manifest.
* obsoletes: optional list of Obsoletes
* conflicts: optional list of Conflicts
* provides: optional list of Provides
* recommends: optional list of Recommends
* supplements: optional list of Supplements
* suggests: optional list of Suggests
* enhances: optional list of Enhances
* vendor: optional string of Vendor

Adding assets such as the binary file, ``.desktop`` file, or icons, shall be written in the following way.
Expand Down
20 changes: 20 additions & 0 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,26 @@ impl Config {
builder = builder.provides(dependency);
}
}
if let Some(recommends) = metadata.get_table("recommends")? {
for dependency in Self::table_to_dependencies(recommends)? {
builder = builder.recommends(dependency);
}
}
if let Some(supplements) = metadata.get_table("supplements")? {
for dependency in Self::table_to_dependencies(supplements)? {
builder = builder.supplements(dependency);
}
}
if let Some(suggests) = metadata.get_table("suggests")? {
for dependency in Self::table_to_dependencies(suggests)? {
builder = builder.suggests(dependency);
}
}
if let Some(enhances) = metadata.get_table("enhances")? {
for dependency in Self::table_to_dependencies(enhances)? {
builder = builder.enhances(dependency);
}
}

Ok(builder)
}
Expand Down

0 comments on commit 92de52e

Please sign in to comment.