Hello community,
here is the log from the commit of package yast2-installation
checked in at Wed Aug 23 20:59:18 CEST 2006.
--------
--- yast2-installation/yast2-installation.changes 2006-08-23 17:00:33.000000000 +0200
+++ yast2-installation/yast2-installation.changes 2006-08-23 17:16:46.000000000 +0200
@@ -1,0 +2,10 @@
+Wed Aug 23 16:59:03 CEST 2006 - locilka@suse.cz
+
+- Added a new debugger tool scr_switch_debugger.ycp that is called
+ when switching to the installed system in switch_scr_finish.ycp
+ fails (#201058).
+- Additionally, YaST logs from installed system are stored under
+ the /var/log/YaST2/InstalledSystemLogs/ directory.
+- 2.13.147
+
+-------------------------------------------------------------------
Old:
----
yast2-installation-2.13.146.tar.bz2
New:
----
yast2-installation-2.13.147.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.BtOf6b/_old 2006-08-23 20:59:12.000000000 +0200
+++ /var/tmp/diff_new_pack.BtOf6b/_new 2006-08-23 20:59:12.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-installation (Version 2.13.146)
+# spec file for package yast2-installation (Version 2.13.147)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-installation
-Version: 2.13.146
+Version: 2.13.147
Release: 1
License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-installation-2.13.146.tar.bz2
+Source0: yast2-installation-2.13.147.tar.bz2
prefix: /usr
BuildRequires: docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel update-desktop-files yast2 yast2-country yast2-devtools yast2-firewall yast2-slp yast2-testsuite
# remove yast2-slp and yast2-firewall once SourceManager is moved back to yast2-packager
@@ -60,7 +60,7 @@
Jiri Srain
%prep
-%setup -n yast2-installation-2.13.146
+%setup -n yast2-installation-2.13.147
%build
%{prefix}/bin/y2tool y2autoconf
@@ -132,6 +132,13 @@
%endif
%changelog -n yast2-installation
+* Wed Aug 23 2006 - locilka@suse.cz
+- Added a new debugger tool scr_switch_debugger.ycp that is called
+ when switching to the installed system in switch_scr_finish.ycp
+ fails (#201058).
+- Additionally, YaST logs from installed system are stored under
+ the /var/log/YaST2/InstalledSystemLogs/ directory.
+- 2.13.147
* Wed Aug 23 2006 - jsrain@suse.cz
- use version specific Xvnc parameters
- 2.13.146
++++++ yast2-installation-2.13.146.tar.bz2 -> yast2-installation-2.13.147.tar.bz2 ++++++
++++ 2921 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-installation-2.13.146/VERSION new/yast2-installation-2.13.147/VERSION
--- old/yast2-installation-2.13.146/VERSION 2006-08-23 16:46:04.000000000 +0200
+++ new/yast2-installation-2.13.147/VERSION 2006-08-23 17:17:14.000000000 +0200
@@ -1 +1 @@
-2.13.146
+2.13.147
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-installation-2.13.146/configure.in new/yast2-installation-2.13.147/configure.in
--- old/yast2-installation-2.13.146/configure.in 2006-08-23 16:58:07.000000000 +0200
+++ new/yast2-installation-2.13.147/configure.in 2006-08-23 17:18:05.000000000 +0200
@@ -1,9 +1,9 @@
dnl configure.in for yast2-installation
dnl
-dnl -- This file is generated by y2autoconf 2.13.18 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 2.13.19 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-installation, 2.13.146, http://bugs.opensuse.org/, yast2-installation)
+AC_INIT(yast2-installation, 2.13.147, http://bugs.opensuse.org/, yast2-installation)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,7 +17,7 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.13.146"
+VERSION="2.13.147"
RPMNAME="yast2-installation"
MAINTAINER="Lukas Ocilka "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-installation-2.13.146/src/clients/switch_scr_finish.ycp new/yast2-installation-2.13.147/src/clients/switch_scr_finish.ycp
--- old/yast2-installation-2.13.146/src/clients/switch_scr_finish.ycp 2006-06-26 08:43:40.000000000 +0200
+++ new/yast2-installation-2.13.147/src/clients/switch_scr_finish.ycp 2006-08-23 17:17:29.000000000 +0200
@@ -8,7 +8,7 @@
* Authors:
* Jiri Srain
*
- * $Id: switch_scr_finish.ycp 27936 2006-02-13 20:01:14Z olh $
+ * $Id: switch_scr_finish.ycp 32543 2006-08-23 15:19:02Z locilka $
*
*/
@@ -23,6 +23,36 @@
string func = "";
map param = $[];
+/**
+ * SCR Switch failed. Reporting error, collecting data.
+ * bugzilla #201058
+ */
+void ErrorDuringSCRSwitch (string chroot_dir) {
+ // import the library once it is needed
+ import "Popup";
+
+ y2error("Cannot switch to SCR '%1'", chroot_dir);
+
+ // Ask users whether they want to debug the problem
+ if (Popup::YesNoHeadline (
+ // popup error headline
+ _("Installation Error"),
+ // popup question
+ _("An Error has occured during switching to the installed system
+and no recovery is possible.
+
+Would you like to run the automatic debugger to find out why it has failed?")
+ )) {
+ y2milestone("User decided to debug the current problem");
+
+ // include the file once it is needed
+ include "installation/scr_switch_debugger.ycp";
+ RunSCRSwitchDebugger(chroot_dir);
+ } else {
+ y2warning("User decided not to debug the current problem");
+ }
+}
+
/* Check arguments */
if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
func = (string)WFM::Args(0);
@@ -59,6 +89,14 @@
y2milestone ("Re-starting SCR on %1", Installation::destdir);
Installation::scr_handle = WFM::SCROpen ("chroot="+Installation::destdir+":scr", false);
+
+ // bugzilla #201058
+ // WFM::SCROpen returns negative integer in case of failure
+ if (Installation::scr_handle < 0) {
+ ErrorDuringSCRSwitch (Installation::destdir);
+ return false;
+ }
+
Installation::scr_destdir = "/";
WFM::SCRSetDefault (Installation::scr_handle);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-installation-2.13.146/src/include/Makefile.am new/yast2-installation-2.13.147/src/include/Makefile.am
--- old/yast2-installation-2.13.146/src/include/Makefile.am 2006-06-26 08:43:45.000000000 +0200
+++ new/yast2-installation-2.13.147/src/include/Makefile.am 2006-08-23 10:21:34.000000000 +0200
@@ -6,7 +6,8 @@
ynclude_DATA = \
misc.ycp \
- add-on-workflow.ycp
+ add-on-workflow.ycp \
+ scr_switch_debugger.ycp
EXTRA_DIST = \
$(ynclude_DATA)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-installation-2.13.146/src/include/scr_switch_debugger.ycp new/yast2-installation-2.13.147/src/include/scr_switch_debugger.ycp
--- old/yast2-installation-2.13.146/src/include/scr_switch_debugger.ycp 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-2.13.147/src/include/scr_switch_debugger.ycp 2006-08-23 17:12:24.000000000 +0200
@@ -0,0 +1,413 @@
+/**
+ * File:
+ * include/installation/scr_switch_debugger.ycp
+ *
+ * Module:
+ * System installation
+ *
+ * Summary:
+ * Debugs SCR switch failure
+ *
+ * Authors:
+ * Lukas Ocilka
+ *
+ */
+
+{
+ textdomain "installation";
+
+ /*
+ * ATTENTION: This functionality is called when SCR switch fails.
+ * It means that there is (probably) no other SCR running
+ * and we have to create one first.
+ */
+
+ import "FileUtils";
+ import "Popup";
+ import "Label";
+
+ // test result (Checking for xyz... Passed)
+ string result_ok = _("Passed");
+ // test result (Checking for xyz... Failed)
+ string result_failed = _("Failed");
+
+ /* ********************************************************************* */
+
+ // --> Configuration
+
+ // path of of the failed chroot (SCROpen)
+ // assigned in main function RunSCRSwitchDebugger()
+ string chroot_path = nil;
+
+ // SCR of the inst-sys
+ string new_SCR_path = "/";
+
+ // chroot binary
+ string test_chroot_binary = "/usr/bin/chroot";
+
+ // any command for the chroot command
+ string test_do_chroot = "ls -1 /";
+
+ // y2base path
+ string test_y2base = "/usr/lib/YaST2/bin/y2base";
+
+ // get all installed rpm packages
+ string test_rpm = "rpm -qa";
+
+ // all needed rpm packages
+ list <string> needed_rpm_packages = [
+ "yast2", "yast2-installation", "yast2-core", "yast2-bootloader", "yast2-packager"
+ ];
+
+ // is the package %1 installed?
+ string test_one_rpm = "rpm -q %1";
+
+ // what requires the %1 package?
+ string test_requires = "rpm -q --requires %1";
+
+ // what provides the %1 object (can contain "()"s)
+ string test_whatprovides = "rpm -q --whatprovides '%1'";
+
+ // where logs are stored
+ string yast_logs = "/var/log/YaST2/";
+
+ // <-- Configuration
+
+ /* ********************************************************************* */
+
+ // --> Helper Functions
+
+ // UI dialog
+ term SCRSwitchDialog () {
+ return `MarginBox (
+ 1, 1, `VBox (
+ `MinWidth (70,
+ // used for progress
+ `LogView (
+ `id (`log_view),
+ // log-view label
+ _("&Checking the Installed System..."),
+ 18, 500
+ )
+ ),
+ `ReplacePoint(`id(`dialog_rp), `Empty())
+ )
+ );
+ }
+
+ // reports a progress with reslt
+ void ReportTest (string test_description, boolean test_result) {
+ if (! test_result) y2error("-- I.C. Winner --");
+
+ // report it to the log
+ y2milestone("%1 %2", test_description, test_result);
+
+ // report it to the UI
+ UI::ChangeWidget (`id(`log_view), `LastLine,
+ sformat ("%1 %2\n", test_description, (test_result ? result_ok : result_failed))
+ );
+ }
+
+ // report just some progress
+ void ReportProgress (string progress_s) {
+ progress_s = sformat ("=== %1 ===", progress_s);
+
+ y2milestone("%1", progress_s);
+ UI::ChangeWidget (`id(`log_view), `LastLine, "\n" + progress_s + "\n");
+ }
+
+ // <-- Helper Functions
+
+ /* ********************************************************************* */
+
+ // --> Tests
+
+ // checks whether the chroot binary exists
+ boolean RunSCRSwitchTest_ChrootBinary () {
+ boolean test_result = FileUtils::Exists (test_chroot_binary);
+
+ ReportTest (
+ // Test progress
+ sformat (_("Checking for '%1' binary..."), test_chroot_binary),
+ test_result
+ );
+
+ return test_result;
+ }
+
+ // checks whether the new SCR path exists
+ boolean RunSCRSwitchTest_ChrootPath () {
+ boolean test_result = FileUtils::IsDirectory (chroot_path);
+
+ ReportTest (
+ // Test progress
+ sformat (_("Checking for chroot directory '%1' ..."), chroot_path),
+ test_result
+ );
+
+ return test_result;
+ }
+
+ // tries to chroot
+ boolean RunSCRSwitchTest_DoChroot () {
+ map test = (map ) SCR::Execute (.target.bash_output,
+ sformat ("%1 %2 %3",
+ test_chroot_binary, // chroot command
+ chroot_path, // where to chroot
+ test_do_chroot // what to execute
+ )
+ );
+ boolean test_result = ((integer) test["exit"]:42 == 0);
+
+ ReportTest (
+ // Test progress
+ _("Trying to chroot..."),
+ test_result
+ );
+ y2milestone("Debug: exit>%1<\nstdout>\n%2<\nstderr>%3<",
+ test["exit"]:0, test["stdout"]:"", test["stderr"]:""
+ );
+
+ return test_result;
+ }
+
+ // checks whether the y2base binary exists
+ boolean RunSCRSwitchTest_Y2BASE () {
+ string y2basefile = sformat("%1%2", chroot_path, test_y2base);
+ boolean test_result = FileUtils::Exists (y2basefile);
+
+ ReportTest (
+ // Test progress
+ sformat (_("Checking for '%1' in '%2' ..."), test_y2base, chroot_path),
+ test_result
+ );
+
+ return test_result;
+ }
+
+ // tries to get all installed packages from new SCR
+ boolean RunSCRSwitchTest_DoRPMCheck () {
+ map test = (map ) SCR::Execute (.target.bash_output,
+ sformat ("%1 %2 %3",
+ test_chroot_binary, // chroot command
+ chroot_path, // where to chroot
+ test_rpm // what to execute
+ )
+ );
+ boolean test_result = ((integer) test["exit"]:42 == 0);
+
+ ReportTest (
+ // Test progress
+ _("Checking for installed RPM packages..."),
+ test_result
+ );
+ y2milestone("Debug: exit>%1<\nstdout>\n%2<\nstderr>%3<",
+ test["exit"]:0, test["stdout"]:"", test["stderr"]:""
+ );
+
+ return test_result;
+ }
+
+ // checks whether the RPM is installed in SCR
+ boolean RunSCRSwitchTest_CheckWhetherInstalled (string package_name) {
+ boolean test_result = nil;
+ boolean ret = true;
+ string one_rpm_installed = nil;
+
+ one_rpm_installed = sformat ("%1 %2 %3",
+ test_chroot_binary,
+ chroot_path,
+ sformat (test_one_rpm, package_name)
+ );
+
+ map test = (map ) SCR::Execute (.target.bash_output, one_rpm_installed);
+ test_result = ((integer) test["exit"]:42 == 0);
+ if (! test_result) ret = false;
+
+ ReportTest (
+ // Test progress
+ sformat(_("Checking whether RPM package '%1' is installed..."), package_name),
+ test_result
+ );
+ y2milestone("Debug: %1", test);
+
+ return ret;
+ }
+
+ // check which packages are required by needed packages
+ boolean RunSCRSwitchTest_DoNeededRPMsRequire (string package_name) {
+ boolean test_result = nil;
+ boolean ret = true;
+
+ map required_packages = (map ) SCR::Execute (.target.bash_output,
+ sformat ("%1 %2 %3",
+ test_chroot_binary,
+ chroot_path,
+ sformat (test_requires, package_name)
+ )
+ );
+ test_result = ((integer) required_packages["exit"]:42 == 0);
+ if (! test_result) ret = false;
+
+ ReportTest (
+ // Test progress
+ sformat(_("Checking what requires RPM package '%1'..."), package_name),
+ test_result
+ );
+
+ // we have required objects
+ if (test_result) {
+ string required_packages_s = required_packages["stdout"]:"";
+
+ // check all required objects (sorted and only once)
+ foreach (string one_require, toset (splitstring (required_packages_s, "\n")), {
+ if (one_require == "") continue;
+ if (regexpmatch (one_require, "[ \t]")) {
+ one_require = regexpsub (one_require, "^([^ \t]*)[ \t]", "\\1");
+ }
+
+ map what_provides = (map ) SCR::Execute (.target.bash_output,
+ sformat ("%1 %2 %3",
+ test_chroot_binary,
+ chroot_path,
+ sformat (test_whatprovides, one_require)
+ )
+ );
+
+ test_result = ((integer) what_provides["exit"]:42 == 0);
+ if (! test_result) {
+ // do not check whether required objects are installed
+ // if we don't have which they are
+ break;
+ ret = false;
+ }
+
+ string what_provides_s = what_provides["stdout"]:"";
+ boolean at_least_one = false;
+ // checks whether objects that provides something are installed
+ foreach (string one_provides, toset (splitstring (what_provides_s, "\n")), {
+ if (one_provides == "") continue;
+ if (RunSCRSwitchTest_CheckWhetherInstalled (one_provides)) {
+ at_least_one = true;
+ break;
+ } else {
+ ret = false;
+ }
+ });
+ // none of what_provides is installed
+ // or nothing provides the requierd object
+ if (! at_least_one) ret = false;
+ });
+ }
+
+ return ret;
+ }
+
+ // checks a package, whether it is installed
+ // if it is installed, whether is has installed requires
+ boolean RunSCRSwitchTest_DoNeededRPMsCheck () {
+ boolean ret = true;
+
+ // check whether all needed packages are installed
+ foreach (string package_name, sort (needed_rpm_packages), {
+ // Test progress
+ ReportProgress (sformat (_("Complex checking of package '%1'"), package_name));
+ // is the package installed?
+ if (! RunSCRSwitchTest_CheckWhetherInstalled (package_name)) {
+ ret = false;
+ }
+ // if it is installed, check whetheris has all dependencies
+ else if (! RunSCRSwitchTest_DoNeededRPMsRequire (package_name)) {
+ ret = false;
+ }
+ });
+
+ return ret;
+ }
+
+ // main test
+ boolean RunSCRSwitchTests () {
+ // Test progress
+ ReportProgress (_("System Checking"));
+ if (! RunSCRSwitchTest_ChrootBinary()) return false;
+ if (! RunSCRSwitchTest_ChrootPath()) return false;
+ if (! RunSCRSwitchTest_DoChroot()) return false;
+ if (! RunSCRSwitchTest_Y2BASE()) return false;
+ if (! RunSCRSwitchTest_DoRPMCheck()) return false;
+
+ // checking all mandatory packages
+ if (! RunSCRSwitchTest_DoNeededRPMsCheck()) return false;
+
+ // Add new checks here...
+
+ return true;
+ }
+
+ // <-- Tests
+
+ /* ********************************************************************* */
+
+ // --> Special Functions
+
+ void CopyY2logsFromSCRToInstSys () {
+ string scr_logs_directory = sformat ("%1%2", chroot_path, yast_logs);
+ string command = sformat ("cp -avr '%1' '%2InstalledSystemLogs'", scr_logs_directory, yast_logs);
+
+ y2milestone("Running command: %1 -> %2", command,
+ SCR::Execute (.target.bash_output, command)
+ );
+ }
+
+ // <-- Special Functions
+
+ /* ********************************************************************* */
+
+ /**
+ * Function debugs why the SCR switch failed and reports
+ * it to user.
+ *
+ * @param string failed_chroot_chroot
+ */
+ void RunSCRSwitchDebugger (string failed_chroot_path) {
+ if (failed_chroot_path == nil) {
+ y2error("Chroot path not defined!");
+ // popup error
+ Popup::Error(_("Unknown chroot path, debugger cannot continue."));
+ return;
+ }
+ // will be used for all chroot calls later
+ chroot_path = failed_chroot_path;
+
+ // if any SCR exists
+ integer old_SCR = WFM::SCRGetDefault ();
+ integer new_SCR = WFM::SCROpen ("chroot=" + new_SCR_path + ":scr", false);
+ if (new_SCR < 0) {
+ y2error("Cannot conenct to SCR %1", new_SCR_path);
+ Popup::Error(_("Connecting to the inst-sys failed, debugger cannot continue."));
+ return;
+ }
+ // Set the new SCR as a defalt one
+ WFM::SCRSetDefault (new_SCR);
+
+ // Copy all YaST log files from SCR to Inst-Sys
+ CopyY2logsFromSCRToInstSys();
+
+ y2milestone("* ---------- Debugger Start ---------- *");
+
+ UI::OpenDialog (SCRSwitchDialog());
+ RunSCRSwitchTests();
+ UI::ReplaceWidget (`id (`dialog_rp), `PushButton (`id(`ok), Label::OKButton()));
+ any ret = nil;
+ while (ret != `ok) {
+ ret = UI::UserInput();
+ }
+ UI::CloseDialog ();
+
+ y2milestone("* ---------- Debugger Finish ---------- *");
+
+ // Close the SCR created for testing
+ WFM::SCRClose (new_SCR);
+ // Set the previous one as the default
+ WFM::SCRSetDefault (old_SCR);
+ }
+}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org