Skip to content

Commit

Permalink
inspect: get icon of ALT Linux guests
Browse files Browse the repository at this point in the history
The icon is part of a documentation package, although it's the best hit
so far...
  • Loading branch information
ptoscano committed May 24, 2016
1 parent 77ad2e1 commit 9928296
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/inspect-icon.c
Expand Up @@ -62,6 +62,7 @@ static char *icon_opensuse (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
static char *icon_cirros (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
#endif
static char *icon_voidlinux (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
static char *icon_altlinux (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
#if CAN_DO_WINDOWS
static char *icon_windows (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
#endif
Expand Down Expand Up @@ -163,6 +164,10 @@ guestfs_impl_inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r,
r = icon_voidlinux (g, fs, &size);
break;

case OS_DISTRO_ALTLINUX:
r = icon_altlinux (g, fs, &size);
break;

/* These are just to keep gcc warnings happy. */
case OS_DISTRO_ARCHLINUX:
case OS_DISTRO_BUILDROOT:
Expand All @@ -180,7 +185,6 @@ guestfs_impl_inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r,
case OS_DISTRO_NETBSD:
case OS_DISTRO_OPENBSD:
case OS_DISTRO_ALPINE_LINUX:
case OS_DISTRO_ALTLINUX:
case OS_DISTRO_FRUGALWARE:
case OS_DISTRO_PLD_LINUX:
case OS_DISTRO_UNKNOWN:
Expand Down Expand Up @@ -433,6 +437,14 @@ icon_voidlinux (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
return get_png (g, fs, VOIDLINUX_ICON, size_r, 20480);
}

#define ALTLINUX_ICON "/usr/share/doc/alt-docs/altlogo.png"

static char *
icon_altlinux (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
{
return get_png (g, fs, ALTLINUX_ICON, size_r, 20480);
}

#if CAN_DO_WINDOWS

/* Windows, as usual, has to be much more complicated and stupid than
Expand Down

0 comments on commit 9928296

Please sign in to comment.