Hello community,
here is the log from the commit of package yast2-pkg-bindings
checked in at Mon Nov 13 15:02:23 CET 2006.
--------
--- yast2-pkg-bindings/yast2-pkg-bindings.changes 2006-11-09 10:12:01.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-pkg-bindings/yast2-pkg-bindings.changes 2006-11-13 14:52:05.000000000 +0100
@@ -1,0 +2,23 @@
+Mon Nov 13 14:21:30 CET 2006 - lslezak@suse.cz
+
+- disable refresh of all sources in the target during update
+ (workaround for #220056)
+- 2.14.0
+
+-------------------------------------------------------------------
+Mon Nov 13 10:00:27 CET 2006 - lslezak@suse.cz
+
+- fixed Pkg::DoRemoveAllKind() - uninstall only the installed
+ resolvables
+
+-------------------------------------------------------------------
+Mon Nov 13 09:40:00 CET 2006 - lslezak@suse.cz
+
+- added Pkg::SourceCreateType() builtin (#168358)
+
+-------------------------------------------------------------------
+Mon Nov 13 09:38:37 CET 2006 - lslezak@suse.cz
+
+- added Pkg::TargetStoreRemove() builtin (#210552)
+
+-------------------------------------------------------------------
Old:
----
yast2-pkg-bindings-2.13.105.tar.bz2
New:
----
yast2-pkg-bindings-2.14.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-pkg-bindings.spec ++++++
--- /var/tmp/diff_new_pack.wkoGRc/_old 2006-11-13 15:00:09.000000000 +0100
+++ /var/tmp/diff_new_pack.wkoGRc/_new 2006-11-13 15:00:09.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-pkg-bindings (Version 2.13.105)
+# spec file for package yast2-pkg-bindings (Version 2.14.0)
#
# 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-pkg-bindings
-Version: 2.13.105
+Version: 2.14.0
Release: 1
License: GNU General Public License (GPL) - all versions
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-pkg-bindings-2.13.105.tar.bz2
+Source0: yast2-pkg-bindings-2.14.0.tar.bz2
prefix: /usr
BuildRequires: blocxx-devel boost boost-devel dbus-1-devel docbook-xsl-stylesheets doxygen gcc-c++ hal-devel libgcrypt-devel libxcrypt-devel libxslt perl-XML-Writer rpm-devel sgml-skel yast2-core-devel yast2-devtools
BuildRequires: libzypp-devel >= 2.4.0
@@ -40,7 +40,7 @@
Stanislav Visnovsky
%prep
-%setup -n yast2-pkg-bindings-2.13.105
+%setup -n yast2-pkg-bindings-2.14.0
%build
%{prefix}/bin/y2tool y2autoconf
@@ -71,6 +71,17 @@
%doc %{prefix}/share/doc/packages/yast2-pkg-bindings
%changelog -n yast2-pkg-bindings
+* Mon Nov 13 2006 - lslezak@suse.cz
+- disable refresh of all sources in the target during update
+ (workaround for #220056)
+- 2.14.0
+* Mon Nov 13 2006 - lslezak@suse.cz
+- fixed Pkg::DoRemoveAllKind() - uninstall only the installed
+ resolvables
+* Mon Nov 13 2006 - lslezak@suse.cz
+- added Pkg::SourceCreateType() builtin (#168358)
+* Mon Nov 13 2006 - lslezak@suse.cz
+- added Pkg::TargetStoreRemove() builtin (#210552)
* Thu Nov 09 2006 - lslezak@suse.cz
- decreased the timout of acquiring the zypp lock to 15 seconds
(#216615)
++++++ yast2-pkg-bindings-2.13.105.tar.bz2 -> yast2-pkg-bindings-2.14.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.13.105/VERSION new/yast2-pkg-bindings-2.14.0/VERSION
--- old/yast2-pkg-bindings-2.13.105/VERSION 2006-11-09 10:06:14.000000000 +0100
+++ new/yast2-pkg-bindings-2.14.0/VERSION 2006-11-13 09:50:09.000000000 +0100
@@ -1 +1 @@
-2.13.105
+2.14.0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.13.105/configure new/yast2-pkg-bindings-2.14.0/configure
--- old/yast2-pkg-bindings-2.13.105/configure 2006-11-09 10:11:04.000000000 +0100
+++ new/yast2-pkg-bindings-2.14.0/configure 2006-11-13 14:49:24.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for yast2-pkg-bindings 2.13.105.
+# Generated by GNU Autoconf 2.60 for yast2-pkg-bindings 2.14.0.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -713,8 +713,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-pkg-bindings'
PACKAGE_TARNAME='yast2-pkg-bindings'
-PACKAGE_VERSION='2.13.105'
-PACKAGE_STRING='yast2-pkg-bindings 2.13.105'
+PACKAGE_VERSION='2.14.0'
+PACKAGE_STRING='yast2-pkg-bindings 2.14.0'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1428,7 +1428,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.13.105 to adapt to many kinds of systems.
+\`configure' configures yast2-pkg-bindings 2.14.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1499,7 +1499,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-pkg-bindings 2.13.105:";;
+ short | recursive ) echo "Configuration of yast2-pkg-bindings 2.14.0:";;
esac
cat <<\_ACEOF
@@ -1607,7 +1607,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-pkg-bindings configure 2.13.105
+yast2-pkg-bindings configure 2.14.0
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1621,7 +1621,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.13.105, which was
+It was created by yast2-pkg-bindings $as_me 2.14.0, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -2422,7 +2422,7 @@
# Define the identity of the package.
PACKAGE='yast2-pkg-bindings'
- VERSION='2.13.105'
+ VERSION='2.14.0'
cat >>confdefs.h <<_ACEOF
@@ -2649,7 +2649,7 @@
-VERSION="2.13.105"
+VERSION="2.14.0"
RPMNAME="yast2-pkg-bindings"
MAINTAINER="Ladislav Slezák "
@@ -21609,7 +21609,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.13.105, which was
+This file was extended by yast2-pkg-bindings $as_me 2.14.0, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21662,7 +21662,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-pkg-bindings config.status 2.13.105
+yast2-pkg-bindings config.status 2.14.0
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.13.105/configure.in new/yast2-pkg-bindings-2.14.0/configure.in
--- old/yast2-pkg-bindings-2.13.105/configure.in 2006-11-09 10:10:51.000000000 +0100
+++ new/yast2-pkg-bindings-2.14.0/configure.in 2006-11-13 14:49:11.000000000 +0100
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.13.16 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-pkg-bindings, 2.13.105, http://bugs.opensuse.org/, yast2-pkg-bindings)
+AC_INIT(yast2-pkg-bindings, 2.14.0, http://bugs.opensuse.org/, yast2-pkg-bindings)
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.105"
+VERSION="2.14.0"
RPMNAME="yast2-pkg-bindings"
MAINTAINER="Ladislav Slezák "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.13.105/pkg-bindings.pot new/yast2-pkg-bindings-2.14.0/pkg-bindings.pot
--- old/yast2-pkg-bindings-2.13.105/pkg-bindings.pot 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-pkg-bindings-2.14.0/pkg-bindings.pot 2006-11-10 12:37:51.000000000 +0100
@@ -0,0 +1,30 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR SuSE Linux Products GmbH, Nuernberg
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-11-10 12:37+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/Source.cc:138 src/Source.cc:172 src/Source.cc:752 src/Source.cc:794
+msgid "Downloading files..."
+msgstr ""
+
+#: src/Source.cc:191 src/Source.cc:250 src/Source.cc:1256 src/Source.cc:1258
+#: src/Source.cc:1283 src/Source.cc:1285
+msgid "Parsing files..."
+msgstr ""
+
+#: src/Source.cc:694 src/Source.cc:722
+msgid "Downloading file..."
+msgstr ""
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.13.105/src/Package.cc new/yast2-pkg-bindings-2.14.0/src/Package.cc
--- old/yast2-pkg-bindings-2.13.105/src/Package.cc 2006-10-31 12:53:26.000000000 +0100
+++ new/yast2-pkg-bindings-2.14.0/src/Package.cc 2006-11-13 09:59:59.000000000 +0100
@@ -644,7 +644,7 @@
it != zypp_ptr()->pool().byKindEnd(kind); ++it)
{
bool res = provide ? it->status().setToBeInstalled( whoWantsIt )
- : it->status().setToBeUninstalled( whoWantsIt );
+ : (it->status().isInstalled() && it->status().setToBeUninstalled( whoWantsIt ));
y2milestone ("%s %s -> %s\n", (provide ? "Install" : "Remove"), (*it)->name().c_str(), (res ? "Ok" : "Failed"));
ret = ret && res;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.13.105/src/PkgModuleFunctions.h new/yast2-pkg-bindings-2.14.0/src/PkgModuleFunctions.h
--- old/yast2-pkg-bindings-2.13.105/src/PkgModuleFunctions.h 2006-10-13 12:51:54.000000000 +0200
+++ new/yast2-pkg-bindings-2.14.0/src/PkgModuleFunctions.h 2006-11-13 10:40:11.000000000 +0100
@@ -312,7 +312,9 @@
YCPValue SourceCreate (const YCPString&, const YCPString&);
/* TYPEINFO: integer(string,string)*/
YCPValue SourceCreateBase (const YCPString&, const YCPString&);
- YCPValue SourceCreateEx (const YCPString&, const YCPString&, bool);
+ /* TYPEINFO: integer(string,string,string)*/
+ YCPValue SourceCreateType (const YCPString& media, const YCPString& pd, const YCPString& type);
+ YCPValue SourceCreateEx (const YCPString&, const YCPString&, bool, const YCPString& source_type);
/* TYPEINFO: list<integer>(boolean)*/
YCPValue SourceStartCache (const YCPBoolean&);
/* TYPEINFO: boolean()*/
@@ -403,6 +405,8 @@
YCPValue TargetGetDU ();
/* TYPEINFO: boolean(string)*/
YCPBoolean TargetFileHasOwner (const YCPString&);
+ /* TYPEINFO: boolean(string,symbol)*/
+ YCPBoolean TargetStoreRemove(const YCPString& root, const YCPSymbol& kind_r);
// selection related
/* TYPEINFO: list<string>(symbol,string)*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.13.105/src/Source.cc new/yast2-pkg-bindings-2.14.0/src/Source.cc
--- old/yast2-pkg-bindings-2.13.105/src/Source.cc 2006-11-08 08:28:20.000000000 +0100
+++ new/yast2-pkg-bindings-2.14.0/src/Source.cc 2006-11-13 09:47:59.000000000 +0100
@@ -996,7 +996,8 @@
zypp::SourceManager::SourceId
createManagedSource( const zypp::Url & url_r,
const zypp::Pathname & path_r,
- const bool base_source )
+ const bool base_source,
+ const std::string& type )
{
y2milestone ("Original URL: %s", url_r.asString().c_str());
@@ -1004,7 +1005,12 @@
zypp::Url new_url;
string alias = removeAlias (url_r, new_url);
- zypp::Source_Ref newsrc = zypp::SourceFactory().createFrom(new_url, path_r, alias, zypp::filesystem::Pathname(), base_source);
+ zypp::Source_Ref newsrc =
+ (type.empty()) ?
+ // autoprobe source type
+ zypp::SourceFactory().createFrom(new_url, path_r, alias, zypp::filesystem::Pathname(), base_source) :
+ // use required source type, autorefresh = true
+ zypp::SourceFactory().createFrom(type, new_url, path_r, alias, zypp::filesystem::Pathname(), base_source, true);
if (alias.empty ())
{
@@ -1120,7 +1126,7 @@
{
try
{
- id = createManagedSource(url, it->_dir, false);
+ id = createManagedSource(url, it->_dir, false, "");
ids->add( YCPInteger(id) );
}
catch ( const zypp::Exception& excpt)
@@ -1135,7 +1141,7 @@
try
{
- id = createManagedSource(url, pn, false);
+ id = createManagedSource(url, pn, false, "");
ids->add( YCPInteger(id) );
}
catch ( const zypp::Exception& excpt)
@@ -1170,17 +1176,36 @@
YCPValue
PkgModuleFunctions::SourceCreate (const YCPString& media, const YCPString& pd)
{
- return SourceCreateEx (media, pd, false);
+ // not base product, autoprobe source type
+ return SourceCreateEx (media, pd, false, YCPString(""));
}
YCPValue
PkgModuleFunctions::SourceCreateBase (const YCPString& media, const YCPString& pd)
{
- return SourceCreateEx (media, pd, true);
+ // base product, autoprobe source type
+ return SourceCreateEx (media, pd, true, YCPString(""));
}
+/**
+ * @builtin SourceCreateType
+ * @short Create source of required type
+ * @description
+ * Create a source without autoprobing the source type. This builtin should be used only for "Plaindir" sources, because Plaindir sources are not automatically probed in SourceCreate() builtin.
+ * @param media URL of the source
+ * @param pd product directory (if empty the products will be searched)
+ * @param type type of the source ("YaST", "YUM" or "Plaindir")
+*/
+
YCPValue
-PkgModuleFunctions::SourceCreateEx (const YCPString& media, const YCPString& pd, bool base)
+PkgModuleFunctions::SourceCreateType (const YCPString& media, const YCPString& pd, const YCPString& type)
+{
+ // not base product, autoprobe source type
+ return SourceCreateEx (media, pd, false, type);
+}
+
+YCPValue
+PkgModuleFunctions::SourceCreateEx (const YCPString& media, const YCPString& pd, bool base, const YCPString& source_type)
{
y2debug("Creating source...");
@@ -1203,6 +1228,8 @@
YCPList ids;
int ret = -1;
+ const std::string type = source_type->value();
+
if ( pd->value().empty() ) {
// scan all sources
@@ -1230,7 +1257,7 @@
{
try
{
- unsigned id = createManagedSource(url, it->_dir, base);
+ unsigned id = createManagedSource(url, it->_dir, base, type);
zypp::Source_Ref src = zypp::SourceManager::sourceManager()->findSource(id);
@@ -1257,7 +1284,7 @@
try
{
- ret = createManagedSource(url, pn, base);
+ ret = createManagedSource(url, pn, base, type);
zypp::Source_Ref src = zypp::SourceManager::sourceManager()->findSource(ret);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.13.105/src/Target.cc new/yast2-pkg-bindings-2.14.0/src/Target.cc
--- old/yast2-pkg-bindings-2.13.105/src/Target.cc 2006-10-12 13:05:10.000000000 +0200
+++ new/yast2-pkg-bindings-2.14.0/src/Target.cc 2006-11-13 14:46:25.000000000 +0100
@@ -40,6 +40,7 @@
#include
#include
#include
+#include
using namespace zypp;
@@ -146,6 +147,20 @@
try
{
zypp::SourceManager::disableSourcesAt( _target_root );
+
+ // disable source refresh - workaround for #220056
+ zypp::storage::PersistentStorage store;
+ store.init( _target_root );
+
+ std::listzypp::source::SourceInfo new_sources = store.storedSources();
+ y2milestone("Disabling refresh for sources at %s", _target_root.asString().c_str());
+
+ for ( std::listzypp::source::SourceInfo::iterator it = new_sources.begin(); it != new_sources.end(); ++it)
+ {
+ y2milestone("Disabling refresh: alias: %s", it->alias().c_str());
+ it->setAutorefresh(false);
+ store.storeSource( *it );
+ }
}
catch (zypp::Exception & excpt)
{
@@ -153,7 +168,7 @@
ycperror("TargetDisableSources has failed: %s", excpt.msg().c_str() );
return YCPBoolean(false);
}
-
+
return YCPBoolean(true);
}
@@ -681,3 +696,85 @@
return YCPBoolean(false);
}
+
+/**
+ @builtin TargetStoreRemove
+
+ @short remove all resolvables from the DB in the target system (removes only metadata in the package manager!)
+ @description
+ Use this function only in a special case, direct access to the DB should not be used in general!
+ Warning: this built in can cause inconsistency between the package manager and the system!
+ @param root path to the root directory
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `selection, `pattern or `language
+ @return boolean true = success
+*/
+YCPBoolean
+PkgModuleFunctions::TargetStoreRemove(const YCPString& root, const YCPSymbol& kind_r)
+{
+ zypp::Resolvable::Kind kind;
+ std::string req_kind = kind_r->symbol();
+
+ if( req_kind == "product" ) {
+ kind = zypp::ResTraitszypp::Product::kind;
+ }
+ else if ( req_kind == "patch" ) {
+ kind = zypp::ResTraitszypp::Patch::kind;
+ }
+ else if ( req_kind == "package" ) {
+ kind = zypp::ResTraitszypp::Package::kind;
+ }
+ else if ( req_kind == "selection" ) {
+ kind = zypp::ResTraitszypp::Selection::kind;
+ }
+ else if ( req_kind == "pattern" ) {
+ kind = zypp::ResTraitszypp::Pattern::kind;
+ }
+ else if ( req_kind == "language" ) {
+ kind = zypp::ResTraitszypp::Language::kind;
+ }
+ else
+ {
+ y2error("Pkg::TargetStoreRemove: unknown symbol: %s", req_kind.c_str());
+ return YCPBoolean(false);
+ }
+
+ bool success = true;
+
+ std::string target_root = root->value();
+ if (target_root.empty())
+ {
+ y2error("Pkg::TargetStoreRemove: parameter root is empty");
+ return YCPBoolean(false);
+ }
+
+ try
+ {
+ // create a storage
+ zypp::storage::PersistentStorage store;
+ store.init( target_root );
+
+ // get all resolvables of the required kind
+ std::listResObject::Ptr objects = store.storedObjects(kind);
+
+ y2warning("Removing %d objects of kind '%s' from %s", objects.size(), req_kind.c_str(), target_root.c_str());
+
+ // remove the resolvables
+ for( std::listResObject::Ptr::const_iterator it = objects.begin(); it != objects.end(); ++it)
+ {
+ try {
+ store.deleteObject(*it);
+ } catch( const zypp::Exception& excpt )
+ {
+ y2error("TargetStoreRemove has failed: %s", excpt.msg().c_str());
+ success = false;
+ }
+ }
+ }
+ catch( const zypp::Exception& excpt )
+ {
+ y2error("TargetStoreRemove has failed: %s", excpt.msg().c_str());
+ success = false;
+ }
+
+ return YCPBoolean(success);
+}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org