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: Fri, 15 Aug 2008 19:01:56 -0400
  • Message-id: <48A60AE4.6020507@xxxxxxxxxx>
Martin,

My comments are inline.

On 08/12/2008 07:49 AM, Martin Vidner wrote:
On Thu, Jul 17, 2008 at 02:23:17PM +0800, Zhao Shujing wrote:
Hi,

The YaST for (RH)EL5 is finished. As I have said before, I would share the patches here.
This is the patch of yast2-2.13.104. The patches of the other packages that have been ported will be sent later.

Pearly Zhao

Sorry for taking so long. My comments are below.
I will continue with the other patch set this week.
diff -ur old/REDHAT/SOURCES/yast2/library/agents/cfg_sysctl.scr
REDHAT/SOURCES/yast2-2.13.104/library/agents/cfg_sysctl.scr
--- old/REDHAT/SOURCES/yast2/library/agents/cfg_sysctl.scr 2006-06-29
02:47:16.000000000 -0400
+++ REDHAT/SOURCES/yast2-2.13.104/library/agents/cfg_sysctl.scr 2008-01-11
14:13:24.000000000 -0500
@@ -1,26 +1,38 @@
/**
* File: cfg_sysctl.scr
- * Summary: Agent for reading/writing /etc/sysconfig/sysctl
+ * Summary: Agent for reading/writing /etc/sysctl.conf
* Author: Michal Svec <msvec@xxxxxxx>
- * Access: read / write
+ * Modified: Wenji Huang <wenji.huang@xxxxxxxxxx>
+ * Access: read *
* Example:
* Dir(.sysconfig.sysctl)
- * (["IP_FORWARD", ...])
- **
- * Read(.sysconfig.sysctl.IP_FORWARD)
- * ("yes")
- **
- * Write(.sysconfig.sysctl.IP_FORWARD, "no")
- * (true)
*
- * $Id: cfg_sysctl.scr 13440 2004-01-23 15:13:46Z msvec $
+ * $Id: cfg_sysctl.scr,v 1.1 2004/01/23 15:13:46 msvec Exp $
*
- * Read/Sets the values defined in <tt>/etc/sysconfig/sysctl</tt>
+ * Read the values defined in <tt>/etc/sysctl.conf</tt>
* in an easy manner.
*/
.sysconfig.sysctl

I think the change to cfg_sysctl.scr is wrong: SUSE's
/etc/sysconfig/sysctl has entries like
IP_DYNIP="yes"
IP_TCP_SYNCOOKIES="yes"
which is quite different from the file format of /etc/sysctl.conf,
which SUSE also has.
I suggest that you add a new SCR path, say .etc.sysctl_conf (in
etc_sysctl_conf.scr)
Yes, merge this patch to SuSE need to add a new SCR path for it.
-`ag_ini(
- `SysConfigFile("/etc/sysconfig/sysctl")
+`ag_anyagent(
+ `Description (
+ (`Run("sed -e 's/#.*//g' -e '/^[ \t]*$/d' /etc/sysctl.conf|cat
+")), // real file name
+ "\n", // Comment
+ true, // read-only
+ (`List (
+ `Tuple (
+ `Optional(`Whitespace()),
+ `name (`String("^\t =")),
+ `Optional(`Whitespace()),
+ `Separator ("="),
+ `Optional(`Whitespace()),
+ `value (`String("^\t \n")),
+ `Optional(`Whitespace())
+ ),
+ "\n"
+ ))
+ )
)
+
Only in old/REDHAT/SOURCES/yast2/library: cron
diff -ur old/REDHAT/SOURCES/yast2/library/Makefile.am
REDHAT/SOURCES/yast2-2.13.104/library/Makefile.am
--- old/REDHAT/SOURCES/yast2/library/Makefile.am 2007-01-05
09:21:26.000000000 -0500
+++ REDHAT/SOURCES/yast2-2.13.104/library/Makefile.am 2008-03-13
12:33:43.000000000 -0400
@@ -1,3 +1,3 @@
# Makefile.am for yast2/library
-SUBDIRS = agents types modules runlevel sequencer xml commandline wizard control cwm log system packages cron desktop network gpg
+SUBDIRS = agents types modules runlevel sequencer xml commandline wizard
control cwm log system packages desktop network gpg

