Hello community,

here is the log from the commit of package yast2 for openSUSE:12.3 checked in 
at 2013-03-06 09:03:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3/yast2 (Old)
 and      /work/SRC/openSUSE:12.3/.yast2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2", Maintainer is "yast2-maintain...@suse.de"

Changes:
--------
--- /work/SRC/openSUSE:12.3/yast2/yast2.changes 2013-02-23 08:10:38.000000000 
+0100
+++ /work/SRC/openSUSE:12.3/.yast2.new/yast2.changes    2013-03-06 
09:03:03.000000000 +0100
@@ -1,0 +2,10 @@
+Tue Mar  5 15:56:58 CET 2013 - mvid...@suse.cz
+
+- Changed to use network.service alias link, that is installed by
+  the NetworkManager.service while "systemctl enable" and obsoletes
+  the NETWORKMANAGER=yes/no variable in /etc/sysconfig/network/config
+  (bnc#764055,bnc#764336,bnc#798348, by m...@suse.com)
+- Requires sysconfig >= 0.80.0
+- 2.23.22
+
+-------------------------------------------------------------------

Old:
----
  yast2-2.23.21.tar.bz2

New:
----
  yast2-2.23.22.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.QO1fu8/_old  2013-03-06 09:03:03.000000000 +0100
+++ /var/tmp/diff_new_pack.QO1fu8/_new  2013-03-06 09:03:03.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        2.23.21
+Version:        2.23.22
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -53,7 +53,7 @@
 # for ag_tty (/bin/stty)
 # for /usr/bin/md5sum
 Requires:       coreutils
-Requires:       sysconfig
+Requires:       sysconfig >= 0.80.0
 Requires:       yast2-hardware-detection
 Requires:       yast2-xml
 # for SLPAPI.pm

++++++ yast2-2.23.21.tar.bz2 -> yast2-2.23.22.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-2.23.21/Makefile.in 
new/yast2-2.23.22/Makefile.in
--- old/yast2-2.23.21/Makefile.in       2013-02-22 10:46:48.000000000 +0100
+++ new/yast2-2.23.22/Makefile.in       2013-03-05 16:05:07.000000000 +0100
@@ -687,7 +687,7 @@
        *.zip*) \
          unzip $(distdir).zip ;;\
        esac
-       chmod -R a-w $(distdir); chmod u+w $(distdir)
+       chmod -R a-w $(distdir); chmod a+w $(distdir)
        mkdir $(distdir)/_build
        mkdir $(distdir)/_inst
        chmod a-w $(distdir)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-2.23.21/VERSION new/yast2-2.23.22/VERSION
--- old/yast2-2.23.21/VERSION   2013-02-22 10:46:36.000000000 +0100
+++ new/yast2-2.23.22/VERSION   2013-03-05 16:05:04.000000000 +0100
@@ -1 +1 @@
-2.23.21
+2.23.22
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-2.23.21/configure new/yast2-2.23.22/configure
--- old/yast2-2.23.21/configure 2013-02-22 10:46:47.000000000 +0100
+++ new/yast2-2.23.22/configure 2013-03-05 16:05:06.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for yast2 2.23.21.
+# Generated by GNU Autoconf 2.69 for yast2 2.23.22.
 #
 # Report bugs to <http://bugs.opensuse.org/>.
 #
@@ -579,8 +579,8 @@
 # Identity of this package.
 PACKAGE_NAME='yast2'
 PACKAGE_TARNAME='yast2'
-PACKAGE_VERSION='2.23.21'
-PACKAGE_STRING='yast2 2.23.21'
+PACKAGE_VERSION='2.23.22'
+PACKAGE_STRING='yast2 2.23.22'
 PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
 PACKAGE_URL=''
 
