Author: lslezak
Date: Fri Jan 23 13:45:44 2009
New Revision: 54940
URL: http://svn.opensuse.org/viewcvs/yast?rev=54940&view=rev
Log:
- installation callbacks - collect installation data for the
summary dialog (bnc#431854)
- sw_single.ycp - do the action specified in PKGMGR_ACTION_AT_EXIT
sysconfig variable when package installation is finished
- 2.18.2
Modified:
trunk/packager/VERSION
trunk/packager/package/yast2-packager.changes
trunk/packager/src/clients/sw_single.ycp
trunk/packager/src/modules/AddOnProduct.ycp
trunk/packager/src/modules/PackageInstallation.ycp
trunk/packager/src/modules/PackageSlideShow.ycp
trunk/packager/src/modules/SlideShowCallbacks.ycp
trunk/packager/yast2-packager.spec.in
Modified: trunk/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=54940&r1=54939&r2=54940&view=diff
==============================================================================
--- trunk/packager/VERSION (original)
+++ trunk/packager/VERSION Fri Jan 23 13:45:44 2009
@@ -1 +1 @@
-2.18.1
+2.18.2
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=54940&r1=54939&r2=54940&view=diff
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Fri Jan 23 13:45:44 2009
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Thu Jan 22 18:47:00 CET 2009 - lslezak@suse.cz
+
+- installation callbacks - collect installation data for the
+ summary dialog (bnc#431854)
+- sw_single.ycp - do the action specified in PKGMGR_ACTION_AT_EXIT
+ sysconfig variable when package installation is finished
+- 2.18.2
+
+-------------------------------------------------------------------
Fri Jan 16 15:35:18 CET 2009 - lslezak@suse.cz
- checkmedia - better module description (bnc#461985)
Modified: trunk/packager/src/clients/sw_single.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/sw_single.ycp?rev=54940&r1=54939&r2=54940&view=diff
==============================================================================
--- trunk/packager/src/clients/sw_single.ycp (original)
+++ trunk/packager/src/clients/sw_single.ycp Fri Jan 23 13:45:44 2009
@@ -19,7 +19,6 @@
{
textdomain "packager";
- import "Arch";
import "Confirm";
import "Installation";
import "Mode";
@@ -32,13 +31,14 @@
import "Wizard";
import "Popup";
import "GetInstArgs";
- import "Label";
import "PackageSystem";
import "Report";
import "FileUtils";
import "PackagesUI";
import "CommandLine";
import "Progress";
+ import "Directory";
+ import "String";
symbol StartSWSingle()
{
@@ -555,8 +555,57 @@
// prepare "you must boot" popup in inst_suseconfig
Kernel::SetInformAboutKernelChange (oldvmlinuzsize != newvmlinuzsize);
+ string suseconfig_log = Directory::logdir + "/y2log.SuSEconfig";
+ integer suseconfig_log_size = FileUtils::GetSize(suseconfig_log);
+
+ if (suseconfig_log_size < 0)
+ {
+ suseconfig_log_size = 0;
+ }
+
result = (symbol) WFM::CallFunction ("inst_suseconfig", [GetInstArgs::Buttons(false, false)]);
+
+ // read only the new lines at the end
+ string command = sformat("dd bs=1 if='%1' skip=%2", String::Quote(suseconfig_log), suseconfig_log_size);
+ y2milestone("Reading new susconfig log: %1", command);
+
+ map out = (map)SCR::Execute(.target.bash_output, command);
+ if (out["exit"]:-1 == 0)
+ {
+ PackagesUI::SetPackageSummaryItem("postinstall_log", out["stdout"]:"");
+ }
+ else
+ {
+ y2error("Could not read susconfig log: %1", out);
+ }
}
+
+ if (Mode::normal())
+ {
+ string PKGMGR_ACTION_AT_EXIT = (string)SCR::Read(.sysconfig.yast2.PKGMGR_ACTION_AT_EXIT);
+
+ if (PKGMGR_ACTION_AT_EXIT == nil)
+ {
+ PKGMGR_ACTION_AT_EXIT = "close";
+ }
+
+ y2milestone("PKGMGR_ACTION_AT_EXIT: %1", PKGMGR_ACTION_AT_EXIT);
+
+ // display installation summary if there has been an error
+ // or if it's enabled in sysconfig
+ if (PKGMGR_ACTION_AT_EXIT == "summary"
+ || size(commit_result[1]:[]) > 0)
+ {
+ if (PackagesUI::ShowInstallationSummary() == `back)
+ {
+ force_restart = true;
+ }
+ }
+ else if (PKGMGR_ACTION_AT_EXIT == "restart")
+ {
+ force_restart = true;
+ }
+ }
}
} while ( force_restart );
Modified: trunk/packager/src/modules/AddOnProduct.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/AddOnProduct.ycp?rev=54940&r1=54939&r2=54940&view=diff
==============================================================================
--- trunk/packager/src/modules/AddOnProduct.ycp (original)
+++ trunk/packager/src/modules/AddOnProduct.ycp Fri Jan 23 13:45:44 2009
@@ -1077,7 +1077,8 @@
),
`HBox (
`HStretch(),
- `PushButton (`id (`ok), _("Add Selected Products")),
+ // push button label
+ `PushButton (`id (`ok), _("Add Selected &Products")),
`HSpacing (1),
`PushButton (`id (`cancel), Label::CancelButton())
)
Modified: trunk/packager/src/modules/PackageInstallation.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/PackageInstallation.ycp?rev=54940&r1=54939&r2=54940&view=diff
==============================================================================
--- trunk/packager/src/modules/PackageInstallation.ycp (original)
+++ trunk/packager/src/modules/PackageInstallation.ycp Fri Jan 23 13:45:44 2009
@@ -17,6 +17,7 @@
import "Packages";
import "SlideShow";
import "PackageSlideShow";
+ import "PackagesUI";
import "Label";
@@ -132,6 +133,8 @@
do_commit = size (pkgs) > 0;
}
+ integer start_time = time();
+
list commit_result = [];
if (do_commit)
{
@@ -152,6 +155,9 @@
y2milestone ("No package from media %1 left for installation", media_number);
}
+ integer installation_time = time() - start_time;
+ y2milestone("Installation took %1 seconds", installation_time);
+
// see if installation of some packages failed
list<string> errpacks = (list<string>) (commit_result[1]:[]);
if (size (errpacks) > 0)
@@ -170,6 +176,25 @@
merge (old_failed_packs, errpacks));
}
+ if (Mode::normal())
+ {
+ // collect and set installation summary data
+ map total_sizes_per_cd_per_src = []; // total sizes per inst-src: [ [42, 43, 44], [12, 13, 14] ]
global list
remaining_sizes_per_cd_per_src = []; // remaining sizes
@@ -47,6 +48,57 @@
string provide_size = ""; // currently downlaoded package size
+ // package summary
+ // package counters
+ integer installed_packages = 0;
+ integer updated_packages = 0;
+ integer removed_packages = 0;
+
+ integer total_downloaded = 0;
+ integer total_installed = 0;
+
+ // package list (only used in installed system)
+ list<string> installed_packages_list = [];
+ list<string> updated_packages_list = [];
+ list<string> removed_packages_list = [];
+// integer avg_download_rate = 0;
+
+ integer current_provide_size = 0;
+ integer current_install_size = 0;
+ string current_pkg_name = "";
+ boolean updating = false;
+
+ void ResetPackageSummary()
+ {
+ installed_packages = 0;
+ updated_packages = 0;
+ removed_packages = 0;
+ total_downloaded = 0;
+ total_installed = 0;
+// avg_download_rate = 0;
+
+ // temporary values
+ current_provide_size = 0;
+ current_install_size = 0;
+ current_pkg_name = "";
+ updating = false;
+ }
+
+ global map
) eval (total_pkg_count_per_cd_per_src);
total_cd_count = size( flatten( total_sizes_per_cd_per_src ) );
init_pkg_data_complete = true;
-
- y2milestone( "SlideShow::InitPkgData() done; total_sizes_per_cd_per_src: %1", total_sizes_per_cd_per_src );
- y2milestone( "SlideShow::InitPkgData(): pkg: %1", total_pkg_count_per_cd_per_src );
+
+ // reset the history log
+ SlideShow::inst_log = "";
+
+ y2milestone( "PackageSlideShow::InitPkgData() done; total_sizes_per_cd_per_src: %1", total_sizes_per_cd_per_src );
+ y2milestone( "PackageSlideShow::InitPkgData(): pkg: %1", total_pkg_count_per_cd_per_src );
// RebuildDialog(true);
}
@@ -839,7 +860,7 @@
if ( unit_is_seconds && bytes_per_second > 0 )
{
remaining = remaining / bytes_per_second;
- rem_time = FormatTime( remaining ); // column #2
+ rem_time = String::FormatTime( remaining ); // column #2
if ( remaining > max_time_per_cd ) // clip off at 2 hours
{
@@ -887,6 +908,8 @@
// update the download rate
global void UpdateCurrentPackageRateProgress(integer pkg_percent, integer bps_avg, integer bps_current)
{
+// avg_download_rate = bps_avg;
+
if( ! SlideShow::ShowingDetails() ) return;
string new_text = nil; // no update of the label
@@ -904,6 +927,13 @@
SlideShow::SubProgress( pkg_percent, new_text );
}
+ global void DoneProvide( integer error, string reason, string name )
+ {
+ if (error == 0)
+ {
+ total_downloaded = total_downloaded + current_provide_size;
+ }
+ }
/**
* Update progress widgets for all CDs.
@@ -959,8 +989,37 @@
UpdateTotalProgress(false);
+ if (updating)
+ {
+ updated_packages = updated_packages + 1;
+
+ if (Mode::normal())
+ {
+ updated_packages_list = add(updated_packages_list, current_pkg_name);
+ }
+ }
+ else
+ {
+ installed_packages = installed_packages + 1;
+
+ if (Mode::normal())
+ {
+ installed_packages_list = add(installed_packages_list, current_pkg_name);
+ }
+ }
+
+ total_installed = total_installed + current_install_size;
+
} // ! deleting
+ else
+ {
+ removed_packages = removed_packages + 1;
+ if (Mode::normal())
+ {
+ removed_packages_list = add(removed_packages_list, current_pkg_name);
+ }
+ }
}
@@ -1013,12 +1072,17 @@
// Heading for the progress bar for the current package
// while it is deleted. "%1" is the package name.
msg = sformat( _("Deleting %1"), pkg_name );
+ current_pkg_name = pkg_name;
}
else
{
+ updating = Pkg::PkgInstalled(current_pkg_name);
+
// package installation - summary text
// %1 is RPM name, %2 is installed (unpacked) size (e.g. 6.20MB)
msg = sformat( _("Installing %1 (installed size %2)"), pkg_name, String::FormatSize( pkg_size ) );
+
+ current_install_size = pkg_size;
}
@@ -1102,10 +1166,16 @@
*/
global void SlideProvideStart (string pkg_name, integer sz, boolean remote)
{
- // message in the installatino log, %1 is package name,
- // %2 is package size
- SlideGenericProvideStart (pkg_name, sz, _("Downloading %1 (download size %2)"),
- remote);
+ current_provide_size = remote ? sz : 0;
+ current_pkg_name = pkg_name;
+
+ if (remote)
+ {
+ // message in the installatino log, %1 is package name,
+ // %2 is package size
+ SlideGenericProvideStart (pkg_name, sz, _("Downloading %1 (download size %2)"),
+ remote);
+ }
}
Modified: trunk/packager/src/modules/SlideShowCallbacks.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SlideShowCallbacks.ycp?rev=54940&r1=54939&r2=54940&view=diff
==============================================================================
--- trunk/packager/src/modules/SlideShowCallbacks.ycp (original)
+++ trunk/packager/src/modules/SlideShowCallbacks.ycp Fri Jan 23 13:45:44 2009
@@ -80,12 +80,9 @@
global void StartProvide( string name, integer archivesize, boolean remote )
{
pkg_inprogress = name;
+ _remote_provide = remote;
- if ( remote )
- {
- PackageSlideShow::SlideProvideStart (name , archivesize, remote);
- _remote_provide = true;
- }
+ PackageSlideShow::SlideProvideStart (name , archivesize, remote);
}
@@ -119,6 +116,7 @@
if ( _remote_provide )
{
PackageSlideShow::UpdateCurrentPackageProgress( 100 );
+ PackageSlideShow::DoneProvide( error, reason, name );
_remote_provide = false;
}
if (SlideShow::GetUserAbort())
@@ -534,8 +532,7 @@
}
/**
- * Install callbacks for slideshow. Should be in SlideShowCallbacks but
- * that doesn't work at the moment.
+ * Install callbacks for slideshow.
*/
global void InstallSlideShowCallbacks()
{
Modified: trunk/packager/yast2-packager.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/yast2-packager.spec.in?rev=54940&r1=54939&r2=54940&view=diff
==============================================================================
--- trunk/packager/yast2-packager.spec.in (original)
+++ trunk/packager/yast2-packager.spec.in Fri Jan 23 13:45:44 2009
@@ -7,8 +7,8 @@
# HTTP.ycp
BuildRequires: yast2-transfer
-# URL::HidePassword()
-BuildRequires: yast2 >= 2.17.47
+# Installation summary in PackagesUI::
+BuildRequires: yast2 >= 2.18.1
# "keeppackages" repo property
BuildRequires: yast2-pkg-bindings >= 2.17.27
@@ -19,8 +19,8 @@
# "keeppackages" repo property
Requires: yast2-pkg-bindings >= 2.17.27
-# URL::HidePassword()
-Requires: yast2 >= 2.17.47
+# Installation summary in PackagesUI::
+Requires: yast2 >= 2.18.1
# unzipping license file
Requires: unzip
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org