Why omit cron?

For YaST can be rebuilt with as less as possible dependencies, I omit some parts that will not be used at YaST for EL.
diff -ur old/REDHAT/SOURCES/yast2/library/Makefile.in
REDHAT/SOURCES/yast2-2.13.104/library/Makefile.in
--- old/REDHAT/SOURCES/yast2/library/Makefile.in 2007-04-11
04:51:27.000000000 -0400
+++ REDHAT/SOURCES/yast2-2.13.104/library/Makefile.in 2008-03-13
12:33:49.000000000 -0400
@@ -169,7 +169,7 @@
ydatadir = @ydatadir@
yncludedir = @yncludedir@
ystartupdir = @ystartupdir@
-SUBDIRS = agents types modules runlevel sequencer xml commandline wizard
control cwm log system packages cron desktop network gpg
+SUBDIRS = agents types modules runlevel sequencer xml commandline wizard
control cwm log system packages desktop network gpg
all: all-recursive
.SUFFIXES:
diff -ur old/REDHAT/SOURCES/yast2/library/network/agents/network.scr
REDHAT/SOURCES/yast2-2.13.104/library/network/agents/network.scr
--- old/REDHAT/SOURCES/yast2/library/network/agents/network.scr 2006-06-29
02:47:22.000000000 -0400
+++ REDHAT/SOURCES/yast2-2.13.104/library/network/agents/network.scr
2008-01-11 14:14:06.000000000 -0500
@@ -2,6 +2,7 @@
* File: network.scr
* Summary: Agent for /etc/sysconfig/network/ifcfg-*
* Author: Michal Svec <msvec@xxxxxxx>
+ * Modified: Wenji Huang <wenji.huang@xxxxxxxxxx>
* Access: read / write
* See: sysconfig.rpm
*
@@ -11,15 +12,15 @@
* VAR2="val 2 #blah" # comment2
* VAR3='val3 x #blah2' # comment3
*
- * $Id: network.scr 20267 2004-11-10 09:45:26Z mvidner $
+ * $Id: network.scr,v 1.9 2003/12/06 20:51:23 msvec Exp $
*
- * <p>Reads/writes <tt>/etc/sysconfig/network/ifcfg-*</tt>. For more details
+ * <p>Reads/writes <tt>/etc/sysconfig/network-scripts/ifcfg-*</tt>. For more
details
* see its own documentation.</p>
*/
.network
`ag_ini(
- `IniAgent( [ "/etc/sysconfig/network/ifcfg-*" ],
+ `IniAgent( [ "/etc/sysconfig/network-scripts/ifcfg-*" ],
$[
/* values at the top level, allow comments after value */
"options" : [ "global_values", "comments_last" ],
@@ -36,7 +37,7 @@
],
/* matching rules */
"rewrite" : [
- [ "/etc/sysconfig/network/ifcfg-(.*)",
"/etc/sysconfig/network/ifcfg-%s" ],
+ [ "/etc/sysconfig/network-scripts/ifcfg-(.*)",
"/etc/sysconfig/network-scripts/ifcfg-%s" ],
],
]
))

I made this a ./configure check, revision 49978.
Thanks
diff -ur old/REDHAT/SOURCES/yast2/library/runlevel/src/Service.ycp REDHAT/SOURCES/yast2-2.13.104/library/runlevel/src/Service.ycp
--- old/REDHAT/SOURCES/yast2/library/runlevel/src/Service.ycp 2006-06-29
02:47:26.000000000 -0400
+++ REDHAT/SOURCES/yast2-2.13.104/library/runlevel/src/Service.ycp
2008-03-31 11:55:35.000000000 -0400
@@ -6,6 +6,7 @@
* Petr Blahos <pblahos@xxxxxxx>
* Michal Svec <msvec@xxxxxxx>
* Lukas Ocilka <locilka@xxxxxxx>
+ * Modified: Zhao Shujing <pearly.zhao@xxxxxxxxxx>
* Flags: Stable
*
* $Id: Service.ycp 31242 2006-06-01 12:59:16Z locilka $
@@ -133,8 +134,8 @@
*/
define boolean serviceDisable (string name, boolean force) {
map ret = (map)SCR::Execute (.target.bash_output,
- sformat ("/sbin/insserv -r%3 %2/%1",
- name, init_d, force? "f": ""));
+ sformat ("/sbin/chkconfig --del %1",
+ name));
if (0 != ret["exit"]:-1)
{
// Error message.
@@ -183,8 +184,8 @@
else
{
map ret = (map)SCR::Execute (.target.bash_output,
- sformat ("/sbin/insserv -d %2/%1",
- name, init_d));
+ sformat ("/sbin/chkconfig --add %1",
+ name));
if (0 != ret["exit"]:-1)
{
// Error message.
@@ -223,7 +224,8 @@
// and calls us only once for each modified service.
// In general we cannot do it with dependencies in a single pass.
- string rls = mergestring ((list<string>)rl, ",");
+ list<string> ls = splitstring((string)rl[0]:"", ",");
+ string rls = mergestring (ls, "");

Hmm, changing the calling convention from
Finetune("sendmail", ["2", "3"])
to
Finetune("sendmail", ["2,3"])
does not seem like a good idea.

Yes, it need to be considered again if merge it to SuSE.
diff -ur old/REDHAT/SOURCES/yast2/library/runlevel/testsuite/tests/ServiceFinetune.out REDHAT/SOURCES/yast2-2.13.104/library/runlevel/testsuite/tests/ServiceFinetune.out
---
old/REDHAT/SOURCES/yast2/library/runlevel/testsuite/tests/ServiceFinetune.out
2006-06-29 02:47:26.000000000 -0400
+++
REDHAT/SOURCES/yast2-2.13.104/library/runlevel/testsuite/tests/ServiceFinetune.out
2008-03-31 12:13:50.000000000 -0400
@@ -1,7 +1,7 @@
Read .init.scripts.exists "aaa" true
-Execute .target.bash_output "/sbin/insserv -rf /etc/init.d/aaa" $["exit":0, "stderr":"",
"stdout":""]
-Execute .target.bash_output "/sbin/insserv -f /etc/init.d/aaa,start=A,B,C" $["exit":0,
"stderr":"", "stdout":""]
+Execute .target.bash_output "/sbin/chkconfig --del aaa" $["exit":0, "stderr":"",
"stdout":""]
+Execute .target.bash_output "/sbin/chkconfig --level A aaa on" $["exit":0, "stderr":"",
"stdout":""]
Return true
Read .init.scripts.exists "aaa" true
-Execute .target.bash_output "/sbin/insserv -rf /etc/init.d/aaa" $["exit":0, "stderr":"",
"stdout":""]
+Execute .target.bash_output "/sbin/chkconfig --del aaa" $["exit":0, "stderr":"",
"stdout":""]
Return true
diff -ur old/REDHAT/SOURCES/yast2/scripts/yast2
REDHAT/SOURCES/yast2-2.13.104/scripts/yast2
--- old/REDHAT/SOURCES/yast2/scripts/yast2 2007-04-11 04:16:18.000000000
-0400
+++ REDHAT/SOURCES/yast2-2.13.104/scripts/yast2 2007-12-13 16:02:56.000000000
-0500
@@ -95,7 +95,7 @@
shift
fi
-case "`/usr/bin/basename $0`" in
+case "`/bin/basename $0`" in
YaST|yast|yast1|zast)
unset DISPLAY
;;

`basename $0` will do just fine, committed.


--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
References