@@ -1250,7 +1250,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures yast2 2.23.21 to adapt to many kinds of systems.
+\`configure' configures yast2 2.23.22 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1321,7 +1321,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of yast2 2.23.21:";;
+     short | recursive ) echo "Configuration of yast2 2.23.22:";;
    esac
   cat <<\_ACEOF
 
@@ -1401,7 +1401,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-yast2 configure 2.23.21
+yast2 configure 2.23.22
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1418,7 +1418,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by yast2 $as_me 2.23.21, which was
+It was created by yast2 $as_me 2.23.22, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2357,7 +2357,7 @@
 
 # Define the identity of the package.
  PACKAGE='yast2'
- VERSION='2.23.21'
+ VERSION='2.23.22'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2480,7 +2480,7 @@
 
 
 
-VERSION="2.23.21"
+VERSION="2.23.22"
 RPMNAME="yast2"
 MAINTAINER="YaST2 Maintainers <yast2-maintain...@suse.de>"
 
@@ -3522,7 +3522,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by yast2 $as_me 2.23.21, which was
+This file was extended by yast2 $as_me 2.23.22, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -3575,7 +3575,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-yast2 config.status 2.23.21
+yast2 config.status 2.23.22
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-2.23.21/configure.in 
new/yast2-2.23.22/configure.in
--- old/yast2-2.23.21/configure.in      2013-02-22 10:46:43.000000000 +0100
+++ new/yast2-2.23.22/configure.in      2013-03-05 16:05:04.000000000 +0100
@@ -3,7 +3,7 @@
 dnl -- This file is generated by y2autoconf 2.23.2 - DO NOT EDIT! --
 dnl    (edit configure.in.in instead)
 
-AC_INIT(yast2, 2.23.21, http://bugs.opensuse.org/, yast2)
+AC_INIT(yast2, 2.23.22, http://bugs.opensuse.org/, yast2)
 dnl Check for presence of file 'RPMNAME'
 AC_CONFIG_SRCDIR([RPMNAME])
 
@@ -18,7 +18,7 @@
 AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
 
 dnl Important YaST2 variables
-VERSION="2.23.21"
+VERSION="2.23.22"
 RPMNAME="yast2"
 MAINTAINER="YaST2 Maintainers <yast2-maintain...@suse.de>"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-2.23.21/library/modules/Version.ycp 
new/yast2-2.23.22/library/modules/Version.ycp
--- old/yast2-2.23.21/library/modules/Version.ycp       2013-02-22 
10:46:54.000000000 +0100
+++ new/yast2-2.23.22/library/modules/Version.ycp       2013-03-05 
16:05:11.000000000 +0100
@@ -20,7 +20,7 @@
 /**
  * Version of the yast2 package
  */
-global string yast2 = "2.23.21";
+global string yast2 = "2.23.22";
 
 /* EOF */
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-2.23.21/library/network/src/NetworkService.ycp 
new/yast2-2.23.22/library/network/src/NetworkService.ycp
--- old/yast2-2.23.21/library/network/src/NetworkService.ycp    2013-01-22 
12:22:06.000000000 +0100
+++ new/yast2-2.23.22/library/network/src/NetworkService.ycp    2013-03-05 
16:05:04.000000000 +0100
@@ -27,8 +27,21 @@
  *
  * $Id$
  *
- * This module used to switch between rcnetwork and rcnetworkmanager.
- * Now the master switch is /etc/sysconfig/network/config:NETWORKMANAGER
+ * This module used to switch between /etc/init.d/network providing
+ * LSB network.service and the NetworkManager.service (or another),
+ * which installs a network.service alias link.
+ *
+ * The service name installing the network.sevice is visible in the
+ * "Id" systemctl property:
+ *
+ *     # systemctl --no-pager -p Id show network.service
+ *     Id=network.service
+ *     # systemctl --force          enable NetworkManager.service
+ *     # systemctl --no-pager -p Id show network.service
+ *     Id=NetworkManager.service
+ *
+ * The network.service alias link obsoletes the old master switch in
+ * /etc/sysconfig/network/config:NETWORKMANAGER (until openSUSE-12.2).
  */
 
 {
@@ -50,20 +63,62 @@
 boolean initialized = false;
 
 /**
+ * current network service id name
+ */
+string cur_service_id_name = "";
+
+/**
+ * the new network service id name
+ */
+string new_service_id_name = "";
+
+/**
+ * Path to the systemctl command
+ */
+string systemctl = "/bin/systemctl";
+
+/**
+ * Helper to run systemctl actions
+ * @return exit code
+ */
+integer RunSystemCtl (string service, string action) {
+    string cmd = sformat ("%1 %2 %3.service", systemctl, action, service);
+    map<string,any> ret = (map<string,any>) SCR::Execute (.target.bash_output, 
cmd, $[ "TERM" : "raw"]);
+    y2debug("RunSystemCtl: Command '%1' returned '%2'", cmd, ret);
+    return ret["exit"]:-1;
+}
+
+/**
+ * Whether a network service change were requested
+ * @return true when service change were requested
+ */
+global boolean Modified () {
+    boolean ret = false;
+    Read();
+    if (new_service_id_name != cur_service_id_name) {
+       ret = true;
+    }
+    y2debug("NetworkService::Modified(%1, %2) => %3",
+       cur_service_id_name, new_service_id_name, ret);
+    return ret;
+}
+
+/**
  * Whether use NetworkManager or ifup
+ * @return true when the network is managed, false when
+ *         the /etc/init.d/network script is in use.
  */
 global boolean IsManaged () {
     Read ();
-    return NetworkConfig::Config["NETWORKMANAGER"]:false;
-
+    return new_service_id_name != "network";
 }
 
 /**
  * @param m whether networkmanager will be used
  */
 global void SetManaged (boolean m) {
-    NetworkConfig::Config["NETWORKMANAGER"] = m;
-    initialized = true;
+    Read ();
+    new_service_id_name = m ? "NetworkManager" : "network";
 }
 
 /**
@@ -72,8 +127,10 @@
 global void Read () {
     if (!initialized)
     {
-       NetworkConfig::Read ();
-       boolean nm =  NetworkConfig::Config["NETWORKMANAGER"]:false;
+       cur_service_id_name = Service::GetServiceId("network");
+       new_service_id_name = cur_service_id_name;
+
+       boolean nm = new_service_id_name != "network";
        y2milestone ("NetworkManager: %1", nm);
     }
     initialized = true;
@@ -89,6 +146,12 @@
     SCR::Execute (.target.bash, cmd);
 }
 
+/*
+ * Run /etc/init.d script with specified action
+ * @param script name of the init script
+ * @param action the action to use
+ * @return true, when the script exits with 0
+ */
 boolean RunScript (string script, string action) {
     if (script == "")
         return true;
@@ -98,25 +161,77 @@
     return SCR::Execute (.target.bash, cmd) == 0;
 }
 
-/**
- * Starts and stops the appropriate services.
+/*
+ * Helper to apply a change of the network service
  */
-global void StartStop () {
-    if (Service::Status ("network") == 0)
-    {
-       RunScript ("network", "reload");
+void EnableDisableNow() {
+    if (Modified()) {
+       /* Stop should be called before, but when the service
+        * were not correctly started until now, stop may have
+        * no effect.
+        * So let's kill all processes in the network service
+        * cgroup to make sure e.g. dhcp clients are stopped.
+        */
+       RunSystemCtl(cur_service_id_name, "kill");
+
+       if (new_service_id_name == "network") {
+           RunSystemCtl(cur_service_id_name, "disable");
+       } else {
+           RunSystemCtl(new_service_id_name, "--force enable");
+       }
+       cur_service_id_name = Service::GetServiceId("network");
+       new_service_id_name = cur_service_id_name;
     }
-    else
-    {
-       // #148263
-       // Because rcnetwork really handles two different things in one script
-       // (ifup and NM), it could happen that "start" would shut down an
-       // interface. Instead, it tells the user to use "restart".
-       // So we do it always, it does not hurt if the net was stopped.
-       RunScript ("network", "restart");
+}
+
+/**
+ * Reports if network service is active or not.
+ * It does not report if network is connected.
+ * @return true when network service is active
+ */
+global boolean IsActive()
+{
+    return RunSystemCtl ("network", "is-active") == 0;
+}
+
+/**
+ * Reload or restars the network service.
+ */
+global void ReloadOrRestart () {
+    if (IsActive()) {
+       if (Modified()) {
+               // reload is not sufficient
+               RunSystemCtl("network", "stop");
+               EnableDisableNow();
+               RunSystemCtl("network", "start");
+       } else {
+               // reload may be unsupported
+               RunSystemCtl ("network", "reload-or-try-restart");
+       }
+    } else {
+       // always stop, it does not hurt if the net was stopped.
+       RunSystemCtl("network", "stop");
+       EnableDisableNow();
+       RunSystemCtl("network", "start");
     }
 }
 
+/**
+ * Restarts the network service
+ */
+global void Restart () {
+       RunSystemCtl("network", "stop");
+       EnableDisableNow();
+       RunSystemCtl("network", "start");
+}
+
+/**
+ * This is an old, confusing name for ReloadOrRestart() now
+ */
+global void StartStop () {
+    ReloadOrRestart();
+}
+
 /*
  * Variable remembers that the question has been asked during this run already.
  * It avoids useless questions over and over again.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-2.23.21/library/runlevel/src/Service.ycp 
new/yast2-2.23.22/library/runlevel/src/Service.ycp
--- old/yast2-2.23.21/library/runlevel/src/Service.ycp  2013-01-22 
12:22:06.000000000 +0100
+++ new/yast2-2.23.22/library/runlevel/src/Service.ycp  2013-03-05 
16:05:04.000000000 +0100
@@ -136,6 +136,55 @@
 }
 
 /**
+ * Get complete systemd unit id
+ * @param name name or alias of the unit
+ * @return (resolved) unit Id
+ */
+global string GetUnitId(string unit)
+{
+    string cmd = sformat ("%1 --no-pager -p Id show %2", invoker, unit);
+    map<string,any> ret = (map<string,any>) SCR::Execute (.target.bash_output,
+       cmd, $[ "TERM" : "raw"]);
+    if (ret["exit"]:-1 != 0) {
+       y2error (_("Unable to query '%1' unit Id\nCommand returned: %2\n"),
+           unit, ret);
+       return nil;
+    }
+
+    /* extract first line */
+    integer end = findfirstof (ret["stdout"]:"", "\r\n");
+    string  out = substring(ret["stdout"]:"", 0, end != nil ? end : 0);
+
+    /* extract key anv value */
+    list tmp = splitstring (out, "=");
+    if (size(tmp) != 2 || (tmp[0]:"") != "Id" || (tmp[1]:"") == "") {
+       y2error (_("Unable to parse '%1' unit Id query output: '%2'\n"),
+           unit, out);
+       return nil;
+    }
+
+    return tmp[1]:"";
+}
+
+/**
+ * Get the name from a systemd service unit id without the .service suffix
+ * @param name name or alias of the service
+ * @return (resolved) service name without the .service suffix
+ */
+global string GetServiceId(string name)
+{
+    string id = GetUnitId(sformat("%1.service", name));
+    if (id == nil)
+       return nil;
+
+    /* return without .service */
+    integer pos = search(id, ".service");
+    if (pos <= 0)
+       return nil;
+    return substring(id, 0, pos);
+}
+
+/**
  * Get service info without peeking if service runs.
  * @param name name of the service
  * @return Service information or empty map ($[])

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to