Hello community,
here is the log from the commit of package yast2-pkg-bindings
checked in at Wed Dec 3 16:44:01 CET 2008.
--------
--- yast2-pkg-bindings/yast2-pkg-bindings.changes 2008-11-27 11:04:26.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-pkg-bindings/yast2-pkg-bindings.changes 2008-12-03 13:43:26.913268000 +0100
@@ -1,0 +2,8 @@
+Wed Dec 3 10:18:16 CET 2008 - lslezak@suse.cz
+
+- added Pkg::Solve() function which allows to set
+ ignoreAlreadyRecommended solver flag so Yast does not install
+ extra packages (bnc#445476)
+- 2.17.30
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-pkg-bindings-2.17.29.tar.bz2
New:
----
yast2-pkg-bindings-2.17.30.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-pkg-bindings-devel-doc.spec ++++++
--- /var/tmp/diff_new_pack.N22069/_old 2008-12-03 16:43:48.000000000 +0100
+++ /var/tmp/diff_new_pack.N22069/_new 2008-12-03 16:43:48.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-pkg-bindings-devel-doc (Version 2.17.29)
+# spec file for package yast2-pkg-bindings-devel-doc (Version 2.17.30)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-pkg-bindings-devel-doc
-Version: 2.17.29
+Version: 2.17.30
Release: 1
License: GPL v2 or later
Group: Documentation/HTML
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-pkg-bindings-2.17.29.tar.bz2
+Source0: yast2-pkg-bindings-2.17.30.tar.bz2
Prefix: %_prefix
# same as in the main package (because we use the same configure.in.in)
BuildRequires: blocxx-devel docbook-xsl-stylesheets doxygen gcc-c++ libgcrypt-devel libxcrypt-devel libxslt libzypp-devel perl-XML-Writer sgml-skel yast2-core-devel yast2-devtools
@@ -45,7 +45,7 @@
Ladislav Slez�k
%prep
-%setup -n yast2-pkg-bindings-2.17.29
+%setup -n yast2-pkg-bindings-2.17.30
# build only documentation, ignore all other directories
echo "doc" > SUBDIRS
++++++ yast2-pkg-bindings.spec ++++++
--- /var/tmp/diff_new_pack.N22069/_old 2008-12-03 16:43:48.000000000 +0100
+++ /var/tmp/diff_new_pack.N22069/_new 2008-12-03 16:43:48.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-pkg-bindings (Version 2.17.29)
+# spec file for package yast2-pkg-bindings (Version 2.17.30)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-pkg-bindings
-Version: 2.17.29
+Version: 2.17.30
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-pkg-bindings-2.17.29.tar.bz2
+Source0: yast2-pkg-bindings-2.17.30.tar.bz2
Prefix: /usr
BuildRequires: blocxx-devel docbook-xsl-stylesheets doxygen gcc-c++ libgcrypt-devel libxcrypt-devel libxslt perl-XML-Writer sgml-skel yast2-core-devel yast2-devtools
BuildRequires: libzypp-devel >= 5.10.0
@@ -47,7 +47,7 @@
Stanislav Visnovsky
%prep
-%setup -n yast2-pkg-bindings-2.17.29
+%setup -n yast2-pkg-bindings-2.17.30
# build only the library, ignore documentation (it is in devel-doc package)
echo "src" > SUBDIRS
@@ -79,6 +79,11 @@
%{_libdir}/YaST2/plugin/libpy2Pkg.so
%doc %{prefix}/share/doc/packages/yast2-pkg-bindings
%changelog
+* Wed Dec 03 2008 lslezak@suse.cz
+- added Pkg::Solve() function which allows to set
+ ignoreAlreadyRecommended solver flag so Yast does not install
+ extra packages (bnc#445476)
+- 2.17.30
* Thu Nov 27 2008 lslezak@suse.cz
- honor the download area when downloading signed/digested files
(do not download the files to the RAM disk during installation),
++++++ yast2-pkg-bindings-2.17.29.tar.bz2 -> yast2-pkg-bindings-2.17.30.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.29/configure new/yast2-pkg-bindings-2.17.30/configure
--- old/yast2-pkg-bindings-2.17.29/configure 2008-11-27 11:02:58.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.30/configure 2008-12-03 13:40:55.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for yast2-pkg-bindings 2.17.29.
+# Generated by GNU Autoconf 2.63 for yast2-pkg-bindings 2.17.30.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -745,8 +745,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-pkg-bindings'
PACKAGE_TARNAME='yast2-pkg-bindings'
-PACKAGE_VERSION='2.17.29'
-PACKAGE_STRING='yast2-pkg-bindings 2.17.29'
+PACKAGE_VERSION='2.17.30'
+PACKAGE_STRING='yast2-pkg-bindings 2.17.30'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1536,7 +1536,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-pkg-bindings 2.17.29 to adapt to many kinds of systems.
+\`configure' configures yast2-pkg-bindings 2.17.30 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1608,7 +1608,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-pkg-bindings 2.17.29:";;
+ short | recursive ) echo "Configuration of yast2-pkg-bindings 2.17.30:";;
esac
cat <<\_ACEOF
@@ -1720,7 +1720,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-pkg-bindings configure 2.17.29
+yast2-pkg-bindings configure 2.17.30
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1734,7 +1734,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-pkg-bindings $as_me 2.17.29, which was
+It was created by yast2-pkg-bindings $as_me 2.17.30, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2581,7 +2581,7 @@
# Define the identity of the package.
PACKAGE='yast2-pkg-bindings'
- VERSION='2.17.29'
+ VERSION='2.17.30'
cat >>confdefs.h <<_ACEOF
@@ -2805,7 +2805,7 @@
-VERSION="2.17.29"
+VERSION="2.17.30"
RPMNAME="yast2-pkg-bindings"
MAINTAINER="Ladislav Slezák "
@@ -17209,7 +17209,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-pkg-bindings $as_me 2.17.29, which was
+This file was extended by yast2-pkg-bindings $as_me 2.17.30, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17272,7 +17272,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-yast2-pkg-bindings config.status 2.17.29
+yast2-pkg-bindings config.status 2.17.30
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.29/configure.in new/yast2-pkg-bindings-2.17.30/configure.in
--- old/yast2-pkg-bindings-2.17.29/configure.in 2008-11-27 11:02:43.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.30/configure.in 2008-12-03 13:40:41.000000000 +0100
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.17.6 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-pkg-bindings, 2.17.29, http://bugs.opensuse.org/, yast2-pkg-bindings)
+AC_INIT(yast2-pkg-bindings, 2.17.30, http://bugs.opensuse.org/, yast2-pkg-bindings)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.17.29"
+VERSION="2.17.30"
RPMNAME="yast2-pkg-bindings"
MAINTAINER="Ladislav Slezák "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.29/src/Callbacks.cc new/yast2-pkg-bindings-2.17.30/src/Callbacks.cc
--- old/yast2-pkg-bindings-2.17.29/src/Callbacks.cc 2008-10-15 10:43:43.000000000 +0200
+++ new/yast2-pkg-bindings-2.17.30/src/Callbacks.cc 2008-11-28 17:31:24.000000000 +0100
@@ -457,8 +457,7 @@
virtual void start(const zypp::ProgressData &task)
{
CB callback( ycpcb( YCPCallbacks::CB_ProgressStart ) );
- // TODO: change it to y2debug later
- y2milestone("ProgressStart: id:%d, %s", task.numericId(), task.name().c_str());
+ y2debug("ProgressStart: id:%d, %s", task.numericId(), task.name().c_str());
if (callback._set)
{
@@ -477,8 +476,7 @@
virtual bool progress(const zypp::ProgressData &task)
{
CB callback( ycpcb( YCPCallbacks::CB_ProgressProgress ) );
- // TODO: change it to y2debug later
- y2milestone("ProgressProgress: id:%d, %s: %lld%%", task.numericId(), task.name().c_str(), task.reportValue());
+ y2debug("ProgressProgress: id:%d, %s: %lld%%", task.numericId(), task.name().c_str(), task.reportValue());
if (callback._set)
{
@@ -494,8 +492,7 @@
virtual void finish( const zypp::ProgressData &task )
{
CB callback( ycpcb( YCPCallbacks::CB_ProgressDone ) );
- // TODO: change it to y2debug later
- y2milestone("ProgressFinish: id:%d, %s", task.numericId(), task.name().c_str());
+ y2debug("ProgressFinish: id:%d, %s", task.numericId(), task.name().c_str());
if (callback._set)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.29/src/Package.cc new/yast2-pkg-bindings-2.17.30/src/Package.cc
--- old/yast2-pkg-bindings-2.17.29/src/Package.cc 2008-11-26 15:43:03.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.30/src/Package.cc 2008-12-03 13:38:09.000000000 +0100
@@ -1872,6 +1872,31 @@
return YCPBoolean (false);
}
+void SaveProblemList(const zypp::ResolverProblemList &problems, const std::string &filename)
+{
+ try
+ {
+ int problem_size = problems.size();
+
+ if (problem_size > 0)
+ {
+ y2error ("PkgSolve: %d packages failed (see %s)", problem_size, filename.c_str());
+
+ std::ofstream out (filename.c_str());
+
+ out << problem_size << " packages failed" << std::endl;
+ for(zypp::ResolverProblemList::const_iterator p = problems.begin();
+ p != problems.end(); ++p )
+ {
+ out << (*p)->description() << std::endl;
+ }
+ }
+ }
+ catch (...)
+ {
+ }
+}
+
/**
@builtin PkgSolve
@@ -1884,59 +1909,99 @@
YCPBoolean
PkgFunctions::PkgSolve (const YCPBoolean& filter)
{
+ return Solve(YCPMap());
+}
+
+/**
+ @builtin Solve
+ @short Solve current package dependencies
+ @param map params solver options, currently accepted $[
+ "ignoreAlreadyRecommended" : boolean, (do not select recommended packages for already installed packages)
+ "onlyRequires" : boolean, (do not select recommended packages, recommended language packages, modalias packages...)
+ ] If no option is provided the function behaves like Pkg::PkgSolve() function.
+ @return boolean true on success, on an failure the dependency problems are saved to /var/log/YaST2/badlist file
+*/
+
+YCPBoolean
+PkgFunctions::Solve (const YCPMap& params)
+{
bool result = false;
+ // the original value
+ bool ignoreAlreadyRecommended = false;
+ // changed flag
+ bool ignoreAlreadyRecommended_set = false;
+ YCPString ignore_key("ignoreAlreadyRecommended");
+
+ if (!params.isNull() && !params->value(ignore_key).isNull() && params->value(ignore_key)->isBoolean())
+ {
+ ignoreAlreadyRecommended = zypp_ptr()->resolver()->ignoreAlreadyRecommended();
+ bool ignoreAlreadyRecommended_new = params->value(ignore_key)->asBoolean()->value();
+
+ if (ignoreAlreadyRecommended != ignoreAlreadyRecommended_new)
+ {
+ y2milestone("Setting solver flag ignoreAlreadyRecommended: %d", ignoreAlreadyRecommended_new);
+ // set the new value
+ zypp_ptr()->resolver()->setIgnoreAlreadyRecommended(ignoreAlreadyRecommended_new);
+ ignoreAlreadyRecommended_set = true;
+ }
+ }
+
+ // the original value
+ bool onlyRequires = false;
+ // changed flag
+ bool onlyRequires_set = false;
+ YCPString requires_key("onlyRequires");
+
+ if (!params.isNull() && !params->value(requires_key).isNull() && params->value(requires_key)->isBoolean())
+ {
+ onlyRequires = zypp_ptr()->resolver()->onlyRequires();
+ bool onlyRequires_new = params->value(requires_key)->asBoolean()->value();
+
+ if (onlyRequires != onlyRequires_new)
+ {
+ y2milestone("Setting solver flag onlyRequires: %d", onlyRequires_new);
+ // set the new value
+ zypp_ptr()->resolver()->setOnlyRequires(onlyRequires_new);
+ onlyRequires_set = true;
+ }
+ }
+
try
{
result = zypp_ptr()->resolver()->resolvePool();
}
catch (const zypp::Exception& excpt)
{
- y2error("An error occurred during Pkg::PkgSolve.");
+ y2error("An error occurred during Pkg::Solve.");
_last_error.setLastError(excpt.asUserString(), "See /var/log/YaST2/badlist for more information.");
+ result = false;
}
// save information about failed dependencies to file
if (!result)
{
-# warning PkgSolve: filter option is not used
-/* bool filter_conflicts_with_installed = false;
-
- if (! filter.isNull())
- {
- filter_conflicts_with_installed = filter->value();
- }
-*/
-
- try
- {
- zypp::ResolverProblemList problems = zypp_ptr()->resolver()->problems();
- int problem_size = problems.size();
-
- if (problem_size > 0)
- {
- y2error ("PkgSolve: %d packages failed (see /var/log/YaST2/badlist)", problem_size);
+ zypp::ResolverProblemList problems = zypp_ptr()->resolver()->problems();
+ SaveProblemList(problems, "/var/log/YaST2/badlist");
+ }
- std::ofstream out ("/var/log/YaST2/badlist");
+ // set the original flags back if they were changed
+ if (onlyRequires_set)
+ {
+ y2milestone("Restoring solver flag onlyRequires: %d", onlyRequires);
+ zypp_ptr()->resolver()->setOnlyRequires(onlyRequires);
+ }
- out << problem_size << " packages failed" << std::endl;
- for(zypp::ResolverProblemList::const_iterator p = problems.begin();
- p != problems.end(); ++p )
- {
- out << (*p)->description() << std::endl;
- }
- }
- }
- catch (...)
- {
- return YCPBoolean(false);
- }
+ if (ignoreAlreadyRecommended_set)
+ {
+ y2milestone("Restoring solver flag ignoreAlreadyRecommended: %d", ignoreAlreadyRecommended);
+ zypp_ptr()->resolver()->setIgnoreAlreadyRecommended(ignoreAlreadyRecommended);
}
+
return YCPBoolean(result);
}
-
/**
@builtin PkgEstablish
@short establish the pool state - obsoleted, not needed
@@ -1983,9 +2048,8 @@
@short Solve packages currently installed on target system.
@description
- Solve packages currently installed on target system. Packages status
- remains unchanged, i.e. does not select/deselect any packages to
- resolve failed dependencies.
+ Solve packages currently installed on target system.
+ All transactions are reset after the call!
@return boolean
*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.29/src/PkgFunctions.h new/yast2-pkg-bindings-2.17.30/src/PkgFunctions.h
--- old/yast2-pkg-bindings-2.17.29/src/PkgFunctions.h 2008-11-27 10:27:00.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.30/src/PkgFunctions.h 2008-12-02 14:57:56.000000000 +0100
@@ -685,6 +685,8 @@
YCPValue PkgApplReset ();
/* TYPEINFO: boolean(boolean)*/
YCPBoolean PkgSolve (const YCPBoolean& filter);
+ /* TYPEINFO: boolean(map)*/
+ YCPBoolean Solve(const YCPMap& params);
/* TYPEINFO: boolean(string)*/
YCPValue CreateSolverTestCase(const YCPString &dir);
/* TYPEINFO: boolean()*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.29/VERSION new/yast2-pkg-bindings-2.17.30/VERSION
--- old/yast2-pkg-bindings-2.17.29/VERSION 2008-11-27 10:56:00.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.30/VERSION 2008-12-03 10:17:41.000000000 +0100
@@ -1 +1 @@
-2.17.29
+2.17.30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org