Hello community,
here is the log from the commit of package yast2-packager
checked in at Wed Mar 29 16:55:21 CEST 2006.
--------
--- yast2-packager/yast2-packager.changes 2006-03-28 17:43:06.000000000 +0200
+++ yast2-packager/yast2-packager.changes 2006-03-29 12:21:45.000000000 +0200
@@ -1,0 +2,16 @@
+Wed Mar 29 11:46:29 CEST 2006 - locilka@suse.cz
+
+- Merged proofread texts for SignatureCheckDialogs
+- Adjusted dialogs for SignatureCheckDialogs to show informative
+ icons/images (warning/error/question).
+- Improved SignatureCheckDialogs UI
+- Stopping ZMD after the Sync is done when is wasn't running before
+ (#161279)
+- 2.13.55
+
+-------------------------------------------------------------------
+Wed Mar 29 08:59:34 CEST 2006 - locilka@suse.cz
+
+- Moving ZMD sync from pkg_finish to SourceManager module (#161279)
+
+-------------------------------------------------------------------
Old:
----
yast2-packager-2.13.54.tar.bz2
New:
----
yast2-packager-2.13.55.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.SfVI2Q/_old 2006-03-29 16:53:58.000000000 +0200
+++ /var/tmp/diff_new_pack.SfVI2Q/_new 2006-03-29 16:53:58.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-packager (Version 2.13.54)
+# spec file for package yast2-packager (Version 2.13.55)
#
# 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-packager
-Version: 2.13.54
+Version: 2.13.55
Release: 1
License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-packager-2.13.54.tar.bz2
+Source0: yast2-packager-2.13.55.tar.bz2
prefix: /usr
BuildRequires: docbook-xsl-stylesheets doxygen gcc-c++ libxcrypt-devel libxslt perl-XML-Writer sgml-skel update-desktop-files yast2 yast2-country yast2-devtools yast2-installation yast2-testsuite yast2-xml
Requires: yast2 yast2-installation checkmedia yast2-country
@@ -41,7 +41,7 @@
Arvin Schnell
%prep
-%setup -n yast2-packager-2.13.54
+%setup -n yast2-packager-2.13.55
%build
%{prefix}/bin/y2tool y2autoconf
@@ -78,6 +78,16 @@
%doc %{prefix}/share/doc/packages/yast2-packager
%changelog -n yast2-packager
+* Wed Mar 29 2006 - locilka@suse.cz
+- Merged proofread texts for SignatureCheckDialogs
+- Adjusted dialogs for SignatureCheckDialogs to show informative
+ icons/images (warning/error/question).
+- Improved SignatureCheckDialogs UI
+- Stopping ZMD after the Sync is done when is wasn't running before
+ (#161279)
+- 2.13.55
+* Wed Mar 29 2006 - locilka@suse.cz
+- Moving ZMD sync from pkg_finish to SourceManager module (#161279)
* Tue Mar 28 2006 - locilka@suse.cz
- Added the first implementation of SignatureCheckDialogs module.
- 2.13.54
++++++ yast2-packager-2.13.54.tar.bz2 -> yast2-packager-2.13.55.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.54/VERSION new/yast2-packager-2.13.55/VERSION
--- old/yast2-packager-2.13.54/VERSION 2006-03-28 13:41:14.000000000 +0200
+++ new/yast2-packager-2.13.55/VERSION 2006-03-29 12:21:19.000000000 +0200
@@ -1 +1 @@
-2.13.54
+2.13.55
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.54/configure new/yast2-packager-2.13.55/configure
--- old/yast2-packager-2.13.54/configure 2006-03-28 17:45:55.000000000 +0200
+++ new/yast2-packager-2.13.55/configure 2006-03-29 14:10:19.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for yast2-packager 2.13.54.
+# Generated by GNU Autoconf 2.59 for yast2-packager 2.13.55.
#
# Report bugs to http://www.suse.de/feedback.
#
@@ -269,8 +269,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-packager'
PACKAGE_TARNAME='yast2-packager'
-PACKAGE_VERSION='2.13.54'
-PACKAGE_STRING='yast2-packager 2.13.54'
+PACKAGE_VERSION='2.13.55'
+PACKAGE_STRING='yast2-packager 2.13.55'
PACKAGE_BUGREPORT='http://www.suse.de/feedback'
ac_unique_file="RPMNAME"
@@ -728,7 +728,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-packager 2.13.54 to adapt to many kinds of systems.
+\`configure' configures yast2-packager 2.13.55 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -795,7 +795,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-packager 2.13.54:";;
+ short | recursive ) echo "Configuration of yast2-packager 2.13.55:";;
esac
cat <<\_ACEOF
@@ -908,7 +908,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-yast2-packager configure 2.13.54
+yast2-packager configure 2.13.55
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -922,7 +922,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-packager $as_me 2.13.54, which was
+It was created by yast2-packager $as_me 2.13.55, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1652,7 +1652,7 @@
# Define the identity of the package.
PACKAGE='yast2-packager'
- VERSION='2.13.54'
+ VERSION='2.13.55'
cat >>confdefs.h <<_ACEOF
@@ -1863,7 +1863,7 @@
-VERSION="2.13.54"
+VERSION="2.13.55"
RPMNAME="yast2-packager"
MAINTAINER="Jiri Srain "
@@ -2695,7 +2695,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by yast2-packager $as_me 2.13.54, which was
+This file was extended by yast2-packager $as_me 2.13.55, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -2750,7 +2750,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-packager config.status 2.13.54
+yast2-packager config.status 2.13.55
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.54/configure.in new/yast2-packager-2.13.55/configure.in
--- old/yast2-packager-2.13.54/configure.in 2006-03-28 17:45:50.000000000 +0200
+++ new/yast2-packager-2.13.55/configure.in 2006-03-29 14:10:14.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-packager, 2.13.54, http://www.suse.de/feedback, yast2-packager)
+AC_INIT(yast2-packager, 2.13.55, http://www.suse.de/feedback, yast2-packager)
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.54"
+VERSION="2.13.55"
RPMNAME="yast2-packager"
MAINTAINER="Jiri Srain "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.54/src/clients/pkg_finish.ycp new/yast2-packager-2.13.55/src/clients/pkg_finish.ycp
--- old/yast2-packager-2.13.54/src/clients/pkg_finish.ycp 2006-03-28 13:42:10.000000000 +0200
+++ new/yast2-packager-2.13.55/src/clients/pkg_finish.ycp 2006-03-29 09:09:51.000000000 +0200
@@ -7,9 +7,8 @@
*
* Authors:
* Jiri Srain
- * Lukas Ocilka
*
- * $Id: pkg_finish.ycp 29461 2006-03-28 11:42:01Z locilka $
+ * $Id: pkg_finish.ycp 29493 2006-03-29 07:09:43Z locilka $
*
*/
@@ -18,169 +17,11 @@
textdomain "packager";
import "Installation";
-import "Report";
-import "Message";
any ret = nil;
string func = "";
map param = $[];
- // ------------------------------------------------------------------------------------------------------
- // adding YaST installation source into the ZMD
-
- /**
- * Runs a bash command with timeout.
- * @struct Returns map $[
- * "exit" : int_return_code,
- * "stdout" : [ "script", "stdout", "lines" ],
- * "stderr" : [ "script", "stderr", "lines" ],
- * ]
- *
- * @param string command
- * @param integer timeout in sec.
- * @return map with out, err and ret_code
- */
- map RunCommandWithTimeout (string run_command, integer script_time_out) {
- y2milestone("Running command \"%1\" in background...", run_command);
-
- boolean started = (boolean) SCR::Execute(.background.run_output_err, run_command);
- if (!started) {
- y2error("Cannot run '%1'", run_command);
- return nil;
- }
-
- list<string> script_out = [];
- list<string> script_err = [];
- integer time_spent = 0;
- integer return_code = nil;
- boolean cont_loop = true;
- integer sleep_step = 20;
- script_time_out = script_time_out * 1000;
-
- // while continuing is needed and while it is possible
- while (cont_loop && ((boolean) SCR::Read(.background.output_open) || (integer) SCR::Read(.background.pid) > 0)) {
- // time-out
- if (time_spent >= script_time_out) {
- y2error("Command '%1' timed-out after %2 mces", run_command, time_spent);
- cont_loop = false;
- }
-
- time_spent = time_spent + sleep_step;
- sleep(sleep_step);
- }
- y2milestone("Time spent: %1 msec", time_spent);
-
- // fetching the return code if not timed-out
- if (cont_loop) {
- script_out = (list<string>) SCR::Read(.background.newout);
- script_err = (list<string>) SCR::Read(.background.newerr);
- return_code = (integer) SCR::Read(.background.status);
- }
- SCR::Execute(.background.kill, "");
-
- map command_ret = $[
- "exit" : return_code,
- "stdout" : script_out,
- "stderr" : script_err,
- ];
- return command_ret;
- }
-
- /**
- * Returns count of services matching the pattern. Returns 'nil'
- * if something fails.
- *
- * @param string grep_pattern to match the ZYPP service
- * @return integer count of matching lines
- */
- integer CountOfZMDServicesMatching (string grep_pattern) {
- map ret = RunCommandWithTimeout(
- sformat("TERM=dumb /usr/bin/rug service-list; exit $?"),
- 60
- );
- if (ret != nil && ret["stdout"]:nil != nil) {
- list <string> matching = filter (string one_line, (list <string>) ret["stdout"]:[], {
- return regexpmatch(one_line, grep_pattern);
- });
- return size(matching);
- } else {
- y2error("Counting of services failed, returned %1", ret);
- return nil;
- }
- }
-
- /* Adds a ZYPP service into ZMD */
- boolean AddZYPPServiceIntoZMD () {
- map ret = RunCommandWithTimeout(
- "TERM=dumb /usr/bin/rug service-add --type=zypp /installation; rug subscribe zypp; exit $?",
- 60
- );
- if (ret != nil && ret["exit"]:nil == 0) {
- return true;
- } else {
- y2error("Adding ZYPP service failed, returned %1", ret);
- return false;
- }
- }
-
- /**
- * Checks whether ZMD is running, starts it when isn't. Checks whether a ZYPP source is listed
- * in the ZMD services, adds one if it is missing.
- * Everything is done via the .background agent with timeout (number in seconds).
- */
- boolean SyncYaSTInstSourceWithZMD () {
- // Notes for maintainer:
- // - using .background agent because of ZMD/rug call that can stuck
- // - using 'exit $?' that work well with ZMD/rug and .background together
- // - using TERM=dumb to suppress colors, progress bars etc. from ZMD/rug
-
- y2milestone("--- Syncing YaST inst source with ZMD ---");
- string zmd_service_name = "/etc/init.d/novell-zmd";
- string rug_command = "/usr/bin/rug";
-
- // Check the ZMD status and start if not running, using 'exit $?' because of buggy behavior '.background vs. ZMD'
- map zmd_status = RunCommandWithTimeout(sformat("TERM=dumb %1 ping 1>/dev/null; exit $?", rug_command), 60);
- y2milestone("ZMD status: %1, err: %2", zmd_status["exit"]:nil, zmd_status["stderr"]:[]);
- if (zmd_status == nil || zmd_status["exit"]:nil != 0) {
- // Starting the service
- map zmd_start = RunCommandWithTimeout(sformat("TERM=dumb %1 start; exit $?", zmd_service_name), 60);
- y2milestone("ZMD start: %1", zmd_start);
- // Checking the status after start
- map zmd_status = RunCommandWithTimeout(sformat("TERM=dumb %1 ping 1>/dev/null; exit $?", rug_command), 60);
- y2milestone("ZMD status: %1, err: %2", zmd_status["exit"]:nil, zmd_status["stderr"]:[]);
- if (zmd_status == nil || zmd_status["exit"]:nil != 0) {
- Report::Error(Message::CannotStartService(zmd_service_name));
- y2error("Cannot start service %1, returned %2", zmd_service_name, zmd_status);
- y2milestone("--- Syncing finished ---");
- return false;
- }
- }
-
- // Check whether the ZYPP service is already in zmd db or not
- integer count_of_services = CountOfZMDServicesMatching(".*ZYPP.*/installation.*");
- if (count_of_services == nil) {
- y2warning("Cannot get list of services...");
- } else if (count_of_services > 0) {
- y2milestone("ZYPP service already presented (%1)", count_of_services);
- y2milestone("--- Syncing finished ---");
- return true;
- }
-
- // Count of services were 'nil' or '0'
- if (AddZYPPServiceIntoZMD()) {
- y2milestone("Adding ZYPP service succeeded");
- } else {
- Report::Error(Message::CannotWriteSettingsTo("ZMD"));
- y2error("Adding ZYPP service failed");
- }
-
- y2milestone("--- Syncing finished ---");
- return true;
- }
-
- // adding YaST installation source into the ZMD
- // ------------------------------------------------------------------------------------------------------
-
/* Check arguments */
if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
func = (string)WFM::Args(0);
@@ -203,9 +44,6 @@
}
else if (func == "Write")
{
- // Bug 156030 + 161299 - YaST installation sources must be synced with ZMD
- boolean sync_ret = SyncYaSTInstSourceWithZMD();
-
Pkg::SourceCacheCopyTo (Installation::destdir);
// disable all sources and finish target
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.54/src/modules/SignatureCheckDialogs.ycp new/yast2-packager-2.13.55/src/modules/SignatureCheckDialogs.ycp
--- old/yast2-packager-2.13.54/src/modules/SignatureCheckDialogs.ycp 2006-03-28 17:31:05.000000000 +0200
+++ new/yast2-packager-2.13.55/src/modules/SignatureCheckDialogs.ycp 2006-03-29 13:47:33.000000000 +0200
@@ -16,22 +16,39 @@
import "Popup";
// Defining icons for dialogs
- term error_icon = `Empty();
- term warning_icon = `Empty();
- term question_icon = `Empty();
-
-// TODO: support icons
-// /**
-// * Module constructor
-// */
-// global void InitDialogs () {
-// map ui_capabilities = UI::GetDisplayInfo();
-// if (ui_capabilities["HasLocalImageSupport"]:false) {
-// error_icon = `HBox(`Image("error", ""), `HSpacing(1));
-// warning_icon = `HBox(`Image("warning", ""), `HSpacing(1));
-// question_icon = `HBox(`Image("question", ""), `HSpacing(1));
-// }
-// }
+ map msg_icons = $[
+ "error" : "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_error.png",
+ "warning" : "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_warning.png",
+ "question" : "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_warning.png",
+ ];
+
+ // UI can show images
+ boolean has_local_image_support = nil;
+
+ /**
+ * Returns term with message icon
+ *
+ * @param string message type "error", "warning" or "question"
+ * @return term `Image(...) with margins
+ */
+ term MessageIcon (string msg_type) {
+ // lazy loading
+ if (has_local_image_support == nil) {
+ map ui_capabilities = UI::GetDisplayInfo();
+ has_local_image_support = ui_capabilities["HasLocalImageSupport"]:false;
+ }
+
+ // UI can show images
+ if (has_local_image_support) {
+ if (msg_icons[msg_type]:nil == nil) {
+ y2warning("Message type %1 not defined", msg_type);
+ return `Empty();
+ }
+ return `MarginBox(1, 0.5, `Image(msg_icons[msg_type]:"", "[!]"));
+ } else {
+ return `Empty();
+ }
+ }
/**
* Returns term of yes/no buttons
@@ -127,30 +144,30 @@
global boolean UseUnsignedItem (symbol item_type, string item_name) {
string description_text = sformat((item_type == `package ?
// popup question, %1 stands for the package name
- _("The package '%1' is not digitally signed. This means that the origin
-of the integrity of the package can not be verified. Installing the package
+ _("The package %1 is not digitally signed. This means that the origin
+and integrity of the package cannot be verified. Installing the package
may put the integrity of your system at risk.
-Do you want to install it anyway?")
+Install it anyway?")
:
// popup question, %1 stands for the filename
- _("The file '%1' is not digitally signed. This means that the origin
-of the integrity of the file can not be verified. Using the file
-may put the integrity of your system at risk.
+ _("The file %1 is not digitally signed. This means that the origin
+and integrity of the file cannot be verified. Using the file may put
+the integrity of your system at risk.
-Do you want to use it anyway?")
+Use it anyway?")
), item_name);
UI::OpenDialog(
`opt(`decorated),
`VBox(
`HBox (
- `VCenter(warning_icon),
+ `VCenter(MessageIcon("warning")),
// popup heading
`VCenter(`Heading( _("Signature Check Failed"))),
`HStretch()
),
- `Label(description_text),
+ `MarginBox(0.5, 0.5, `Label(description_text)),
YesNoButtons(`no)
)
);
@@ -174,20 +191,20 @@
global boolean UseCorruptedItem (symbol item_type, string item_name) {
string description_text = sformat((item_type == `package ?
// popup question, %1 stands for the package name
- _("The integrity check for package '%1' failed. This means that
+ _("The integrity check for package %1 failed. This means that
the package has been changed by accident or by an attacker
-since the repository creator has signed it. Installing it
+since the repository creator signed it. Installing it
is a big risk for the integrity and security of your system.
-Do you want to install it anyway?")
+Install it anyway?")
:
// popup question, %1 stands for the filename
- _("The integrity check for file '%1' failed. This means that
+ _("The integrity check for file %1 failed. This means that
the file has been changed by accident or by an attacker
-since the repository creator has signed it. Installing it
+since the repository creator signed it. Installing it
is a big risk for the integrity and security of your system.
-Do you want to use it anyway?")
+Use it anyway?")
), item_name);
UI::OpenDialog(
@@ -195,11 +212,11 @@
`VBox(
// popup heading
`HBox (
- `VCenter(error_icon),
+ `VCenter(MessageIcon("error")),
`VCenter(`Heading( _("Validation Check Failed"))),
`HStretch()
),
- `Label(description_text),
+ `MarginBox(0.5, 0.5, `Label(description_text)),
YesNoButtons(`no)
)
);
@@ -223,30 +240,34 @@
global symbol ItemSignedWithUnknownSignature (symbol item_type, string item_name, string key_id) {
string description_text = sformat((item_type == `package ?
// popup question, %1 stands for the package name, %2 for the key ID
- _("The package '%1' is digitally signed with an unknown GnuPG key '%2'
-and we cannot find that key. This means that a trust relationship to the creator of the package
-can not be established. Installing the package may put the integrity of your system at risk.
+ _("The package %1 is digitally signed with an unknown
+GnuPG key '%2'.
+This means that a trust relationship to the creator of the package
+cannot be established. Installing the package may put the integrity
+of your system at risk.
-Do you want to install it anyway?")
+Install it anyway?")
:
// popup question, %1 stands for the filename, %2 for the key ID
- _("The file '%1' is digitally signed with an unknown GnuPG key '%2'
-and we cannot find that key. This means that a trust relationship to the creator of the file
-can not be established. Using the file may put the integrity of your system at risk.
+ _("The file %1 is digitally signed with an unknown
+GnuPG key '%2'.
+This means that a trust relationship to the creator of the file
+cannot be established. Using the file may put the integrity
+of your system at risk.
-Do you want to use it anyway?")
+Use it anyway?")
), item_name, key_id);
UI::OpenDialog(
`opt(`decorated),
`VBox(
`HBox (
- `VCenter(warning_icon),
+ `VCenter(MessageIcon("warning")),
// popup heading
- `VCenter(`Heading( _("Uknown GnuPG Key"))),
+ `VCenter(`Heading( _("Unknown GnuPG Key"))),
`HStretch()
),
- `Label(description_text),
+ `MarginBox(0.5, 0.5, `Label(description_text)),
YesNoButtons(`no)
)
);
@@ -274,40 +295,46 @@
*/
global symbol ItemSignedWithPublicSignature (symbol item_type, string item_name, string key_id, string key_name) {
string description_text = sformat((item_type == `package ?
- // popup question, %1 stands for the package name
- _("The package '%1' is digitally signed
+ // popup question, %1 stands for the package name, %2 for the key ID, %3 for the key name
+ _("The package %1 is digitally signed
with key '%2 (%3)'.
-There is no trust relationship to the owner of the key. You may chose to import
-the key into your set of trusted keys in the Import dialog and then proceed
-with the installation. You can also chose just to install the package anyway,
-but be aware that packages from untrusted sources can put the integrity
-of your system at risk.")
+
+There is no trust relationship to the owner of the key.
+If you trust the owner, import the key into your set
+of trusted keys then proceed with the installation.
+Installing a package from an unknown source can put
+the integrity of your system at risk. It is safest
+to skip the package.")
:
- // popup question, %1 stands for the filename
+ // popup question, %1 stands for the filename, %2 for the key ID, %3 for the key name
_("The file '%1' is digitally signed
with key '%2 (%3)'.
-There is no trust relationship to the owner of the key. You may chose to import
-the key into your set of trusted keys in the Import dialog and then proceed
-with the installation. You can also chose just to use the file anyway,
-but be aware that packages from untrusted sources can put the integrity
-of your system at risk.")
+
+There is no trust relationship to the owner of the key.
+If you trust the owner, import the key into your set
+of trusted keys then proceed with the installation.
+Installing a file from an unknown source can put
+the integrity of your system at risk. It is safest
+to skip it.")
), item_name, key_id, key_name);
UI::OpenDialog(
`opt(`decorated),
`VBox(
`HBox (
- `VCenter(warning_icon),
+ `VCenter(MessageIcon("warning")),
// popup heading
`VCenter(`Heading( _("Signed with Untrusted Public Key"))),
`HStretch()
),
- `Label(description_text),
+ `MarginBox(0.5, 0.5, `Label(description_text)),
`HBox (
// push button
- `PushButton(`id(`key_import), _("Key &Import Dialog")),
+ `PushButton(`id(`key_import), _("&Import Key")),
+ `HSpacing(1),
// push button
`PushButton(`id(`install), _("Install &Anyway")),
+ `HSpacing(1),
// push button
`PushButton(`id(`skip), _("&Skip Package"))
)
@@ -332,42 +359,68 @@
* @return symbol
*/
global symbol ImportGPGKeyDialog (string key_id, string key_name, string key_location, string key_detailed_description) {
- // FIXME: add somewhere this additional text
- // additional warning text (kind of help)
- string warning_text = sformat(_("The owner of the key may distribute updates, packages and package repositories
-that will be considered trusted by your system and which will be offered for installation
-and update without any further warning. Importing the key thus allows the key owner
-to have a certain amount of control over the software on your system and you should
-only do this if you trust her/him. YaST comes up with a warning dialog for every
-package that's not signed by a trusted (imported) key; this will happen to packages
-by the package creator with key '%1' if you chose not to import."), key_id);
+ // additional Richtext (HTML) warning text (kind of help), %1 stands for the key ID
+ string warning_text = sformat(_("<p>The owner of the key may distribute updates,
+packages, and package repositories that your system will trust and offer
+for installation and update without any further warning. In this way,
+importing the key allows the key owner to have a certain amount of control
+over the software on your system.</p>
+
+<p>Only trust a key if you are confident that the owner can be trusted.
+A warning dialog opens for every package that is not signed by a trusted (imported) key.
+If you do not import the key, packages created by the owner of key '%1'
+show this warning.</p>"), key_id);
+
+ // popup message, %1 stands for GPG key ID, %2 for key name, %3 for key location (URL or ...)
+ string dialog_text = sformat(_("The GnuPG key '%1 (%2)'
+has been found at '%3'.
+
+You can choose to import it into your keyring of trusted
+public keys, meaning that you trust the owner of the key.
+You should be sure that you can trust the owner and that
+the key really belongs to that owner before importing it."),
+ key_id, key_name, key_location);
UI::OpenDialog(
`opt(`decorated),
- `VBox(
- `HBox (
- `VCenter(question_icon),
- // popup heading
- `VCenter(`Heading(_("Import Public GnuPG Key"))),
- `HStretch()
- ),
- `Label(sformat(
- // popup message, %1 stands for GPG key ID, %2 for key name, %3 for key location (URL or ...)
- _("The GnuPG key '%1 (%2)' has been found
-on location '%3'.
-
-You can chose to import it into your keyring of trusted public keys - that means
-you trust the owner of the key. You should be sure that you can trust the owner
-and that the key really belongs to that owner before considering to import it."),
- key_id, key_name, key_location
- )),
`HBox (
- // push button
- `PushButton(`id(`import), _("&Import")),
- // push button
- `PushButton(`id(`details), _("&Details")),
- // push button
- `PushButton(`id(`dont_import), _("Do &Not Import"))
+ `VSpacing(19),
+ // left-side help
+ `HWeight(3,
+ `VBox (
+ `RichText(warning_text)
+ )
+ ),
+ `HSpacing(1.5),
+ // dialog
+ `HWeight(5,
+ `VBox(
+ `Top (
+ `VBox (
+ `HBox (
+ `VCenter(MessageIcon("question")),
+ // popup heading
+ `VCenter(`Heading(_("Import Public GnuPG Key"))),
+ `HStretch()
+ ),
+ // dialog message
+ `MarginBox(0.5, 0.5, `Label(dialog_text))
+ )
+ ),
+ // dialog buttons
+ `Bottom(
+ `HBox (
+ // push button
+ `PushButton(`id(`import), _("&Import")),
+ `HSpacing(1),
+ // push button
+ `PushButton(`id(`details), _("&Details")),
+ `HSpacing(1),
+ // push button
+ `PushButton(`id(`dont_import), _("Do &Not Import"))
+ )
+ )
+ )
)
)
);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.54/src/modules/SourceManager.ycp new/yast2-packager-2.13.55/src/modules/SourceManager.ycp
--- old/yast2-packager-2.13.54/src/modules/SourceManager.ycp 2006-03-28 15:51:57.000000000 +0200
+++ new/yast2-packager-2.13.55/src/modules/SourceManager.ycp 2006-03-29 11:52:17.000000000 +0200
@@ -5,7 +5,7 @@
* Authors: Anas Nashif
* Status: Work in Progress
*
- * $Id: SourceManager.ycp 29470 2006-03-28 12:11:22Z visnov $
+ * $Id: SourceManager.ycp 29499 2006-03-29 09:52:14Z locilka $
*
* Representation of the configuration of source-manager.
* Input and output routines.
@@ -681,5 +681,205 @@
return source_overview;
}
+ // ------------------------------------------------------------------------------------------------------
+ // adding YaST installation source into the ZMD
+
+ /**
+ * Runs a bash command with timeout.
+ * @struct Returns map $[
+ * "exit" : int_return_code,
+ * "stdout" : [ "script", "stdout", "lines" ],
+ * "stderr" : [ "script", "stderr", "lines" ],
+ * ]
+ *
+ * @param string command
+ * @param integer timeout in sec.
+ * @return map with out, err and ret_code
+ */
+ map RunCommandWithTimeout (string run_command, integer script_time_out) {
+ y2milestone("Running command \"%1\" in background...", run_command);
+
+ boolean started = (boolean) SCR::Execute(.background.run_output_err, run_command);
+ if (!started) {
+ y2error("Cannot run '%1'", run_command);
+ return nil;
+ }
+
+ list<string> script_out = [];
+ list<string> script_err = [];
+ integer time_spent = 0;
+ integer return_code = nil;
+ boolean cont_loop = true;
+ integer sleep_step = 20;
+ script_time_out = script_time_out * 1000;
+
+ // while continuing is needed and while it is possible
+ while (cont_loop && ((boolean) SCR::Read(.background.output_open) || (integer) SCR::Read(.background.pid) > 0)) {
+ // time-out
+ if (time_spent >= script_time_out) {
+ y2error("Command '%1' timed-out after %2 mces", run_command, time_spent);
+ cont_loop = false;
+ }
+
+ time_spent = time_spent + sleep_step;
+ sleep(sleep_step);
+ }
+ y2milestone("Time spent: %1 msec", time_spent);
+
+ // fetching the return code if not timed-out
+ if (cont_loop) {
+ script_out = (list<string>) SCR::Read(.background.newout);
+ script_err = (list<string>) SCR::Read(.background.newerr);
+ return_code = (integer) SCR::Read(.background.status);
+ }
+ SCR::Execute(.background.kill, "");
+
+ map command_ret = $[
+ "exit" : return_code,
+ "stdout" : script_out,
+ "stderr" : script_err,
+ ];
+ return command_ret;
+ }
+
+ /**
+ * Returns count of services matching the pattern. Returns 'nil'
+ * if something fails.
+ *
+ * @param string grep_pattern to match the ZYPP service
+ * @return integer count of matching lines
+ */
+ integer CountOfZMDServicesMatching (string grep_pattern) {
+ map ret = RunCommandWithTimeout(
+ sformat("TERM=dumb /usr/bin/rug service-list; exit $?"),
+ 60
+ );
+ if (ret != nil && ret["stdout"]:nil != nil) {
+ list <string> matching = filter (string one_line, (list <string>) ret["stdout"]:[], {
+ return regexpmatch(one_line, grep_pattern);
+ });
+ return size(matching);
+ } else {
+ y2error("Counting of services failed, returned %1", ret);
+ return nil;
+ }
+ }
+
+ /* Adds a ZYPP service into ZMD */
+ boolean AddZYPPServiceIntoZMD () {
+ map ret = RunCommandWithTimeout(
+ "TERM=dumb /usr/bin/rug service-add --type=zypp /installation; rug subscribe zypp; exit $?",
+ 60
+ );
+ if (ret != nil && ret["exit"]:nil == 0) {
+ return true;
+ } else {
+ y2error("Adding ZYPP service failed, returned %1", ret);
+ return false;
+ }
+ }
+
+ /* ZMD service name - used for starting and stopping ZMD */
+ string zmd_service_name = "/etc/init.d/novell-zmd";
+
+ /**
+ * Stops zmd when it 'was not running'.
+ * It's expected that ZMD is running.
+ *
+ * @param boolean was_running
+ * @return boolean true if successful
+ */
+ boolean StopZMDIfItWasNotRunning (boolean was_running) {
+ // It was running, nothing to change
+ if (was_running) return true;
+
+ y2milestone("Stopping service ZMD %1", zmd_service_name);
+ map zmd_stop = RunCommandWithTimeout(sformat("TERM=dumb %1 stop; exit $?", zmd_service_name), 60);
+ y2milestone("ZMD stop: %1", zmd_stop);
+ if (zmd_stop == nil || zmd_stop["exit"]:nil != 0) {
+ y2error("Cannot stop service %1", zmd_service_name);
+ Report::Error(Message::CannotStopService(zmd_service_name));
+ }
+
+ y2milestone("ZMD stopped");
+ return true;
+ }
+
+ /**
+ * Checks whether ZMD is running, starts it when isn't. Checks whether a ZYPP source is listed
+ * in the ZMD services, adds one if it is missing.
+ * Everything is done via the .background agent with timeout (number in seconds).
+ *
+ * @return boolean whether the syncing succeeds
+ */
+ global boolean SyncYaSTInstSourceWithZMD () {
+ // Notes for maintainer:
+ // - using .background agent because of ZMD/rug call that can stuck
+ // - using 'exit $?' that work well with ZMD/rug and .background together
+ // - using TERM=dumb to suppress colors, progress bars etc. from ZMD/rug
+ // - when the function finishes, it must leave ZMD in the same status (running/stopped)
+ // as it was when the function started
+ //
+ // WARNIG: this function starts ZMD and expects that LIBZYPP has no lock over
+ // the RPM database. You can run it only when the RPM is not locked
+ // otherwise the ZMD will block itself!
+
+ y2milestone("--- Syncing YaST inst source with ZMD ---");
+ string rug_command = "/usr/bin/rug";
+
+ // Check the ZMD status and start if not running, using 'exit $?' because of buggy behavior '.background vs. ZMD'
+ map zmd_status = RunCommandWithTimeout(sformat("TERM=dumb %1 ping 1>/dev/null; exit $?", rug_command), 60);
+ y2milestone("ZMD status: %1, err: %2", zmd_status["exit"]:nil, zmd_status["stderr"]:[]);
+ // If the ZMD wasn't running, we will try to start it and then we will have to stop it at the end
+ boolean zmd_was_running = ((integer)zmd_status["exit"]:nil==0 ? true:false);
+
+ if (zmd_status == nil || zmd_status["exit"]:nil != 0) {
+ // Starting the service
+ map zmd_start = RunCommandWithTimeout(sformat("TERM=dumb %1 start; exit $?", zmd_service_name), 60);
+ y2milestone("ZMD start: %1", zmd_start);
+ // Checking the status after start
+ map zmd_status = RunCommandWithTimeout(sformat("TERM=dumb %1 ping 1>/dev/null; exit $?", rug_command), 60);
+ y2milestone("ZMD status: %1, err: %2", zmd_status["exit"]:nil, zmd_status["stderr"]:[]);
+ if (zmd_status == nil || zmd_status["exit"]:nil != 0) {
+ y2error("Cannot start service %1, returned %2", zmd_service_name, zmd_status);
+ Report::Error(Message::CannotStartService(zmd_service_name));
+
+ // In case of timeout
+ if (zmd_status == nil) StopZMDIfItWasNotRunning(zmd_was_running);
+ y2milestone("--- Syncing finished ---");
+ return false;
+ }
+ }
+
+ // Check whether the ZYPP service is already in zmd db or not
+ integer count_of_services = CountOfZMDServicesMatching(".*ZYPP.*/installation.*");
+ if (count_of_services == nil) {
+ y2warning("Cannot get list of services...");
+ } else if (count_of_services > 0) {
+ y2milestone("ZYPP service already presented (%1)", count_of_services);
+
+ // Stop ZMD if needed
+ StopZMDIfItWasNotRunning(zmd_was_running);
+ y2milestone("--- Syncing finished ---");
+ return true;
+ }
+
+ // Count of services were 'nil' or '0'
+ if (AddZYPPServiceIntoZMD()) {
+ y2milestone("Adding ZYPP service succeeded");
+ } else {
+ Report::Error(Message::CannotWriteSettingsTo("ZMD"));
+ y2error("Adding ZYPP service failed");
+ }
+
+ // Stop ZMD if needed
+ StopZMDIfItWasNotRunning(zmd_was_running);
+ y2milestone("--- Syncing finished ---");
+ return true;
+ }
+
+ // adding YaST installation source into the ZMD
+ // ------------------------------------------------------------------------------------------------------
+
/* EOF */
-}
+}
\ No newline at end of file
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...