add fedora name

This commit is contained in:
Matthias Clasen 2006-11-18 06:24:57 +00:00
parent cb05eb3330
commit 1a4ad73708
2 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,58 @@
--- gnome-system-monitor-2.17.2.1/src/sysinfo.cpp.fedora 2006-11-02 13:45:35.000000000 -0500
+++ gnome-system-monitor-2.17.2.1/src/sysinfo.cpp 2006-11-18 01:09:14.000000000 -0500
@@ -141,10 +141,55 @@
};
+ class RedHatSysInfo
+ : public SysInfo
+ {
+ public:
+ RedHatSysInfo() : SysInfo(_("Unknown distro"))
+ {
+ this->load_redhat_info();
+ }
+
+ private:
+ void load_redhat_info()
+ {
+ gchar *text, *t, *s;
+
+ if (!g_file_get_contents ("/etc/redhat-release", &text, NULL, NULL))
+ return;
+
+ t = strstr (text, " release");
+
+ if (!t)
+ {
+ g_free (text);
+ return;
+ }
+
+ *t = '\0';
+
+ t += strlen (" release");
+
+ while (*t == ' ')
+ t++;
+
+ s = strchr (t, ' ');
+
+ if (s)
+ *s = '\0';
+
+ this->distro_name = text;
+ this->distro_version = t;
+ }
+ };
+
+
SysInfo* get_sysinfo()
{
if (g_file_test("/etc/debian_version", G_FILE_TEST_EXISTS))
return new DebianSysInfo;
+ else if (g_file_test("/etc/redhat-release", G_FILE_TEST_EXISTS))
+ return new RedHatSysInfo;
else
return new SysInfo(_("Unknown distro"));
}

View File

@ -12,12 +12,13 @@
Summary: Simple process monitor
Name: gnome-system-monitor
Version: 2.17.2.1
Release: 1%{?dist}
Release: 2%{?dist}
License: GPL
Group: Applications/System
URL: http://www.gnome.org/
Source: http://ftp.gnome.org/pub/GNOME/sources/gnome-system-monitor/2.15/gnome-system-monitor-%{version}.tar.bz2
Source1: side.png
Patch0: gnome-system-monitor-2.17.2.1-fedora.patch
BuildRoot: %{_tmppath}/%{name}-root
Requires: libgnomeui >= %{libgnomeui_version}
Requires: libgtop2 >= %{libgtop2_version}
@ -48,6 +49,8 @@ gnome-system-monitor is a simple process and system monitor.
%prep
%setup -q
%patch0 -p1 -b .fedora
cp %{SOURCE1} pixmaps/
%build
@ -105,6 +108,9 @@ scrollkeeper-update -q
%{_datadir}/omf/gnome-system-monitor/
%changelog
* Sat Nov 18 2006 Matthias Clasen <mclasen@redhat.com> - 2.17.2.1-2
- Add disto info
* Sun Nov 12 2006 Matthias Clasen <mclasen@redhat.com> - 2.17.2.1-1
- Update to 2.17.2.1