aboutsummaryrefslogtreecommitdiff
path: root/modules/computer
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-07-07 13:40:10 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-07-10 12:24:36 -0700
commit23346a954ffb08b115cd45ea2a40f995e3441f8b (patch)
tree2193891f38af48a28076f714b42f6beb15f15405 /modules/computer
parent1a6086f6e16db1536e04050a0ac2637cc0f7d8b8 (diff)
UbuntuFlavor -> DistroFlavor: perhaps more easily used by non-ubuntu distros
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/computer')
-rw-r--r--modules/computer/os.c4
-rw-r--r--modules/computer/ubuntu_flavors.c28
2 files changed, 18 insertions, 14 deletions
diff --git a/modules/computer/os.c b/modules/computer/os.c
index dae93761..ab557fa6 100644
--- a/modules/computer/os.c
+++ b/modules/computer/os.c
@@ -21,7 +21,7 @@
#include <sys/utsname.h>
#include "hardinfo.h"
#include "computer.h"
-#include "ubuntu_flavors.h"
+#include "distro_flavors.h"
static gchar *
get_libc_version(void)
@@ -536,7 +536,7 @@ computer_get_os(void)
GSList *flavs = ubuntu_flavors_scan();
if (flavs) {
/* just use the first one */
- os->ubuntu_flavor = (UbuntuFlavor*)flavs->data;
+ os->distro_flavor = (DistroFlavor*)flavs->data;
}
g_slist_free(flavs);
}
diff --git a/modules/computer/ubuntu_flavors.c b/modules/computer/ubuntu_flavors.c
index 9bc32d74..84fa147f 100644
--- a/modules/computer/ubuntu_flavors.c
+++ b/modules/computer/ubuntu_flavors.c
@@ -18,27 +18,31 @@
*/
#include <hardinfo.h>
-#include "ubuntu_flavors.h"
+#include "distro_flavors.h"
#include "dt_util.h" /* for appf() */
#define SEQ(s,m) (g_strcmp0(s, m) == 0)
static const UbuntuFlavor ubuntu_flavors[] = {
- { "ubuntu-server", "Vanilla Server", "distros/ubuntu.png", "https://ubuntu.org/" },
- { "ubuntu-desktop", "Ubuntu GNOME", "distros/ubuntu.png", "https://ubuntu.org/" },
- { "xubuntu-desktop", "Xubuntu", "distros/xubuntu.svg", "https://xubuntu.org/" },
- { "kubuntu-desktop", "Kubuntu", "distros/kubuntu.png", "https://kubuntu.org/" },
- { "lubuntu-desktop", "Lubuntu", "distros/lubuntu.png", "https://lubuntu.me/" }, /* formerly or also lubuntu.net? */
- { "ubuntu-mate-desktop", "Ubuntu MATE", "distros/ubuntu-mate.png", "https://ubuntu-mate.org/" },
- { "ubuntu-budgie-desktop", "Ubuntu Budgie", "distros/ubuntu-budgie.png", "https://ubuntubudgie.org/" },
- { "ubuntukylin-desktop", "UbuntuKylin (做最有中国味的操作系统)", "distros/ubuntu-kylin.png", "https://www.ubuntukylin.com" },
- { "ubuntustudio-desktop", "UbuntuStudio", "distros/ubuntu-studio.png", "https://ubuntustudio.org/"},
+ { "Vanilla Server", "distros/ubuntu.png", "https://ubuntu.org", "ubuntu-server" },
+ { "Vanilla Desktop", "distros/ubuntu.png", "https://ubuntu.org", "ubuntu-desktop" },
+ { "Xubuntu", "distros/xubuntu.svg", "https://xubuntu.org", "xubuntu-desktop" },
+ { "Kubuntu", "distros/kubuntu.png", "https://kubuntu.org", "kubuntu-desktop" },
+ { "Lubuntu", "distros/lubuntu.png", "https://lubuntu.me", "lubuntu-desktop" }, /* formerly or also lubuntu.net? */
+ { "Ubuntu MATE", "distros/ubuntu-mate.png", "https://ubuntu-mate.org", "ubuntu-mate-desktop" },
+ { "Ubuntu Budgie", "distros/ubuntu-budgie.png", "https://ubuntubudgie.org", "ubuntu-budgie-desktop" },
+ { "UbuntuKylin (做最有中国味的操作系统)", "distros/ubuntu-kylin.png", "https://www.ubuntukylin.com", "ubuntukylin-desktop" },
+ { "UbuntuStudio", "distros/ubuntu-studio.png", "https://ubuntustudio.org", "ubuntustudio-desktop" },
+ /* Deprecated flavors */
+ { "Ubuntu GNOME", "distros/ubuntu-gnome.png", "https://ubuntugnome.org", "ubuntu-gnome-desktop" },
+ // Edubuntu
+ // Mythbuntu
{ NULL }
};
static const UbuntuFlavor *_find_flavor(const gchar *pkg) {
int i = 0;
- for(; ubuntu_flavors[i].name; i++) {
+ for(; ubuntu_flavors[i].base.name; i++) {
if (SEQ(ubuntu_flavors[i].package, pkg))
return &ubuntu_flavors[i];
}
@@ -54,7 +58,7 @@ GSList *ubuntu_flavors_scan(void) {
const UbuntuFlavor *f = NULL;
gchar *cmd_line = g_strdup("apt-cache policy");
int i;
- for(i = 0; ubuntu_flavors[i].name; i++) {
+ for(i = 0; ubuntu_flavors[i].base.name; i++) {
cmd_line = appf(cmd_line, "%s", ubuntu_flavors[i].package);
}
if (!i)