Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at Tue Sep 6 14:34:52 CEST 2011.
-------- --- yast2/yast2.changes 2011-09-01 09:16:02.000000000 +0200 +++ /mounts/work_src_done/STABLE/yast2/yast2.changes 2011-09-05 18:55:30.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Sep 5 16:40:22 UTC 2011 - lsle...@suse.cz + +- added new Systemd.ycp module for handling systemd configuration, + (needed for bnc#707418) +- 2.21.16 + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- yast2-2.21.15.tar.bz2 New: ---- yast2-2.21.16.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.KkSLyn/_old 2011-09-06 14:34:35.000000000 +0200 +++ /var/tmp/diff_new_pack.KkSLyn/_new 2011-09-06 14:34:35.000000000 +0200 @@ -19,11 +19,11 @@ Name: yast2 -Version: 2.21.15 +Version: 2.21.16 Release: 1 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-2.21.15.tar.bz2 +Source0: yast2-2.21.16.tar.bz2 Prefix: /usr @@ -130,7 +130,7 @@ installation with YaST2. %prep -%setup -n yast2-2.21.15 +%setup -n yast2-2.21.16 %build %{prefix}/bin/y2tool y2autoconf ++++++ yast2-2.21.15.tar.bz2 -> yast2-2.21.16.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/VERSION new/yast2-2.21.16/VERSION --- old/yast2-2.21.15/VERSION 2011-09-01 09:18:31.000000000 +0200 +++ new/yast2-2.21.16/VERSION 2011-09-05 18:52:03.000000000 +0200 @@ -1 +1 @@ -2.21.15 +2.21.16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/configure new/yast2-2.21.16/configure --- old/yast2-2.21.15/configure 2011-09-01 09:19:23.000000000 +0200 +++ new/yast2-2.21.16/configure 2011-09-05 19:38:17.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for yast2 2.21.15. +# Generated by GNU Autoconf 2.68 for yast2 2.21.16. # # Report bugs to <http://bugs.opensuse.org/>. # @@ -559,8 +559,8 @@ # Identity of this package. PACKAGE_NAME='yast2' PACKAGE_TARNAME='yast2' -PACKAGE_VERSION='2.21.15' -PACKAGE_STRING='yast2 2.21.15' +PACKAGE_VERSION='2.21.16' +PACKAGE_STRING='yast2 2.21.16' PACKAGE_BUGREPORT='http://bugs.opensuse.org/' PACKAGE_URL='' @@ -1232,7 +1232,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.21.15 to adapt to many kinds of systems. +\`configure' configures yast2 2.21.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1303,7 +1303,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of yast2 2.21.15:";; + short | recursive ) echo "Configuration of yast2 2.21.16:";; esac cat <<\_ACEOF @@ -1383,7 +1383,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -yast2 configure 2.21.15 +yast2 configure 2.21.16 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1400,7 +1400,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.21.15, which was +It was created by yast2 $as_me 2.21.16, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2330,7 +2330,7 @@ # Define the identity of the package. PACKAGE='yast2' - VERSION='2.21.15' + VERSION='2.21.16' cat >>confdefs.h <<_ACEOF @@ -2452,7 +2452,7 @@ -VERSION="2.21.15" +VERSION="2.21.16" RPMNAME="yast2" MAINTAINER="Jiri Srain <jsr...@suse.cz>" @@ -3498,7 +3498,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.21.15, which was +This file was extended by yast2 $as_me 2.21.16, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3551,7 +3551,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.21.15 +yast2 config.status 2.21.16 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/configure.in new/yast2-2.21.16/configure.in --- old/yast2-2.21.15/configure.in 2011-09-01 09:19:21.000000000 +0200 +++ new/yast2-2.21.16/configure.in 2011-09-05 19:38:15.000000000 +0200 @@ -3,7 +3,7 @@ dnl -- This file is generated by y2autoconf 2.18.11 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2, 2.21.15, http://bugs.opensuse.org/, yast2) +AC_INIT(yast2, 2.21.16, 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.21.15" +VERSION="2.21.16" RPMNAME="yast2" MAINTAINER="Jiri Srain <jsr...@suse.cz>" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/library/modules/Version.ycp new/yast2-2.21.16/library/modules/Version.ycp --- old/yast2-2.21.15/library/modules/Version.ycp 2011-09-01 09:19:28.000000000 +0200 +++ new/yast2-2.21.16/library/modules/Version.ycp 2011-09-05 19:38:21.000000000 +0200 @@ -20,7 +20,7 @@ /** * Version of the yast2 package */ -global string yast2 = "2.21.15"; +global string yast2 = "2.21.16"; /* EOF */ } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/library/runlevel/src/Makefile.am new/yast2-2.21.16/library/runlevel/src/Makefile.am --- old/yast2-2.21.15/library/runlevel/src/Makefile.am 2011-08-23 10:09:22.000000000 +0200 +++ new/yast2-2.21.16/library/runlevel/src/Makefile.am 2011-09-05 20:07:13.000000000 +0200 @@ -4,7 +4,7 @@ scrconf_DATA = initscripts.scr -module_DATA = Service.ycp Runlevel.ycp +module_DATA = Service.ycp Runlevel.ycp Systemd.ycp EXTRA_DIST = $(agent_SCRIPTS) \ $(scrconf_DATA) $(module_DATA) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/library/runlevel/src/Makefile.in new/yast2-2.21.16/library/runlevel/src/Makefile.in --- old/yast2-2.21.15/library/runlevel/src/Makefile.in 2011-09-01 09:19:26.000000000 +0200 +++ new/yast2-2.21.16/library/runlevel/src/Makefile.in 2011-09-05 20:07:16.000000000 +0200 @@ -201,7 +201,7 @@ ystartupdir = @ystartupdir@ agent_SCRIPTS = ag_initscripts scrconf_DATA = initscripts.scr -module_DATA = Service.ycp Runlevel.ycp +module_DATA = Service.ycp Runlevel.ycp Systemd.ycp EXTRA_DIST = $(agent_SCRIPTS) \ $(scrconf_DATA) $(module_DATA) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/library/runlevel/src/Systemd.ycp new/yast2-2.21.16/library/runlevel/src/Systemd.ycp --- old/yast2-2.21.15/library/runlevel/src/Systemd.ycp 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-2.21.16/library/runlevel/src/Systemd.ycp 2011-09-05 20:10:24.000000000 +0200 @@ -0,0 +1,81 @@ +/** + * File: modules/Systemd.ycp + * Package: yast2 + * Summary: systemd configuration + * Authors: Ladislav Slezák <lsle...@suse.cz> + * + * $Id$ + * + * Functions for setting systemd options + */ + +{ + +module "Systemd"; + +const string systemd_path = "/bin/systemd"; + +textdomain "base"; + +/** + * Check whether the systemd package is installed + */ +global boolean Installed() +{ + // check for systemd executable + return SCR::Read(.target.size, systemd_path) >= 0; +} + +/* + * Check whether systemd init is currently running + * @return boolean true if systemd init is running + */ +global boolean Running() +{ + // check the command of the init program (PID=1) + const string cmdline_path = "/proc/1/cmdline"; + + // /proc/<pid>/cmdline is a NULL separated list + // we cannot use NULL separator in YCP (?), check just the begining + string init_cmdline = (string)SCR::Read(.target.string, cmdline_path); + y2milestone("Current init program: %1", init_cmdline); + + boolean ret = substring(init_cmdline, 0, size(systemd_path)) == systemd_path; + y2milestone("Systemd detected: %1", ret); + + return ret; +} + +/** + * Set default runlevel for systemd (assumes systemd is installed) + * @param runlevel the default runlevel to set (integer in range 0..6) + * @return boolean true on success + */ +global boolean SetDefaultRunlevel(integer runlevel) +{ + const string default_symlink = "/etc/systemd/system/default.target"; + + if (runlevel == nil || runlevel < 0 || runlevel > 6) + { + y2error("Invalid default runlevel (must be in range 0..6): %1", runlevel); + return false; + } + + y2milestone("Setting systemd default runlevel: %1", runlevel); + + // create symbolic link, -f to rewrite the current link (if exists) + string command = sformat("/bin/ln -s -f /lib/systemd/system/runlevel%1.target %2", runlevel, default_symlink); + y2milestone("Executing: %1", command); + + integer res = (integer)SCR::Execute(.target.bash, command); + y2debug("Result: %1", res); + + boolean ret = (res == 0); + y2milestone("Default runlevel set: %1", ret); + + return ret; +} + + +} /* EOF */ + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/library/runlevel/testsuite/tests/Systemd.out new/yast2-2.21.16/library/runlevel/testsuite/tests/Systemd.out --- old/yast2-2.21.15/library/runlevel/testsuite/tests/Systemd.out 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-2.21.16/library/runlevel/testsuite/tests/Systemd.out 2011-09-05 18:19:45.000000000 +0200 @@ -0,0 +1,18 @@ +Dump Systemd::Running() tests +Read .target.string "/proc/1/cmdline" "init [5]\n" +Return false +Read .target.string "/proc/1/cmdline" "/bin/systemd\n" +Return true +Dump Systemd::SetDefaultRunlevel() tests +Log Invalid default runlevel (must be in range 0..6): nil +Return false +Log Invalid default runlevel (must be in range 0..6): -1 +Return false +Log Invalid default runlevel (must be in range 0..6): 7 +Return false +Execute .target.bash "/bin/ln -s -f /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target" 0 +Return true +Execute .target.bash "/bin/ln -s -f /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target" 0 +Return true +Execute .target.bash "/bin/ln -s -f /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target" 1 +Return false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-2.21.15/library/runlevel/testsuite/tests/Systemd.ycp new/yast2-2.21.16/library/runlevel/testsuite/tests/Systemd.ycp --- old/yast2-2.21.15/library/runlevel/testsuite/tests/Systemd.ycp 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-2.21.16/library/runlevel/testsuite/tests/Systemd.ycp 2011-09-05 18:19:32.000000000 +0200 @@ -0,0 +1,48 @@ +{ + import "Systemd"; + include "testsuite.ycp"; + + + DUMP("Systemd::Running() tests"); + + // Note: \0 should be used here as the separator, but YCP does not allows that... + + // test standard System V init + TEST (``(Systemd::Running()), [$[ + "target" : $[ "string" : "init [5]\n" ] + ], $[], $[]], nil); + + // systemd + TEST (``(Systemd::Running()), [$[ + "target" : $[ "string" : "/bin/systemd\n" ] + ], $[], $[]], nil); + + DUMP("Systemd::SetDefaultRunlevel() tests"); + + // test invalid parameters + TEST (``(Systemd::SetDefaultRunlevel(nil)), [$[], $[], $[ + "target" : $[ "bash" : 0 ] + ]], nil); + + TEST (``(Systemd::SetDefaultRunlevel(-1)), [$[], $[], $[ + "target" : $[ "bash" : 0 ] + ]], nil); + + TEST (``(Systemd::SetDefaultRunlevel(7)), [$[], $[], $[ + "target" : $[ "bash" : 0 ] + ]], nil); + + // test valid parameters + TEST (``(Systemd::SetDefaultRunlevel(3)), [$[], $[], $[ + "target" : $[ "bash" : 0 ] + ]], nil); + + TEST (``(Systemd::SetDefaultRunlevel(5)), [$[], $[], $[ + "target" : $[ "bash" : 0 ] + ]], nil); + + // test failure + TEST (``(Systemd::SetDefaultRunlevel(5)), [$[], $[], $[ + "target" : $[ "bash" : 1 ] + ]], nil); +} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org