
Hello community, here is the log from the commit of package yast2-packager checked in at Wed May 31 02:58:56 CEST 2006. -------- --- yast2-packager/yast2-packager.changes 2006-05-25 17:50:20.000000000 +0200 +++ yast2-packager/yast2-packager.changes 2006-05-30 16:31:26.000000000 +0200 @@ -1,0 +2,15 @@ +Tue May 30 16:07:38 CEST 2006 - jsrain@suse.cz + +- fixed installation into directory (preselect patterns, don't ask + about base selection if pattern-based installation) (#177917) +- 2.13.122 + +------------------------------------------------------------------- +Tue May 30 08:46:50 CEST 2006 - locilka@suse.cz + +- Reimplementing the "Do Not Show Again" popups to store this flag + permanently. It stores URL + dialog type + default return + value (#175845). +- 2.13.121 + +------------------------------------------------------------------- Old: ---- yast2-packager-2.13.120.tar.bz2 New: ---- yast2-packager-2.13.122.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.JB1JkU/_old 2006-05-31 02:58:46.000000000 +0200 +++ /var/tmp/diff_new_pack.JB1JkU/_new 2006-05-31 02:58:46.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-packager (Version 2.13.120) +# spec file for package yast2-packager (Version 2.13.122) # # 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.120 +Version: 2.13.122 Release: 1 License: GPL Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-packager-2.13.120.tar.bz2 +Source0: yast2-packager-2.13.122.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 @@ -43,7 +43,7 @@ Arvin Schnell <arvin@suse.de> %prep -%setup -n yast2-packager-2.13.120 +%setup -n yast2-packager-2.13.122 %build %{prefix}/bin/y2tool y2autoconf @@ -80,6 +80,15 @@ %doc %{prefix}/share/doc/packages/yast2-packager %changelog -n yast2-packager +* Tue May 30 2006 - jsrain@suse.cz +- fixed installation into directory (preselect patterns, don't ask + about base selection if pattern-based installation) (#177917) +- 2.13.122 +* Tue May 30 2006 - locilka@suse.cz +- Reimplementing the "Do Not Show Again" popups to store this flag + permanently. It stores URL + dialog type + default return + value (#175845). +- 2.13.121 * Thu May 25 2006 - mvidner@suse.cz - Use Pkg::SourceSaveAll which always saves even if no sources are enabled (#176013). ++++++ yast2-packager-2.13.120.tar.bz2 -> yast2-packager-2.13.122.tar.bz2 ++++++ ++++ 6814 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-packager-2.13.120/VERSION new/yast2-packager-2.13.122/VERSION --- old/yast2-packager-2.13.120/VERSION 2006-05-25 17:49:19.000000000 +0200 +++ new/yast2-packager-2.13.122/VERSION 2006-05-30 16:14:24.000000000 +0200 @@ -1 +1 @@ -2.13.120 +2.13.122 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-packager-2.13.120/configure.in new/yast2-packager-2.13.122/configure.in --- old/yast2-packager-2.13.120/configure.in 2006-05-25 18:10:32.000000000 +0200 +++ new/yast2-packager-2.13.122/configure.in 2006-05-30 16:30:08.000000000 +0200 @@ -1,9 +1,9 @@ dnl configure.in for yast2-packager dnl -dnl -- This file is generated by y2autoconf 2.13.17 - DO NOT EDIT! -- +dnl -- This file is generated by y2autoconf 2.13.18 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2-packager, 2.13.120, http://bugs.opensuse.org/, yast2-packager) +AC_INIT(yast2-packager, 2.13.122, http://bugs.opensuse.org/, 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.120" +VERSION="2.13.122" RPMNAME="yast2-packager" MAINTAINER="Jiri Srain <jsrain@suse.cz>" 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-packager-2.13.120/src/clients/dirinstall.ycp new/yast2-packager-2.13.122/src/clients/dirinstall.ycp --- old/yast2-packager-2.13.120/src/clients/dirinstall.ycp 2006-04-19 12:59:38.000000000 +0200 +++ new/yast2-packager-2.13.122/src/clients/dirinstall.ycp 2006-05-30 15:52:52.000000000 +0200 @@ -9,7 +9,13 @@ { textdomain "packager"; + import "DirInstall"; import "PackageLock"; + import "Product"; + import "Report"; + + include "dirinstall/ui.ycp"; + // check whether having the packager for ourselves if (! PackageLock::Check ()) return `abort; @@ -19,14 +25,84 @@ PackageCallbacksInit::InitPackageCallbacks(); // initializa the package manager + integer old_src = -1; + integer new_src = -1; + boolean using_patterns = false; + Pkg::TargetFinish (); Pkg::SourceStartManager(true); + boolean have_patterns + = size (Pkg::ResolvableProperties ("", `pattern, "")) > 0; + boolean have_selections + = size (Pkg::GetSelections (`available, "base")) > 0; + have_patterns = have_patterns && ! have_selections; + if (have_patterns) + { + y2milestone ("Host system is using patterns"); + Pkg::TargetInit ("/", false); + list<map<string,any> > prods = Pkg::ResolvableProperties ("", `product, ""); + list<map<string,any> > base_l = filter (map<string,any> p, prods, { + return p["category"]:"" == "base"; + }); + map<string,any> base = base_l[0]:$[]; + if (size (base_l) == 0) + { + y2warning ("No base product found, using first found product"); + base = prods[0]:$[]; + } + y2milestone ("Found base product: %1", base); + prods = Pkg::ResolvableProperties (base["name"]:"", `product, ""); + y2milestone ("Found appropriate base products in sources: %1", prods); + if (size (prods) == 0) + { + // error report + Report::Error (_("Could not read package information.")); + return `abort; + } + map<string,any> prod = prods[0]:$[]; + integer source = prod["source"]:-1; + map src_data = Pkg::SourceGeneralData (source); + Pkg::SourceSetEnabled (source, false); + string url = src_data["url"]:""; + string dir = src_data["product_dir"]:"/"; + if (substring (url, 0, 3) == "cd:" || substring (url, 0, 4) == "dvd:") + { + if (! Popup::ContinueCancel (sformat (_("Insert %1 CD 1"), base["summary"]:""))) + return `back; + } + new_src = Pkg::SourceCreateBase (url, dir); + old_src = source; + using_patterns = true; - import "DirInstall"; - include "dirinstall/ui.ycp"; + string content_file = Pkg::SourceProvideFile (new_src, 1, "/content"); + SCR::RegisterAgent (.media.content, `ag_ini( + `IniAgent( content_file, + $[ + "options" : [ "read_only", "global_values", "flat" ], + "comments" : [ "^#.*", "^[ \t]*$", ], + "params" : [ + $[ "match" : [ "^[ \t]*([a-zA-Z0-9_\.]+)[ \t]*(.*)[ \t]*$", "%s %s" ] ] + ] + ] + ))); + any tmp1 = SCR::Read (.media.content.PATTERNS); + if (tmp1 != nil) + Product::patterns = splitstring ((string)tmp1, " "); + y2milestone ("***Patterns: %1", Product::patterns); + Pkg::TargetFinish (); + } + else + { + y2milestone ("Host system is using selections"); + } symbol ret = Run (); y2milestone ("Sequence returned %1", ret); DirInstall::UmountFilesystems (); + if (using_patterns) + { + Pkg::SourceDelete (new_src); + Pkg::SourceSetEnabled (old_src, true); + } DirInstall::FinishPackageManager (); return ret; } 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-packager-2.13.120/src/clients/inst_dirinstall_finish.ycp new/yast2-packager-2.13.122/src/clients/inst_dirinstall_finish.ycp --- old/yast2-packager-2.13.120/src/clients/inst_dirinstall_finish.ycp 2006-04-27 16:45:08.000000000 +0200 +++ new/yast2-packager-2.13.122/src/clients/inst_dirinstall_finish.ycp 2006-05-30 16:12:59.000000000 +0200 @@ -8,7 +8,7 @@ * Authors: * Anas Nashif <nashif@suse.de> * - * $Id: inst_dirinstall_finish.ycp 30518 2006-04-27 06:24:33Z lslezak $ + * $Id: inst_dirinstall_finish.ycp 31191 2006-05-30 14:12:50Z jsrain $ * */ { @@ -106,6 +106,8 @@ } ); + // Stop SCR on target + WFM::SCRClose (Installation::scr_handle); // umount /proc and /sys before creating image (otherwise tar may fail) DirInstall::UmountFilesystems (); @@ -123,9 +125,6 @@ WFM::Execute(.local.bash, cmd); } - // Stop SCR on target - WFM::SCRClose (Installation::scr_handle); - Progress::Finish(); return `next; } 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-packager-2.13.120/src/clients/software_proposal.ycp new/yast2-packager-2.13.122/src/clients/software_proposal.ycp --- old/yast2-packager-2.13.120/src/clients/software_proposal.ycp 2006-03-14 17:25:53.000000000 +0100 +++ new/yast2-packager-2.13.122/src/clients/software_proposal.ycp 2006-05-30 09:42:43.000000000 +0200 @@ -96,7 +96,9 @@ else { symbol result = `again; - string client_to_call = Stage::initial () + string client_to_call = (Stage::initial () + || (size (Pkg::ResolvableProperties ("", `pattern, "")) > 0 + && size (Pkg::GetSelections (`available, "base")) == 0)) ? "inst_sw_select" : "inst_sw_selection_select"; 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-packager-2.13.120/src/modules/DontShowAgain.ycp new/yast2-packager-2.13.122/src/modules/DontShowAgain.ycp --- old/yast2-packager-2.13.120/src/modules/DontShowAgain.ycp 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-packager-2.13.122/src/modules/DontShowAgain.ycp 2006-05-30 16:29:57.000000000 +0200 @@ -0,0 +1,326 @@ +/** + * File: modules/DontShowAgain.ycp + * Authors: Lukas Ocilka <locilka@suse.cz> + * Summary: Handling "Don Not Show This Dialog Again" + * + * $Id: DontShowAgain.ycp 11111 2006-05-29 12:27:15Z locilka $ + */ +{ + module "DontShowAgain"; + textdomain "packager"; + + import "Directory"; + import "FileUtils"; + + /** + * Module for that stores and returns the information for + * "Don't Show This Dialog/Question Again" + */ + + /* File with the current configuration */ + string conf_file = Directory::vardir + "/dont_show_again.conf"; + + /** + * Current configuration map + * + * @struct $[ + * // question type + * "inst-source" : $[ + * // question identification (MD5sum of the question in the future?) + * "-question-ident-" : $[ + * // url of the file or directory + * "ftp://abc.xyz/rtf" : $[ + * // show the dialog again + * "show_again" : false, + * // additional question return + * "return" : true, + * ] + * ] + * ] + * ] + */ + map <string, map <string, map <string, any> > > current_configuration = $[]; + + /* Configuration has already been read */ + global boolean already_read = false; + + /** + * Function that reads the current configuration if it hasn't been + * read already. It must be called before every Get or Set command. + */ + void LazyLoadCurrentConf () { + if (! already_read) { + if (FileUtils::Exists(conf_file) && FileUtils::IsFile(conf_file)) { + y2milestone("Reading %1 file", conf_file); + // Read and evaluate the current configuration + map <string, map <string, map <string, any> > > read_conf = (map <string, map <string, map <string, any> > >) + SCR::Read(.target.ycp, conf_file); + if (read_conf != nil) { + current_configuration = read_conf; + } + } else { + y2milestone("Configuration file %1 doesn't exist, there's no current configuration.", + conf_file + ); + } + + // Configuration mustn't be read again + already_read = true; + } + } + + /** + * Saves the current configuration into the configuration file + */ + boolean SaveCurrentConfiguration () { + LazyLoadCurrentConf(); + + return SCR::Write(.target.ycp, conf_file, current_configuration); + } + + /** + * Returns whether the question should be shown again + * + * @param map <string, string> of params + * @see current_configuration + * @return boolean it should be shown + */ + global boolean GetShowQuestionAgain (map <string, string> params) { + LazyLoadCurrentConf(); + string q_type = params["q_type"]:nil; + + // <--- Installation Sources ---> + /* + * Parameters, $[ + * "q_type" : "inst-source", // mandatory + * "q_ident" : "Question Identification", // mandatory + * "q_url" : "URL" // optional + * ]; + */ + if (q_type == "inst-source") { + string q_ident = params["q_ident"]:nil; + string q_url = params["q_url"]:nil; + + if (q_ident == nil) { + y2error("'q_ident' is a mandatory parameter"); + return nil; + } + + if (current_configuration[q_type]:nil == nil + || current_configuration[q_type, q_ident]:nil == nil + || current_configuration[q_type, q_ident, q_url]:nil == nil + || current_configuration[q_type, q_ident, q_url, "show_again"]:nil == nil) { + return nil; + } + + return (boolean) current_configuration[q_type, q_ident, q_url, "show_again"]:nil; + // <--- Installation Sources ---> + + // Add another types here... + } else { + y2error("'%1' is an unknown type", q_type); + return nil; + } + } + + /** + * Sets and stores whether the question should be shown again. + * If it should be, the result is not stored since the 'show again' + * is the default value. + * + * @param map <string, string> of params + * @see current_configuration + * @param boolean show again + * @return boolean if success + */ + global boolean SetShowQuestionAgain (map <string, string> params, boolean new_value) { + LazyLoadCurrentConf(); + string q_type = params["q_type"]:nil; + // Always set to 'true' if the configuration is changed + boolean conf_changed = false; + + // <--- Installation Sources ---> + /* + * Parameters, $[ + * "q_type" : "inst-source", // mandatory + * "q_ident" : "Question Identification", // mandatory + * "q_url" : "URL" // optional + * ]; + */ + if (q_type == "inst-source") { + string q_ident = params["q_ident"]:nil; + string q_url = params["q_url"]:nil; + + if (q_ident == nil) { + y2error("'q_ident' is a mandatory parameter"); + return nil; + } + + // building the configuration map + if (current_configuration[q_type]:nil == nil) { + current_configuration[q_type] = $[]; + } + if (current_configuration[q_type, q_ident]:nil == nil) { + current_configuration[q_type, q_ident] = $[]; + } + if (current_configuration[q_type, q_ident, q_url]:nil == nil) { + current_configuration[q_type, q_ident, q_url] = $[]; + } + + // save the new value into the configuration + conf_changed = true; + current_configuration[q_type, q_ident, q_url, "show_again"] = new_value; + // <--- Installation Sources ---> + + // Add another types here... + } else { + y2error("'%1' is an unknown type", q_type); + return nil; + } + + if (conf_changed) return SaveCurrentConfiguration(); + else return nil; + } + + /** + * Return the default return value for question that should not + * be shown again + * + * @param map <string, string> of params + * @see current_configuration + * @return any default return value + */ + global any GetDefaultReturn (map <string, string> params) { + LazyLoadCurrentConf(); + string q_type = params["q_type"]:nil; + + // <--- Installation Sources ---> + /* + * Parameters, $[ + * "q_type" : "inst-source", // mandatory + * "q_ident" : "Question Identification", // mandatory + * "q_url" : "URL" // optional + * ]; + */ + // <--- Installation Sources ---> + if (q_type == "inst-source") { + string q_ident = params["q_ident"]:nil; + string q_url = params["q_url"]:nil; + + if (current_configuration[q_type]:nil == nil + || current_configuration[q_type, q_ident]:nil == nil + || current_configuration[q_type, q_ident, q_url]:nil == nil + || current_configuration[q_type, q_ident, q_url, "return"]:nil == nil) { + return nil; + } + + return current_configuration[q_type, q_ident, q_url, "return"]:nil; + + // Add another types here... + } else { + y2error("'%1' is an unknown type", q_type); + return nil; + } + // <--- Installation Sources ---> + } + + /** + * Sets the default return value for the question that should not be shown + * + * @param map <string, string> of params + * @param any default return + * @see current_configuration + * @return boolean if success + */ + global boolean SetDefaultReturn (map <string, string> params, any default_return) { + LazyLoadCurrentConf(); + string q_type = params["q_type"]:nil; + // Always set to 'true' if the configuration is changed + boolean conf_changed = false; + + // <--- Installation Sources ---> + /* + * Parameters, $[ + * "q_type" : "inst-source", // mandatory + * "q_ident" : "Question Identification", // mandatory + * "q_url" : "URL" // optional + * ]; + */ + if (q_type == "inst-source") { + string q_ident = params["q_ident"]:nil; + string q_url = params["q_url"]:nil; + + if (q_ident == nil) { + y2error("'q_ident' is a mandatory parameter"); + return nil; + } + + // building the configuration map + if (current_configuration[q_type]:nil == nil) { + current_configuration[q_type] = $[]; + } + if (current_configuration[q_type, q_ident]:nil == nil) { + current_configuration[q_type, q_ident] = $[]; + } + if (current_configuration[q_type, q_ident, q_url]:nil == nil) { + current_configuration[q_type, q_ident, q_url] = $[]; + } + + // save the new value into the configuration + conf_changed = true; + current_configuration[q_type, q_ident, q_url, "return"] = default_return; + // <--- Installation Sources ---> + + // Add another types here... + } else { + y2error("'%1' is an unknown type", q_type); + return nil; + } + + if (conf_changed) return SaveCurrentConfiguration(); + else return nil; + } + + /** + * Returns the current configuration map + * + * @return map <string, map <string, map <string, any> > > with the current configuration + * @see current_configuration + */ + global map <string, map <string, map <string, any> > > GetCurrentConfigurationMap () { + LazyLoadCurrentConf(); + return current_configuration; + } + + /** + * Removes one entry defined with map params + * + * @param map <string, string> of params + * @see current_configuration + * @return boolean if success + */ + global boolean RemoveShowQuestionAgain (map <string, string> params) { + LazyLoadCurrentConf(); + string q_type = params["q_type"]:nil; + + if (q_type == "inst-source") { + string q_ident = params["q_ident"]:nil; + string q_url = params["q_url"]:nil; + + if (current_configuration[q_type]:nil != nil + && current_configuration[q_type, q_ident]:nil != nil + && current_configuration[q_type, q_ident, q_url]:nil != nil) { + + current_configuration[q_type, q_ident, q_url] = nil; + SaveCurrentConfiguration(); + } + + return (current_configuration[q_type]:nil != nil + && current_configuration[q_type, q_ident]:nil != nil + && current_configuration[q_type, q_ident, q_url]:nil != nil); + } else { + y2error("'%1' is an unknown type", q_type); + return false; + } + } +} 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-packager-2.13.120/src/modules/Packages.ycp new/yast2-packager-2.13.122/src/modules/Packages.ycp --- old/yast2-packager-2.13.120/src/modules/Packages.ycp 2006-05-25 17:42:43.000000000 +0200 +++ new/yast2-packager-2.13.122/src/modules/Packages.ycp 2006-05-30 16:12:59.000000000 +0200 @@ -3,7 +3,7 @@ * Package: Package selections * Authors: Anas Nashif <nashif@suse.de> * - * $Id: Packages.ycp 31125 2006-05-24 10:55:12Z jsrain $ + * $Id: Packages.ycp 31191 2006-05-30 14:12:50Z jsrain $ */ { @@ -483,6 +483,7 @@ string current_base_selection = base_selections[0]:""; if (current_base_selection != "") { + Reset ([`product]); Pkg::ClearSelection (current_base_selection); } Pkg::SetSelection (basename); 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-packager-2.13.120/src/modules/SignatureCheckCallbacks.ycp new/yast2-packager-2.13.122/src/modules/SignatureCheckCallbacks.ycp --- old/yast2-packager-2.13.120/src/modules/SignatureCheckCallbacks.ycp 2006-04-25 17:07:59.000000000 +0200 +++ new/yast2-packager-2.13.122/src/modules/SignatureCheckCallbacks.ycp 2006-05-30 09:22:17.000000000 +0200 @@ -31,11 +31,11 @@ string dont_show_dialog_ident = "-AcceptUnsignedFile-"; // Show the popup? - if (SignatureCheckDialogs::GetShowThisPopup(dont_show_dialog_ident)) { + if (SignatureCheckDialogs::GetShowThisPopup(dont_show_dialog_ident, filename)) { return SignatureCheckDialogs::UseUnsignedItem(`file, filename, dont_show_dialog_ident); // Return the default value entered by user } else { - return SignatureCheckDialogs::GetDefaultDialogReturn(dont_show_dialog_ident); + return SignatureCheckDialogs::GetDefaultDialogReturn(dont_show_dialog_ident, filename); } } @@ -53,11 +53,11 @@ string dont_show_dialog_ident = "-AcceptFileWithoutChecksum-"; // Show the popup? - if (SignatureCheckDialogs::GetShowThisPopup(dont_show_dialog_ident)) { + if (SignatureCheckDialogs::GetShowThisPopup(dont_show_dialog_ident, filename)) { return SignatureCheckDialogs::UseItemWithNoChecksum(`file, filename, dont_show_dialog_ident); // Return the default value entered by user } else { - return SignatureCheckDialogs::GetDefaultDialogReturn(dont_show_dialog_ident); + return SignatureCheckDialogs::GetDefaultDialogReturn(dont_show_dialog_ident, filename); } } @@ -75,12 +75,12 @@ string dont_show_dialog_ident = "-AcceptUnknownGpgKey-"; // Show the popup? - if (SignatureCheckDialogs::GetShowThisPopup(dont_show_dialog_ident)) { + if (SignatureCheckDialogs::GetShowThisPopup(dont_show_dialog_ident, filename)) { // Unknown keyname == "Unknown Key" return SignatureCheckDialogs::ItemSignedWithUnknownSignature(`file, filename, keyid, fingerprint, dont_show_dialog_ident); // Return the default value entered by user } else { - return SignatureCheckDialogs::GetDefaultDialogReturn(dont_show_dialog_ident); + return SignatureCheckDialogs::GetDefaultDialogReturn(dont_show_dialog_ident, filename); } } 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-packager-2.13.120/src/modules/SignatureCheckDialogs.ycp new/yast2-packager-2.13.122/src/modules/SignatureCheckDialogs.ycp --- old/yast2-packager-2.13.120/src/modules/SignatureCheckDialogs.ycp 2006-04-25 17:07:59.000000000 +0200 +++ new/yast2-packager-2.13.122/src/modules/SignatureCheckDialogs.ycp 2006-05-30 09:22:17.000000000 +0200 @@ -15,29 +15,34 @@ import "Label"; import "Popup"; import "Message"; + import "DontShowAgain"; /* --------------------------- Don't show this dialog again Magic --------------------------- */ - map <string, boolean> show_popup = $[]; - map <string, boolean> popup_ret = $[]; - /** * Functions sets whether user want's to show the dialog again * * @param string popup_type dialog type * @param boolean show again + * @param string popup_url */ - global void SetShowThisPopup (string popup_type, boolean show_it) { + global void SetShowThisPopup (string popup_type, boolean show_it, string popup_url) { if (popup_type == nil || show_it == nil) { y2error("Neither popup_type %1 nor show_it %2 can be nil!", popup_type, show_it); return; } + + // it's the default if (show_it) { y2debug("User decision to show dialog '%1' again is '%2'", popup_type, show_it); + // store only "don't show" } else { - y2milestone("User decision to show dialog '%1' again is '%2'", popup_type, show_it); + y2milestone("User decision to show dialog '%1' for '%2' again is '%3'", popup_type, popup_url, show_it); + // Show again -> false, so, store it + DontShowAgain::SetShowQuestionAgain($[ + "q_type" : "inst-source", "q_ident" : popup_type, "q_url" : popup_url + ], show_it); } - show_popup[popup_type] = show_it; } /** @@ -45,15 +50,26 @@ * true is the default if nothing is set. * * @param string popup_type dialog type + * @param string popup_url if any * @return boolean show the dialog */ - global boolean GetShowThisPopup (string popup_type) { + global boolean GetShowThisPopup (string popup_type, string popup_url) { if (popup_type == nil) { y2error("popup_type %1 mustn't be nil!", popup_type); return true; } - // default (if not defined) is 'true' - return show_popup[popup_type]:true; + + // Read the current configuration from system configuration + boolean stored = DontShowAgain::GetShowQuestionAgain($[ + "q_type" : "inst-source", "q_ident" : popup_type, "q_url" : popup_url + ]); + + // Stored in the configuration + if (stored != nil) + return stored; + // Unknown status, return default + else + return true; } /** @@ -63,14 +79,16 @@ * @param string popup_type dialog type * @param boolean default_return */ - global void SetDefaultDialogReturn (string popup_type, boolean default_return) { + global void SetDefaultDialogReturn (string popup_type, boolean default_return, string popup_url) { if (popup_type == nil || default_return == nil) { y2error("Neither popup_type %1 nor default_return %2 can be nil!", popup_type, default_return); return; } - y2milestone("User decision in default return for '%1' is '%2'", - popup_type, default_return); - popup_ret[popup_type] = default_return; + y2milestone("User decision in default return for '%1' for '%2' is '%3'", + popup_type, popup_url, default_return); + DontShowAgain::SetDefaultReturn($[ + "q_type" : "inst-source", "q_ident" : popup_type, "q_url" : popup_url, + ], default_return); } /** @@ -80,17 +98,22 @@ * @param string popup_type dialog type * @boolean boolean default dialog return */ - global boolean GetDefaultDialogReturn (string popup_type) { + global boolean GetDefaultDialogReturn (string popup_type, string popup_url) { if (popup_type == nil) { y2error("popup_type %1 mustn't be nil!", popup_type); return false; } + + boolean stored_return = (boolean) DontShowAgain::GetDefaultReturn($[ + "q_type" : "inst-source", "q_ident" : popup_type, "q_url" : popup_url, + ]); + y2milestone("User decided not to show popup for '%1' again, returning user-decision '%2'", - popup_type, popup_ret[popup_type]:false); - return popup_ret[popup_type]:false; + popup_type, stored_return); + return stored_return; } - void HandleDoNotShowDialogAgain (boolean default_return, string dont_show_dialog_ident, symbol dont_show_dialog_checkboxid) { + void HandleDoNotShowDialogAgain (boolean default_return, string dont_show_dialog_ident, symbol dont_show_dialog_checkboxid, string dont_show_url) { boolean dont_show_status = (boolean) UI::QueryWidget(`id(dont_show_dialog_checkboxid), `Value); // Widget doesn't exist if (dont_show_status == nil) { @@ -99,11 +122,11 @@ } else if (dont_show_status == true) { y2debug("User decision -- don't show the dialog %1 again, setting default return %2", dont_show_dialog_ident, default_return); - SetShowThisPopup(dont_show_dialog_ident, false); - SetDefaultDialogReturn(dont_show_dialog_ident, default_return); + SetShowThisPopup(dont_show_dialog_ident, false, dont_show_url); + SetDefaultDialogReturn(dont_show_dialog_ident, default_return, dont_show_url); // Checkbox not selected -> Show again } else { - SetShowThisPopup(dont_show_dialog_ident, true); + SetShowThisPopup(dont_show_dialog_ident, true, dont_show_url); } } @@ -302,7 +325,7 @@ `MarginBox(0.5, 0.5, `Label(description_text)), `Left(`MarginBox(0, 1.2, `CheckBox(`id(`dont_show_again), Message::DoNotShowMessageAgain(), - (GetShowThisPopup(dont_show_dialog_ident) ? false:true) + (GetShowThisPopup(dont_show_dialog_ident, item_name) ? false:true) ))), YesNoButtons(`no) ) @@ -313,7 +336,7 @@ if (ret == nil) ret = false; // Store the don't show value, store the default return value - HandleDoNotShowDialogAgain(ret, dont_show_dialog_ident, `dont_show_again); + HandleDoNotShowDialogAgain(ret, dont_show_dialog_ident, `dont_show_again, item_name); UI::CloseDialog(); return ret; @@ -359,7 +382,7 @@ `MarginBox(0.5, 0.5, `Label(description_text)), `Left(`MarginBox(0, 1.2, `CheckBox(`id(`dont_show_again), Message::DoNotShowMessageAgain(), - (GetShowThisPopup(dont_show_dialog_ident) ? false:true) + (GetShowThisPopup(dont_show_dialog_ident, item_name) ? false:true) ))), YesNoButtons(`no) ) @@ -370,7 +393,7 @@ if (ret == nil) ret = false; // Store the don't show value, store the default return value - HandleDoNotShowDialogAgain(ret, dont_show_dialog_ident, `dont_show_again); + HandleDoNotShowDialogAgain(ret, dont_show_dialog_ident, `dont_show_again, item_name); UI::CloseDialog(); return ret; @@ -494,7 +517,7 @@ `MarginBox(0.5, 0.5, `Label(description_text)), `Left(`MarginBox(0, 1.2, `CheckBox(`id(`dont_show_again), Message::DoNotShowMessageAgain(), - (GetShowThisPopup(dont_show_dialog_ident) ? false:true) + (GetShowThisPopup(dont_show_dialog_ident, item_name) ? false:true) ))), YesNoButtons(`no) ) @@ -508,7 +531,7 @@ if (ret == nil) ret = false; // Store the don't show value, store the default return value - HandleDoNotShowDialogAgain(ret, dont_show_dialog_ident, `dont_show_again); + HandleDoNotShowDialogAgain(ret, dont_show_dialog_ident, `dont_show_again, item_name); UI::CloseDialog(); return ret; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de