Mailinglist Archive: yast-devel (73 mails)

< Previous Next >
Re: [yast-devel] YaST for (RH)EL5 patch - yast2-2.13.104
  • From: Zhao Shujing <pearly.zhao@xxxxxxxxxx>
  • Date: Thu, 21 Aug 2008 09:47:51 -0400
  • Message-id: <48AD7207.8030903@xxxxxxxxxx>
Martin,

I make a patch to distinguish RHEL and Oracle EL at Distro.ycp.
Can you view it?

Thanks
Pearly

On 08/14/2008 01:20 PM, Elena Zannoni wrote:
Hi Martin, thanks for looking this over and starting the commits.
I was perusing the yast-commit list, and I noticed this bit in your
commit from the 12th of August:


+ * Is it Fedora based? RHEL, Oracle, ...
+ */
+global boolean fedora () {
+ if (_distro == nil)
+ {
+ if (SCR::Read (.target.size, "/etc/fedora-release") != -1)
+ {
+ _distro = "fedora";
+ y2milestone ("Found Fedora");
+ }
+ }
+
+ return _distro == "fedora";
+}



The comment is incorrect, there is no /etc/fedora-release file in OEL or RHEL, they have
/etc/redhat-release instead (OEL has actually 2 files, /etc/redhat-release and /etc/enterprise-release), so I'd say RHEL and OEL need a separate function?

thanks
elena



Index: yast2/library/modules/Distro.ycp
===================================================================
--- yast2/library/modules/Distro.ycp (revision 50249)
+++ yast2/library/modules/Distro.ycp (working copy)
@@ -36,7 +36,7 @@
}

/**
- * Is it Fedora based? RHEL, Oracle, ...
+ * Is it Fedora based?
*/
global boolean fedora () {
if (_distro == nil)
@@ -52,6 +52,23 @@
}

/**
+ * Is it RHEL based? Oracle EL ...
+ */
+global boolean enterprise_linux() {
+ if (_distro == nil)
+ {
+ if (SCR::Read (.target.size, "/etc/redhat-release") != -1)||
+ (SCR::Read (.target.size, "/etc/enterprise-release") != -1))
+ {
+ _distro = "rhel";
+ y2milestone ("Found RHEL/OEL");
+ }
+ }
+
+ return _distro == "rhel";
+}
+
+/**
* Is it Debian based? Ubuntu, ...
*/
global boolean debian () {
< Previous Next >