Adds os recognition support for manjaro linux (#154)

This commit is contained in:
Philipp Weißmann
2019-05-16 13:38:00 +02:00
committed by Roey Darwish Dror
parent c0c155fc8b
commit 9e89bfc84b
3 changed files with 17 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ Topgrade knows that platform and can utilize its unique features, such as the op
package manager. Topgrade is tested on and knows the following platforms:
* Linux
* Arch
* Arch (Antergos, Manjaro)
* CentOS/RHEL
* Fedora
* Debian/Ubuntu
@@ -47,7 +47,7 @@ Just run `topgrade`. It will run the following steps:
* Try to self-upgrade if compiled with this feature. On Unix systems Topgrade will also respawn
itself if it was upgraded
* **Linux**: Run the system package manager:
* **Arch**: Run [yay](https://github.com/Jguer/yay) or fall back to pacman
* **Arch (based)**: Run [yay](https://github.com/Jguer/yay) or fall back to pacman
* **CentOS/RHEL**: Run `yum upgrade`
* **Fedora**: Run `dnf upgrade`
* **Debian/Ubuntu**: Run `apt update && apt dist-upgrade`

View File

@@ -36,7 +36,7 @@ impl Distribution {
match (os_release.id.as_ref(), os_release.id_like.as_ref().map(String::as_str)) {
("debian", _) | (_, Some("debian")) | (_, Some("ubuntu")) => Distribution::Debian,
(_, Some("\"suse\"")) => Distribution::Suse,
("arch", _) | (_, Some("archlinux")) | (_, Some("\"arch\"")) => Distribution::Arch,
("arch", _) | (_, Some("archlinux")) | (_, Some("\"arch\"")) | (_, Some("arch")) => Distribution::Arch,
("\"centos\"", _) | ("\"ol\"", _) => Distribution::CentOS,
("fedora", _) => Distribution::Fedora,
("void", _) => Distribution::Void,
@@ -384,4 +384,10 @@ mod tests {
fn test_antergos() {
test_template(&include_str!("os_release/antergos"), Distribution::Arch);
}
#[test]
fn test_manjaro() {
test_template(&include_str!("os_release/manjaro"), Distribution::Arch);
}
}

View File

@@ -0,0 +1,8 @@
NAME="Manjaro Linux"
ID=manjaro
ID_LIKE=arch
PRETTY_NAME="Manjaro Linux"
ANSI_COLOR="1;32"
HOME_URL="https://www.manjaro.org/"
SUPPORT_URL="https://www.manjaro.org/"
BUG_REPORT_URL="https://bugs.manjaro.org/"