Hello community,
here is the log from the commit of package yast2-packager
checked in at Fri Sep 8 14:30:03 CEST 2006.
--------
--- yast2-packager/yast2-packager.changes 2006-09-04 16:15:31.000000000 +0200
+++ yast2-packager/yast2-packager.changes 2006-09-07 14:20:10.000000000 +0200
@@ -1,0 +2,12 @@
+Wed Sep 6 08:51:30 CEST 2006 - lslezak@suse.cz
+
+- print a warning in the installation proposal if there is
+ a partition with too low free space (#179953)
+- don't run the solver after selecting a Xen kernel, run it just
+ once when creating the proposal
+- evaluate the package selection only once in the installation
+ proposal, cache the software proposal and evaluate the package
+ selection only when it's necessary (feature #300709)
+- 2.13.148
+
+-------------------------------------------------------------------
Old:
----
yast2-packager-2.13.147.tar.bz2
New:
----
yast2-packager-2.13.148.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.AOL9W9/_old 2006-09-08 14:29:03.000000000 +0200
+++ /var/tmp/diff_new_pack.AOL9W9/_new 2006-09-08 14:29:03.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-packager (Version 2.13.147)
+# spec file for package yast2-packager (Version 2.13.148)
#
# 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.147
+Version: 2.13.148
Release: 1
License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-packager-2.13.147.tar.bz2
+Source0: yast2-packager-2.13.148.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-firewall yast2-installation yast2-slp yast2-testsuite yast2-xml
Requires: checkmedia yast2-country
@@ -47,7 +47,7 @@
Arvin Schnell
%prep
-%setup -n yast2-packager-2.13.147
+%setup -n yast2-packager-2.13.148
%build
%{prefix}/bin/y2tool y2autoconf
@@ -84,6 +84,15 @@
%doc %{prefix}/share/doc/packages/yast2-packager
%changelog -n yast2-packager
+* Wed Sep 06 2006 - lslezak@suse.cz
+- print a warning in the installation proposal if there is
+ a partition with too low free space (#179953)
+- don't run the solver after selecting a Xen kernel, run it just
+ once when creating the proposal
+- evaluate the package selection only once in the installation
+ proposal, cache the software proposal and evaluate the package
+ selection only when it's necessary (feature #300709)
+- 2.13.148
* Mon Sep 04 2006 - lslezak@suse.cz
- install all packages in the first stage if it's possible
(feature #3425, bugzilla #103800)
++++++ yast2-packager-2.13.147.tar.bz2 -> yast2-packager-2.13.148.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.147/VERSION new/yast2-packager-2.13.148/VERSION
--- old/yast2-packager-2.13.147/VERSION 2006-09-04 13:43:31.000000000 +0200
+++ new/yast2-packager-2.13.148/VERSION 2006-09-07 13:34:26.000000000 +0200
@@ -1 +1 @@
-2.13.147
+2.13.148
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.147/configure new/yast2-packager-2.13.148/configure
--- old/yast2-packager-2.13.147/configure 2006-09-04 15:50:22.000000000 +0200
+++ new/yast2-packager-2.13.148/configure 2006-09-07 13:34:36.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.147.
+# Generated by GNU Autoconf 2.59 for yast2-packager 2.13.148.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -269,8 +269,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-packager'
PACKAGE_TARNAME='yast2-packager'
-PACKAGE_VERSION='2.13.147'
-PACKAGE_STRING='yast2-packager 2.13.147'
+PACKAGE_VERSION='2.13.148'
+PACKAGE_STRING='yast2-packager 2.13.148'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
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.147 to adapt to many kinds of systems.
+\`configure' configures yast2-packager 2.13.148 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.147:";;
+ short | recursive ) echo "Configuration of yast2-packager 2.13.148:";;
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.147
+yast2-packager configure 2.13.148
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.147, which was
+It was created by yast2-packager $as_me 2.13.148, 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.147'
+ VERSION='2.13.148'
cat >>confdefs.h <<_ACEOF
@@ -1863,7 +1863,7 @@
-VERSION="2.13.147"
+VERSION="2.13.148"
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.147, which was
+This file was extended by yast2-packager $as_me 2.13.148, 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.147
+yast2-packager config.status 2.13.148
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.147/configure.in new/yast2-packager-2.13.148/configure.in
--- old/yast2-packager-2.13.147/configure.in 2006-09-04 15:50:16.000000000 +0200
+++ new/yast2-packager-2.13.148/configure.in 2006-09-07 13:34:31.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.13.22 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-packager, 2.13.147, http://bugs.opensuse.org/, yast2-packager)
+AC_INIT(yast2-packager, 2.13.148, 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.147"
+VERSION="2.13.148"
RPMNAME="yast2-packager"
MAINTAINER="Jiri Srain "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.147/src/clients/software_proposal.ycp new/yast2-packager-2.13.148/src/clients/software_proposal.ycp
--- old/yast2-packager-2.13.147/src/clients/software_proposal.ycp 2006-08-10 13:19:33.000000000 +0200
+++ new/yast2-packager-2.13.148/src/clients/software_proposal.ycp 2006-09-07 13:59:41.000000000 +0200
@@ -11,7 +11,6 @@
textdomain "packager";
import "Packages";
- import "Stage";
import "Storage";
import "Language";
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.147/src/clients/software_simple_proposal.ycp new/yast2-packager-2.13.148/src/clients/software_simple_proposal.ycp
--- old/yast2-packager-2.13.147/src/clients/software_simple_proposal.ycp 2006-06-29 08:48:07.000000000 +0200
+++ new/yast2-packager-2.13.148/src/clients/software_simple_proposal.ycp 2006-09-07 13:06:17.000000000 +0200
@@ -11,7 +11,6 @@
textdomain "packager";
import "Packages";
- import "Storage";
string func = (string) WFM::Args(0);
map param = (map) WFM::Args(1);
@@ -23,6 +22,7 @@
boolean language_changed = param["language_changed"]:false;
y2milestone("package proposal: force reset: %1, reinit: %2, language changed: %3", force_reset, false, language_changed );
+
ret = Packages::Proposal( false, // user decision: reset to default
false, // reinitialize due to language or partition change
true );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.147/src/modules/Packages.ycp new/yast2-packager-2.13.148/src/modules/Packages.ycp
--- old/yast2-packager-2.13.147/src/modules/Packages.ycp 2006-08-10 13:19:34.000000000 +0200
+++ new/yast2-packager-2.13.148/src/modules/Packages.ycp 2006-09-07 14:18:35.000000000 +0200
@@ -3,7 +3,7 @@
* Package: Package selections
* Authors: Anas Nashif
*
- * $Id: Packages.ycp 31963 2006-07-24 08:37:39Z jsrain $
+ * $Id: Packages.ycp 32763 2006-09-07 12:20:02Z lslezak $
*/
{
@@ -56,6 +56,14 @@
*/
string init_error = nil;
+// cache for the proposed summary
+map cached_proposal = nil;
+// the selection used for the cached proposal
+list<string> cached_proposal_packages = [];
+list<map> cached_proposal_patterns = [];
+list<map> cached_proposal_products = [];
+list<map> cached_proposal_patches = [];
+list<map> cached_proposal_selections = [];
global boolean install_sources = false; // Installing source packages ?
global integer timestamp = 0; // last time of getting the target map
@@ -191,7 +199,7 @@
if (contains (flags, `selection))
output = (list<string>)
merge (output, ListSelected (`selection, "+ %1"));
- if (contains (flags, `desktop))
+ if (contains (flags, `size))
output = (list<string>)add (output,
// part of summary, %1 is size of packages (in MB or GB)
sformat (_("Size of Packages to Install: %1"),
@@ -233,6 +241,7 @@
];
}
map ret = $[];
+
if (! CheckDiskSize (! use_cache))
{
ret = $[
@@ -244,6 +253,35 @@
"warning_level" : Mode::update() ? `warning : `blocker,
];
}
+ else
+ {
+ // check available free space (less than 5% and less than 1GB)
+ list<map> free_space = SpaceCalculation::CheckDiskFreeSpace(5, 1024*1024);
+
+ if (size(free_space) > 0)
+ {
+ string warning = "";
+
+ foreach(map df, free_space,
+ {
+ string partition = df["dir"]:"";
+ integer free_pct = df["free_percent"]:0;
+ integer free_kB = df["free_size"]:0;
+
+ string w = sformat(_("Only %1 (%2%%) free space available on partition %3.<BR>"), String::FormatSize(free_kB*1024), free_pct, partition);
+
+ warning = warning + w;
+ }
+ );
+
+ if (warning != "")
+ {
+ ret["warning"] = warning;
+ ret["warning_level"] = `warning;
+ }
+ }
+ }
+
ret["raw_proposal"] = SummaryOutput (flags);
return ret;
}
@@ -280,6 +318,7 @@
foreach (map res, restore, {
Pkg::ResolvableInstall (res["name"]:"", (symbol)(res["type"]:nil));
});
+
system_packages_selected = false;
}
@@ -1115,13 +1154,8 @@
if (xen_selected)
{
- // run the solver if a package is selected
- boolean run_solver = false;
-
if (contains (Kernel::GetPackages (), "kernel-bigsmp"))
{
- run_solver = !Pkg::IsSelected("kernel-xenpae");
-
y2milestone("Selected Xen kernel: kernel-xenpae");
// install PAE Xen
Pkg::PkgNeutral("kernel-xen");
@@ -1129,22 +1163,10 @@
}
else
{
- run_solver = !Pkg::IsSelected("kernel-xen");
-
- y2milestone("Selected Xen kernel: kernel-xen");
// install standard Xen
Pkg::PkgNeutral("kernel-xenpae");
Pkg::PkgInstall("kernel-xen");
}
-
- y2milestone("run_solver: %1", run_solver);
- if (run_solver)
- {
- if (! Pkg::PkgSolve(true))
- {
- solve_errors = Pkg::PkgSolveErrors ();
- }
- }
}
}
@@ -1155,6 +1177,44 @@
* @return map for the API proposal
*/
global map Proposal (boolean force_reset, boolean reinit, boolean simple) {
+
+ // if the cache is valid and reset or reinitialization is not required
+ // then the cached proposal can be used
+ if (cached_proposal != nil && force_reset == false && reinit == false)
+ {
+ // selected packages
+ list<string> selected_packages = Pkg::GetPackages(`selected, false);
+
+ // selected patterns
+ list<map> selected_patterns = filter(map p, Pkg::ResolvableProperties("", `pattern, ""), {return p["status"]:`unknown == `selected;});
+
+ // selected products
+ list<map> selected_products = filter(map p, Pkg::ResolvableProperties("", `product, ""), {return p["status"]:`unknown == `selected;});
+
+ // selected patches
+ list<map> selected_patches = filter(map p, Pkg::ResolvableProperties("", `patch, ""), {return p["status"]:`unknown == `selected;});
+
+ // selected selections
+ list<map> selected_selections = filter(map s, Pkg::ResolvableProperties("", `selection, ""), {return s["status"]:`unknown == `selected;});
+
+ // if the package selection has not been changed the cache is up to date
+ if (selected_packages == cached_proposal_packages && selected_patterns == cached_proposal_patterns
+ && selected_products == cached_proposal_products && selected_patches == cached_proposal_patches
+ && selected_selections == cached_proposal_selections)
+ {
+ y2milestone("using cached software proposal");
+ return cached_proposal;
+ }
+ else
+ {
+ y2milestone("invalid cache: the software selection has been chaged");
+ }
+ }
+ else
+ {
+ y2milestone("the cached proposal is empty or reset is required");
+ }
+
UI::OpenDialog(`opt(`decorated ),
// popup label
`Label (_("Evaluating package selection...")));
@@ -1209,18 +1269,28 @@
(symbol)ProductFeatures::GetFeature ("software", "selection_type"));
}
+ SelectXenKernel ();
+
if (! Pkg::PkgSolve (false))
{
solve_errors = Pkg::PkgSolveErrors ();
}
- SelectXenKernel ();
-
map ret = Summary (
[ `product, `pattern, `selection, `size, `desktop ],
false);
// TODO simple proposal
+ // cache the proposal
+ cached_proposal = ret;
+
+ // remember the status
+ cached_proposal_packages = Pkg::GetPackages(`selected, false);
+ cached_proposal_patterns = filter(map p, Pkg::ResolvableProperties("", `pattern, ""), {return p["status"]:`unknown == `selected;});
+ cached_proposal_products = filter(map p, Pkg::ResolvableProperties("", `product, ""), {return p["status"]:`unknown == `selected;});
+ cached_proposal_patches = filter(map p, Pkg::ResolvableProperties("", `patch, ""), {return p["status"]:`unknown == `selected;});
+ cached_proposal_selections = filter(map s, Pkg::ResolvableProperties("", `selection, ""), {return s["status"]:`unknown == `selected;});
+
UI::CloseDialog();
y2milestone ("Software proposal: %1", ret);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.13.147/src/modules/SpaceCalculation.ycp new/yast2-packager-2.13.148/src/modules/SpaceCalculation.ycp
--- old/yast2-packager-2.13.147/src/modules/SpaceCalculation.ycp 2006-09-04 13:44:23.000000000 +0200
+++ new/yast2-packager-2.13.148/src/modules/SpaceCalculation.ycp 2006-09-06 08:55:05.000000000 +0200
@@ -10,7 +10,7 @@
* on Installation::sourcedir
*
*
- * $Id: SpaceCalculation.ycp 31774 2006-07-10 14:14:59Z jsrain $
+ * $Id: SpaceCalculation.ycp 32715 2006-09-06 06:56:33Z lslezak $
*/
{
@@ -525,4 +525,51 @@
return fit;
};
+
+ /**
+ * Check, if there is enough free space after installing the current selection
+ * @param free_percent minimal free space after installation (in percent)
+ * @return list of partitions which have less than free_percent free size
+ */
+ global define list<map> CheckDiskFreeSpace(integer free_percent, integer max_unsufficient_free_size)
+ {
+ if ( !info_called )
+ {
+ SpaceCalculation::GetPartitionInfo();
+ }
+
+ y2milestone("min. free space: %1%%, max. unsufficient free space: %2", free_percent, max_unsufficient_free_size);
+
+ list<map> ret = [];
+
+ if (free_percent > 0)
+ {
+ //$[ "dir" : [ total, usednow, usedfuture ], .... ]
+ foreach (string dir, list sizelist, Pkg::TargetGetDU(),
+ {
+ y2milestone ("%1: %2", dir, sizelist);
+
+ integer total = sizelist[0]:0;
+ integer used_future = sizelist[2]:0;
+ integer current_free_size = (total - used_future);
+ integer current_free_percent = current_free_size*100/total;
+
+ if (current_free_size > 0)
+ {
+ if (current_free_percent < free_percent && current_free_size < max_unsufficient_free_size )
+ {
+ y2warning("Partition %1: less than %2%% free space (%3%%, %4)", dir, current_free_percent, free_percent, current_free_size);
+
+ ret = add(ret, $["dir":dir, "free_percent":current_free_percent, "free_size":current_free_size ]);
+ }
+ }
+ }
+ );
+ }
+
+ y2milestone("Result: %1", ret);
+
+ return ret;
+ };
}
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org