Hello community,
here is the log from the commit of package yast2-pkg-bindings for
openSUSE:Factory checked in at 2013-09-09 19:52:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-pkg-bindings (Old)
and /work/SRC/openSUSE:Factory/.yast2-pkg-bindings.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-pkg-bindings"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-pkg-bindings/yast2-pkg-bindings.changes
2013-08-01 11:09:29.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.yast2-pkg-bindings.new/yast2-pkg-bindings.changes
2013-09-09 19:52:39.000000000 +0200
@@ -1,0 +2,15 @@
+Mon Sep 9 12:39:05 UTC 2013 - [email protected]
+
+- do not abort if package installation fails, always ask user
+ (evaluate the callback), libzypp no longer uses 3 installation
+ attempts (fixes openqa failures when btrfs is used)
+- 3.0.2
+
+-------------------------------------------------------------------
+Fri Sep 6 15:33:30 UTC 2013 - [email protected]
+
+- use a single RepoManager instance to avoid repository metadata
+ removal (bnc#802665#c27)
+- 3.0.1
+
+-------------------------------------------------------------------
Old:
----
yast2-pkg-bindings-3.0.0.tar.bz2
New:
----
yast2-pkg-bindings-3.0.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-pkg-bindings-devel-doc.spec ++++++
--- /var/tmp/diff_new_pack.ZLvR7U/_old 2013-09-09 19:52:40.000000000 +0200
+++ /var/tmp/diff_new_pack.ZLvR7U/_new 2013-09-09 19:52:40.000000000 +0200
@@ -18,10 +18,10 @@
Name: yast2-pkg-bindings-devel-doc
-Version: 3.0.0
+Version: 3.0.2
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-pkg-bindings-3.0.0.tar.bz2
+Source0: yast2-pkg-bindings-3.0.2.tar.bz2
Prefix: %_prefix
# same as in the main package (because we use the same configure.in.in)
++++++ yast2-pkg-bindings.spec ++++++
--- /var/tmp/diff_new_pack.ZLvR7U/_old 2013-09-09 19:52:40.000000000 +0200
+++ /var/tmp/diff_new_pack.ZLvR7U/_new 2013-09-09 19:52:40.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2-pkg-bindings
-Version: 3.0.0
+Version: 3.0.2
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-pkg-bindings-3.0.0.tar.bz2 -> yast2-pkg-bindings-3.0.2.tar.bz2
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/VERSION
new/yast2-pkg-bindings-3.0.2/VERSION
--- old/yast2-pkg-bindings-3.0.0/VERSION 2013-07-30 10:36:14.000000000
+0200
+++ new/yast2-pkg-bindings-3.0.2/VERSION 2013-09-09 17:46:51.000000000
+0200
@@ -1 +1 @@
-3.0.0
+3.0.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/configure
new/yast2-pkg-bindings-3.0.2/configure
--- old/yast2-pkg-bindings-3.0.0/configure 2013-07-30 10:36:32.000000000
+0200
+++ new/yast2-pkg-bindings-3.0.2/configure 2013-09-09 17:47:15.000000000
+0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for yast2-pkg-bindings 3.0.0.
+# Generated by GNU Autoconf 2.69 for yast2-pkg-bindings 3.0.2.
#
# Report bugs to <http://bugs.opensuse.org/>.
#
@@ -590,8 +590,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-pkg-bindings'
PACKAGE_TARNAME='yast2-pkg-bindings'
-PACKAGE_VERSION='3.0.0'
-PACKAGE_STRING='yast2-pkg-bindings 3.0.0'
+PACKAGE_VERSION='3.0.2'
+PACKAGE_STRING='yast2-pkg-bindings 3.0.2'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
PACKAGE_URL=''
@@ -1384,7 +1384,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 3.0.0 to adapt to many kinds of
systems.
+\`configure' configures yast2-pkg-bindings 3.0.2 to adapt to many kinds of
systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1456,7 +1456,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-pkg-bindings 3.0.0:";;
+ short | recursive ) echo "Configuration of yast2-pkg-bindings 3.0.2:";;
esac
cat <<\_ACEOF
@@ -1576,7 +1576,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-pkg-bindings configure 3.0.0
+yast2-pkg-bindings configure 3.0.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2029,7 +2029,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 3.0.0, which was
+It was created by yast2-pkg-bindings $as_me 3.0.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2968,7 +2968,7 @@
# Define the identity of the package.
PACKAGE='yast2-pkg-bindings'
- VERSION='3.0.0'
+ VERSION='3.0.2'
cat >>confdefs.h <<_ACEOF
@@ -3091,7 +3091,7 @@
-VERSION="3.0.0"
+VERSION="3.0.2"
RPMNAME="yast2-pkg-bindings"
MAINTAINER="Ladislav Slezák <[email protected]>"
@@ -16767,7 +16767,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 3.0.0, which was
+This file was extended by yast2-pkg-bindings $as_me 3.0.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16833,7 +16833,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-yast2-pkg-bindings config.status 3.0.0
+yast2-pkg-bindings config.status 3.0.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/configure.ac
new/yast2-pkg-bindings-3.0.2/configure.ac
--- old/yast2-pkg-bindings-3.0.0/configure.ac 2013-07-30 10:36:21.000000000
+0200
+++ new/yast2-pkg-bindings-3.0.2/configure.ac 2013-09-09 17:47:01.000000000
+0200
@@ -1,9 +1,9 @@
dnl configure.ac for yast2-pkg-bindings
dnl
-dnl -- This file is generated by y2autoconf 3.0.0 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 3.0.4 - DO NOT EDIT! --
dnl (edit configure.ac.in or configure.in.in instead)
-AC_INIT(yast2-pkg-bindings, 3.0.0, http://bugs.opensuse.org/,
yast2-pkg-bindings)
+AC_INIT(yast2-pkg-bindings, 3.0.2, 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="3.0.0"
+VERSION="3.0.2"
RPMNAME="yast2-pkg-bindings"
MAINTAINER="Ladislav Slezák <[email protected]>"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Callbacks.cc
new/yast2-pkg-bindings-3.0.2/src/Callbacks.cc
--- old/yast2-pkg-bindings-3.0.0/src/Callbacks.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Callbacks.cc 2013-09-09
17:46:51.000000000 +0200
@@ -282,15 +282,10 @@
zypp::Resolvable::constPtr resolvable
, zypp::target::rpm::InstallResolvableReport::Error error
, const std::string &description
+ // note: the RpmLevel argument is not used anymore, ignore it
, zypp::target::rpm::InstallResolvableReport::RpmLevel level
)
{
- if (level !=
zypp::target::rpm::InstallResolvableReport::RPM_NODEPS_FORCE)
- {
- y2milestone( "Retrying installation problem with too low
severity (%d)", level);
- return zypp::target::rpm::InstallResolvableReport::ABORT;
- }
-
_last = zypp::Resolvable::constPtr();
CB callback( ycpcb( YCPCallbacks::CB_DonePackage) );
@@ -314,20 +309,14 @@
(resolvable, error, description, level);
}
+ // note: the RpmLevel argument is not used anymore, ignore it
virtual void finish(zypp::Resolvable::constPtr resolvable, Error error,
const std::string &reason, zypp::target::rpm::InstallResolvableReport::RpmLevel
level)
{
- if (error != zypp::target::rpm::InstallResolvableReport::NO_ERROR
&& level != zypp::target::rpm::InstallResolvableReport::RPM_NODEPS_FORCE)
- {
- y2milestone( "Skipping finish due to retrying installation
problem with too low severity (%d)", level);
- return;
- }
-
- CB callback( ycpcb( YCPCallbacks::CB_DonePackage) );
- if (callback._set) {
- callback.addInt( level ==
zypp::target::rpm::InstallResolvableReport::RPM_NODEPS_FORCE ? error :
NO_ERROR);
- callback.addStr( reason );
- callback.evaluateStr(); // return value ignored by RpmDb
- }
+ // errors are handled in the problem() callback above, here just
log the message
+ if (error != zypp::target::rpm::InstallResolvableReport::NO_ERROR)
+ {
+ y2milestone("Error in finish callback: %s", reason.c_str());
+ }
}
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/PkgFunctions.cc
new/yast2-pkg-bindings-3.0.2/src/PkgFunctions.cc
--- old/yast2-pkg-bindings-3.0.0/src/PkgFunctions.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/PkgFunctions.cc 2013-09-09
11:16:50.000000000 +0200
@@ -61,6 +61,7 @@
_target_root( "/" )
, _target_loaded(false)
, zypp_pointer(NULL)
+ , repo_manager(NULL)
, commit_policy(NULL)
,_callbackHandler( *new CallbackHandler(*this) )
, base_product(NULL)
@@ -142,6 +143,13 @@
base_product = NULL;
}
+ if (repo_manager)
+ {
+ y2milestone("Releasing the repo manager...");
+ delete repo_manager;
+ repo_manager = NULL;
+ }
+
if (zypp_pointer != NULL)
{
y2milestone("Releasing the zypp pointer...");
@@ -205,14 +213,16 @@
return YCPString (_last_error.lastErrorDetails());
}
-zypp::RepoManager PkgFunctions::CreateRepoManager()
+zypp::RepoManager* PkgFunctions::CreateRepoManager()
{
+ if (repo_manager) return repo_manager;
+
// set path option, use root dir as a prefix for the default directory
zypp::RepoManagerOptions repo_options(_target_root);
-
y2milestone("Path to repository files: %s",
repo_options.knownReposPath.asString().c_str());
- return zypp::RepoManager(repo_options);
+ repo_manager = new zypp::RepoManager(repo_options);
+ return repo_manager;
}
// convert Exception object to string represenatation
@@ -416,3 +426,44 @@
return YCPBoolean(true);
}
+bool PkgFunctions::RepoManagerUpdateTarget(const std::string& root)
+{
+ bool new_target = _target_root != root;
+
+ // a repository manager is present and the target has been changed
+ if (repo_manager && new_target)
+ {
+ y2milestone("Updating RepoManager target from %s to %s",
_target_root.c_str(), root.c_str());
+
+ // repository manager options cannot be replaced, a new repository
manager is needed
+ zypp::RepoManager* new_repo_manager = new
zypp::RepoManager(zypp::RepoManagerOptions(root));
+
+ // register the known repositories
+ if (repos.empty() && service_manager.empty())
+ {
+ for (RepoCont::iterator it = repos.begin();
+ it != repos.end(); ++it)
+ {
+ // ignore removed repositories
+ if (!(*it)->isDeleted())
+ {
+ new_repo_manager->addRepository((*it)->repoInfo());
+ }
+ }
+ }
+
+ // replace the old repository manager
+ delete repo_manager;
+ repo_manager = new_repo_manager;
+ }
+
+ return new_target;
+}
+
+bool PkgFunctions::SetTarget(const std::string &root)
+{
+ bool new_target = RepoManagerUpdateTarget(root);
+ _target_root = root;
+
+ return new_target;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/PkgFunctions.h
new/yast2-pkg-bindings-3.0.2/src/PkgFunctions.h
--- old/yast2-pkg-bindings-3.0.0/src/PkgFunctions.h 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/PkgFunctions.h 2013-09-09
11:16:50.000000000 +0200
@@ -84,6 +84,10 @@
zypp::ZYpp::Ptr zypp_pointer;
+ // use a single RepoManager instance to avoid "unused" metadata cleanup
+ // see https://bugzilla.novell.com/show_bug.cgi?id=802665#c27
+ zypp::RepoManager* repo_manager;
+
// remember the main locale (set by SetLocale) for SetAdditionalLocales,
// add the main locale to the additional ones
zypp::Locale preferred_locale;
@@ -120,6 +124,13 @@
YCPValue SourceRefreshHelper(const YCPInteger &id, bool forced = false);
+ // helper for updating repository manager after changing the target root
+ // return true if the target root has been changed
+ bool RepoManagerUpdateTarget(const std::string& root);
+
+ // set new target directory
+ bool SetTarget(const std::string &root);
+
// helper - is the network running?
bool NetworkDetected();
@@ -148,7 +159,7 @@
zypp::Product::constPtr FindBaseProduct(const std::string &alias) const;
- zypp::RepoManager CreateRepoManager();
+ zypp::RepoManager* CreateRepoManager();
void SetCurrentDU();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Service.cc
new/yast2-pkg-bindings-3.0.2/src/Service.cc
--- old/yast2-pkg-bindings-3.0.0/src/Service.cc 2013-01-22 11:47:22.000000000
+0100
+++ new/yast2-pkg-bindings-3.0.2/src/Service.cc 2013-09-09 11:16:50.000000000
+0200
@@ -147,10 +147,10 @@
}
std::string service_alias = alias->value();
- zypp::RepoManager repomanager = CreateRepoManager();
+ zypp::RepoManager* repomanager = CreateRepoManager();
y2milestone("Saving service %s", service_alias.c_str());
- bool ret = service_manager.SaveService(service_alias, repomanager);
+ bool ret = service_manager.SaveService(service_alias, *repomanager);
return YCPBoolean(ret);
}
catch (const zypp::Exception& excpt)
@@ -372,9 +372,9 @@
return YCPBoolean(false);
}
- zypp::RepoManager repomanager = CreateRepoManager();
+ zypp::RepoManager* repomanager = CreateRepoManager();
- if (!service_manager.RefreshService(alias->value(), repomanager))
+ if (!service_manager.RefreshService(alias->value(), *repomanager))
{
return YCPBoolean(false);
}
@@ -390,9 +390,9 @@
zypp::RepoInfo info(repo->repoInfo());
y2milestone("Reloading repository %s", info.alias().c_str());
- if (repomanager.hasRepo(info))
+ if (repomanager->hasRepo(info))
{
- repos[idx]->repoInfo() =
repomanager.getRepositoryInfo(info.alias());
+ repos[idx]->repoInfo() =
repomanager->getRepositoryInfo(info.alias());
}
else
{
@@ -429,8 +429,8 @@
try
{
- const zypp::RepoManager repomanager = CreateRepoManager();
- return
YCPString(service_manager.Probe(zypp::Url(url->asString()->value()),
repomanager));
+ const zypp::RepoManager* repomanager = CreateRepoManager();
+ return
YCPString(service_manager.Probe(zypp::Url(url->asString()->value()),
*repomanager));
}
catch (const zypp::Exception& excpt)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Source_Callbacks.cc
new/yast2-pkg-bindings-3.0.2/src/Source_Callbacks.cc
--- old/yast2-pkg-bindings-3.0.0/src/Source_Callbacks.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Source_Callbacks.cc 2013-09-09
11:16:50.000000000 +0200
@@ -130,8 +130,8 @@
try
{
- zypp::RepoManager repomanager = CreateRepoManager();
- repomanager.refreshMetadata(repo, refresh, progressrcv);
+ zypp::RepoManager* repomanager = CreateRepoManager();
+ repomanager->refreshMetadata(repo, refresh, progressrcv);
}
catch(...)
{
@@ -161,8 +161,8 @@
try
{
// probe type of the repository
- zypp::RepoManager repomanager = CreateRepoManager();
- repotype = repomanager.probe(url);
+ zypp::RepoManager* repomanager = CreateRepoManager();
+ repotype = repomanager->probe(url);
}
catch(...)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Source_Create.cc
new/yast2-pkg-bindings-3.0.2/src/Source_Create.cc
--- old/yast2-pkg-bindings-3.0.0/src/Source_Create.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Source_Create.cc 2013-09-09
11:16:50.000000000 +0200
@@ -165,7 +165,7 @@
// repository type
zypp::repo::RepoType repotype;
- zypp::RepoManager repomanager = CreateRepoManager();
+ zypp::RepoManager* repomanager = CreateRepoManager();
const bool do_probing = type.empty();
@@ -274,10 +274,10 @@
zypp::CombinedProgressData subprogrcv_build(prg, 70);
// set metadata path (#293428)
- zypp::Pathname metadatapath = repomanager.metadataPath(repo);
+ zypp::Pathname metadatapath = repomanager->metadataPath(repo);
repo.setMetadataPath(metadatapath);
// set packages path
- repo.setPackagesPath(repomanager.packagesPath(repo));
+ repo.setPackagesPath(repomanager->packagesPath(repo));
y2milestone("Adding source '%s' (%s, dir: %s)", repo.alias().c_str(),
url.asString().c_str(), path_r.asString().c_str());
// note: exceptions should be caught by the calling code
@@ -285,14 +285,14 @@
progress.NextStage();
// remove the cache
- if (repomanager.isCached(repo))
+ if (repomanager->isCached(repo))
{
y2milestone("Removing cache for repository '%s'...",
repo.alias().c_str());
- repomanager.cleanCache(repo);
+ repomanager->cleanCache(repo);
}
y2milestone("Caching repository '%s'...", repo.alias().c_str());
- repomanager.buildCache(repo, zypp::RepoManager::BuildIfNeeded,
subprogrcv_build);
+ repomanager->buildCache(repo, zypp::RepoManager::BuildIfNeeded,
subprogrcv_build);
progress.NextStage();
@@ -426,7 +426,7 @@
if (check_alias)
{
// search in stored repositories
- std::list<zypp::RepoInfo> reps =
CreateRepoManager().knownRepositories();
+ std::list<zypp::RepoInfo> reps =
CreateRepoManager()->knownRepositories();
if (aliasExists(alias, reps))
{
@@ -489,11 +489,11 @@
}
// set metadata path (#293428)
- zypp::RepoManager repomanager = CreateRepoManager();
- zypp::Pathname metadatapath = repomanager.metadataPath(repo);
+ zypp::RepoManager* repomanager = CreateRepoManager();
+ zypp::Pathname metadatapath = repomanager->metadataPath(repo);
repo.setMetadataPath(metadatapath);
- repo.setPackagesPath(repomanager.packagesPath(repo));
+ repo.setPackagesPath(repomanager->packagesPath(repo));
repos.push_back(new YRepo(repo));
@@ -753,7 +753,6 @@
**/
YCPValue PkgFunctions::RepositoryProbe(const YCPString& url, const YCPString&
prod_dir)
{
- zypp::RepoManager repomanager = CreateRepoManager();
std::string ret;
try
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Source_Download.cc
new/yast2-pkg-bindings-3.0.2/src/Source_Download.cc
--- old/yast2-pkg-bindings-3.0.0/src/Source_Download.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Source_Download.cc 2013-09-09
11:16:50.000000000 +0200
@@ -410,7 +410,7 @@
try
{
- zypp::RepoManager repomanager = CreateRepoManager();
+ zypp::RepoManager* repomanager = CreateRepoManager();
y2milestone("Refreshing metadata '%s'",
repo->repoInfo().alias().c_str());
RefreshWithCallbacks(repo->repoInfo(),
zypp::ProgressData::ReceiverFnc(), forced ? zypp::RepoManager::RefreshForced :
zypp::RepoManager::RefreshIfNeeded);
@@ -419,7 +419,7 @@
pkgprogress.NextStage();
y2milestone("Caching source '%s'...", repo->repoInfo().alias().c_str());
- repomanager.buildCache(repo->repoInfo(), forced ?
zypp::RepoManager::BuildForced : zypp::RepoManager::BuildIfNeeded);
+ repomanager->buildCache(repo->repoInfo(), forced ?
zypp::RepoManager::BuildForced : zypp::RepoManager::BuildIfNeeded);
}
catch ( const zypp::Exception & expt )
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Source_Load.cc
new/yast2-pkg-bindings-3.0.2/src/Source_Load.cc
--- old/yast2-pkg-bindings-3.0.0/src/Source_Load.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Source_Load.cc 2013-09-09
11:16:50.000000000 +0200
@@ -63,7 +63,7 @@
try
{
- zypp::RepoManager repomanager = CreateRepoManager();
+ zypp::RepoManager* repomanager = CreateRepoManager();
if (!service_manager.empty())
{
@@ -73,7 +73,7 @@
{
try
{
- service_manager.LoadServices(repomanager);
+ service_manager.LoadServices(*repomanager);
if (!service_manager.empty())
{
@@ -97,7 +97,7 @@
else
{
y2milestone("Autorefreshing service %s
(%s)...", srv_it->alias().c_str(), url.asString().c_str());
-
service_manager.RefreshService(srv_it->alias(), repomanager);
+
service_manager.RefreshService(srv_it->alias(), *repomanager);
}
}
}
@@ -120,7 +120,7 @@
}
}
- std::list<zypp::RepoInfo> reps = repomanager.knownRepositories();
+ std::list<zypp::RepoInfo> reps = repomanager->knownRepositories();
for (std::list<zypp::RepoInfo>::iterator it = reps.begin();
it != reps.end(); ++it)
@@ -227,7 +227,7 @@
prog_total.sendTo(progress.Receiver());
y2debug("Progress status: %lld", prog_total.val());
- zypp::RepoManager repomanager = CreateRepoManager();
+ zypp::RepoManager* repomanager = CreateRepoManager();
autorefresh_skipped = false;
@@ -259,7 +259,7 @@
}
else
{
- zypp::RepoStatus raw_metadata_status =
repomanager.metadataStatus((*it)->repoInfo());
+ zypp::RepoStatus raw_metadata_status =
repomanager->metadataStatus((*it)->repoInfo());
// autorefresh the source
if ((*it)->repoInfo().autorefresh() ||
raw_metadata_status.empty())
@@ -286,7 +286,7 @@
refresh_started_called = true;
}
- zypp::RepoManager::RefreshCheckStatus ref_stat =
repomanager.checkIfToRefreshMetadata((*it)->repoInfo(),
*((*it)->repoInfo().baseUrlsBegin()));
+ zypp::RepoManager::RefreshCheckStatus ref_stat =
repomanager->checkIfToRefreshMetadata((*it)->repoInfo(),
*((*it)->repoInfo().baseUrlsBegin()));
if (ref_stat != zypp::RepoManager::REFRESH_NEEDED)
{
@@ -358,7 +358,7 @@
// autorefresh the source
if ((*it)->repoInfo().autorefresh())
{
- zypp::RepoStatus raw_metadata_status =
repomanager.metadataStatus((*it)->repoInfo());
+ zypp::RepoStatus raw_metadata_status =
repomanager->metadataStatus((*it)->repoInfo());
// autorefresh the source
if (raw_metadata_status.empty() )
@@ -372,8 +372,8 @@
// rebuild cache (the default policy is "if needed")
y2milestone("Rebuilding cache for '%s'...",
(*it)->repoInfo().alias().c_str());
- //repomanager.buildCache((*it)->repoInfo(),
zypp::RepoManager::BuildIfNeeded, prog.receiver());
- repomanager.buildCache((*it)->repoInfo(),
zypp::RepoManager::BuildIfNeeded, rebuild_subprogress);
+ //repomanager->buildCache((*it)->repoInfo(),
zypp::RepoManager::BuildIfNeeded, prog.receiver());
+ repomanager->buildCache((*it)->repoInfo(),
zypp::RepoManager::BuildIfNeeded, rebuild_subprogress);
}
// NOTE: subtask progresses are reported as done in the
descructor
// no need to handle them in the exception code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Source_Misc.cc
new/yast2-pkg-bindings-3.0.2/src/Source_Misc.cc
--- old/yast2-pkg-bindings-3.0.0/src/Source_Misc.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Source_Misc.cc 2013-09-09
11:16:50.000000000 +0200
@@ -153,7 +153,7 @@
unsigned int id = 0;
// search in stored repositories
- std::list<zypp::RepoInfo> reps = CreateRepoManager().knownRepositories();
+ std::list<zypp::RepoInfo> reps = CreateRepoManager()->knownRepositories();
while(aliasExists(ret, reps))
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Source_Resolvables.cc
new/yast2-pkg-bindings-3.0.2/src/Source_Resolvables.cc
--- old/yast2-pkg-bindings-3.0.0/src/Source_Resolvables.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Source_Resolvables.cc 2013-09-09
11:16:50.000000000 +0200
@@ -73,13 +73,13 @@
try
{
- zypp::RepoManager repomanager = CreateRepoManager();
+ zypp::RepoManager* repomanager = CreateRepoManager();
bool refresh = true;
// build cache if needed
- if (!repomanager.isCached(repoinfo) && !autorefresh_skipped)
+ if (!repomanager->isCached(repoinfo) && !autorefresh_skipped)
{
- zypp::RepoStatus raw_metadata_status =
repomanager.metadataStatus(repoinfo);
+ zypp::RepoStatus raw_metadata_status =
repomanager->metadataStatus(repoinfo);
if (raw_metadata_status.empty())
{
if (network_check)
@@ -110,11 +110,11 @@
if (refresh)
{
y2milestone("Caching source '%s'...", repoinfo.alias().c_str());
- repomanager.buildCache(repoinfo,
zypp::RepoManager::BuildIfNeeded, load_subprogress);
+ repomanager->buildCache(repoinfo,
zypp::RepoManager::BuildIfNeeded, load_subprogress);
}
}
- repomanager.loadFromCache(repoinfo);
+ repomanager->loadFromCache(repoinfo);
repo->setLoaded();
//y2milestone("Loaded %zd resolvables", store.size());
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Source_Save.cc
new/yast2-pkg-bindings-3.0.2/src/Source_Save.cc
--- old/yast2-pkg-bindings-3.0.0/src/Source_Save.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Source_Save.cc 2013-09-09
11:16:50.000000000 +0200
@@ -90,12 +90,12 @@
return YCPBoolean(ret);
}
- zypp::RepoManager repomanager = CreateRepoManager();
+ zypp::RepoManager* repomanager = CreateRepoManager();
// save the services
try
{
- service_manager.SaveServices(repomanager);
+ service_manager.SaveServices(*repomanager);
y2milestone("All services have been saved");
}
catch (const zypp::Exception& excpt)
@@ -156,26 +156,26 @@
try
{
// remove the metadata
- zypp::RepoStatus raw_metadata_status =
repomanager.metadataStatus((*it)->repoInfo());
+ zypp::RepoStatus raw_metadata_status =
repomanager->metadataStatus((*it)->repoInfo());
if (!raw_metadata_status.empty())
{
y2milestone("Removing metadata for source '%s'...",
repo_alias.c_str());
- repomanager.cleanMetadata((*it)->repoInfo());
+ repomanager->cleanMetadata((*it)->repoInfo());
}
prog_total.incr();
// remove the cache
- if (repomanager.isCached((*it)->repoInfo()))
+ if (repomanager->isCached((*it)->repoInfo()))
{
y2milestone("Removing cache for '%s'...",
repo_alias.c_str());
- repomanager.cleanCache((*it)->repoInfo());
+ repomanager->cleanCache((*it)->repoInfo());
}
prog_total.incr();
// does the repository exist?
- repomanager.getRepositoryInfo(repo_alias);
+ repomanager->getRepositoryInfo(repo_alias);
y2milestone("Removing repository '%s'", repo_alias.c_str());
- repomanager.removeRepository((*it)->repoInfo());
+ repomanager->removeRepository((*it)->repoInfo());
prog_total.incr();
}
catch (const zypp::repo::RepoNotFoundException &ex)
@@ -210,15 +210,15 @@
try
{
// if the repository already exists then just modify it
- repomanager.getRepositoryInfo(current_alias);
+ repomanager->getRepositoryInfo(current_alias);
y2milestone("Modifying repository '%s'",
current_alias.c_str());
- repomanager.modifyRepository(current_alias,
(*it)->repoInfo());
+ repomanager->modifyRepository(current_alias,
(*it)->repoInfo());
}
catch (const zypp::repo::RepoNotFoundException &ex)
{
// the repository was not found, add it
y2milestone("Adding repository '%s'",
current_alias.c_str());
- repomanager.addRepository((*it)->repoInfo());
+ repomanager->addRepository((*it)->repoInfo());
}
}
catch (zypp::Exception & excpt)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Target.cc
new/yast2-pkg-bindings-3.0.2/src/Target.cc
--- old/yast2-pkg-bindings-3.0.0/src/Target.cc 2013-01-22 11:47:22.000000000
+0100
+++ new/yast2-pkg-bindings-3.0.2/src/Target.cc 2013-09-09 11:16:50.000000000
+0200
@@ -51,15 +51,15 @@
{
// FIXME: should it also remove from pool?
- zypp::RepoManager repomanager = CreateRepoManager();
- std::list<zypp::RepoInfo> all_sources = repomanager.knownRepositories();
+ zypp::RepoManager* repomanager = CreateRepoManager();
+ std::list<zypp::RepoInfo> all_sources =
repomanager->knownRepositories();
for (std::list<zypp::RepoInfo>::iterator it = all_sources.begin(); it
!= all_sources.end(); ++it)
{
y2milestone("Disabling source '%s'", it->alias().c_str());
it->setAutorefresh(false);
- repomanager.modifyRepository(it->alias(), *it);
+ repomanager->modifyRepository(it->alias(), *it);
}
}
catch (zypp::Exception & excpt)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-pkg-bindings-3.0.0/src/Target_Load.cc
new/yast2-pkg-bindings-3.0.2/src/Target_Load.cc
--- old/yast2-pkg-bindings-3.0.0/src/Target_Load.cc 2013-01-22
11:47:22.000000000 +0100
+++ new/yast2-pkg-bindings-3.0.2/src/Target_Load.cc 2013-09-09
11:16:50.000000000 +0200
@@ -45,10 +45,22 @@
PkgFunctions::TargetInitInternal(const YCPString& root, bool rebuild_rpmdb)
{
const std::string r(root->value());
+ bool new_target;
+
+ try
+ {
+ new_target = SetTarget(r);
+ }
+ catch (zypp::Exception & excpt)
+ {
+ _last_error.setLastError(ExceptionAsString(excpt));
+ y2error("TargetInit has failed: %s", excpt.msg().c_str() );
+ return YCPError(excpt.msg().c_str(), YCPBoolean(false));
+ }
// display the progress if the target is changed or if the resolvables
haven't been loaded
// otherwise there will be a quick flashing progress with no real action
- if (_target_root == r && _target_loaded)
+ if (!new_target && _target_loaded)
{
y2milestone("Target %s is already initialized", r.c_str());
return YCPBoolean(true);
@@ -80,8 +92,6 @@
return YCPError(excpt.msg().c_str(), YCPBoolean(false));
}
- _target_root = zypp::Pathname(r);
-
// locks are optional, might not be present on the target
zypp::Pathname lock_file(_target_root +
zypp::ZConfig::instance().locksFile());
try
@@ -137,11 +147,12 @@
YCPValue
PkgFunctions::TargetInitialize (const YCPString& root)
{
- std::string r = root->value();
+ const std::string r = root->value();
try
{
zypp_ptr()->initializeTarget(r);
+ SetTarget(r);
}
catch (zypp::Exception & excpt)
{
@@ -150,8 +161,6 @@
return YCPError(excpt.msg().c_str(), YCPBoolean(false));
}
- _target_root = zypp::Pathname(root->value());
-
return YCPBoolean(true);
}
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]