Hello community,
here is the log from the commit of package libzypp for openSUSE:Factory
checked in at Fri Dec 19 15:12:19 CET 2008.
--------
--- libzypp/libzypp.changes 2008-12-10 16:36:04.000000000 +0100
+++ /mounts/work_src_done/STABLE/libzypp/libzypp.changes 2008-12-18 22:54:25.267580000 +0100
@@ -1,0 +2,29 @@
+Thu Dec 18 22:26:18 CET 2008 - ma@suse.de
+
+- Fixed lost user request to abort during commit. (bnc #388810, bnc #450273)
+- revision 11954
+- version 5.25.0 (23)
+
+-------------------------------------------------------------------
+Thu Dec 18 13:02:27 CET 2008 - ma@suse.de
+
+- Add Package::filelist, faster and less memory consuming
+ implementation of Package::filenames (now deprecated).
+- revision 11949
+
+-------------------------------------------------------------------
+Thu Dec 11 21:39:50 CET 2008 - ma@suse.de
+
+- Add str::hexencode and str::hexdecode to encode special characters
+ in a string as %XX.
+- Hexdecode modalias strings in rpm dependencies because rpm does not
+ allow comma, blank and other special chars. (bnc #456695)
+- revision 11927
+
+-------------------------------------------------------------------
+Thu Dec 11 17:13:06 CET 2008 - ma@suse.de
+
+- Catch and report media errors when proving packages. (bnc #457652)
+- revision 11926
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libzypp-5.24.7.tar.bz2
New:
----
libzypp-5.25.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.K24185/_old 2008-12-19 15:11:49.000000000 +0100
+++ /var/tmp/diff_new_pack.K24185/_new 2008-12-19 15:11:49.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package libzypp (Version 5.24.7)
+# spec file for package libzypp (Version 5.25.0)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -24,9 +24,9 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReqProv: on
Summary: Package, Patch, Pattern, and Product Management
-Version: 5.24.7
+Version: 5.25.0
Release: 1
-Source: libzypp-5.24.7.tar.bz2
+Source: libzypp-5.25.0.tar.bz2
Source1: libzypp-rpmlintrc
Prefix: /usr
Provides: yast2-packagemanager
@@ -76,7 +76,7 @@
%package devel
License: GPL v2 or later
-Requires: libzypp == 5.24.7
+Requires: libzypp == 5.25.0
Requires: libxml2-devel curl-devel openssl-devel rpm-devel glibc-devel zlib-devel
Requires: bzip2 popt-devel dbus-1-devel glib2-devel hal-devel boost-devel libstdc++-devel
Requires: cmake libsatsolver-devel >= 0.13.0
@@ -235,6 +235,23 @@
%{_libdir}/pkgconfig/libzypp.pc
%changelog
+* Thu Dec 18 2008 ma@suse.de
+- Fixed lost user request to abort during commit. (bnc #388810, bnc #450273)
+- revision 11954
+- version 5.25.0 (23)
+* Thu Dec 18 2008 ma@suse.de
+- Add Package::filelist, faster and less memory consuming
+ implementation of Package::filenames (now deprecated).
+- revision 11949
+* Thu Dec 11 2008 ma@suse.de
+- Add str::hexencode and str::hexdecode to encode special characters
+ in a string as %%XX.
+- Hexdecode modalias strings in rpm dependencies because rpm does not
+ allow comma, blank and other special chars. (bnc #456695)
+- revision 11927
+* Thu Dec 11 2008 ma@suse.de
+- Catch and report media errors when proving packages. (bnc #457652)
+- revision 11926
* Wed Dec 10 2008 ma@suse.de
- Remove obsolete zypp.conf::productsdir and deprecate
ZConfig::productsPath().
++++++ libzypp-5.24.7.tar.bz2 -> libzypp-5.25.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/CMakeLists.txt new/libzypp-5.25.0/CMakeLists.txt
--- old/libzypp-5.24.7/CMakeLists.txt 2008-12-10 16:11:11.000000000 +0100
+++ new/libzypp-5.25.0/CMakeLists.txt 2008-12-18 22:30:42.000000000 +0100
@@ -20,8 +20,8 @@
MATH( EXPR LIBZYPP_SO_FIRST "${LIBZYPP_CURRENT}-${LIBZYPP_AGE}" )
SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
-SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor" )
-SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall" )
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor" )
+SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -g -Wall" )
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3" )
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3" )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/devel/devel.ma/CommitCb.cc new/libzypp-5.25.0/devel/devel.ma/CommitCb.cc
--- old/libzypp-5.24.7/devel/devel.ma/CommitCb.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-5.25.0/devel/devel.ma/CommitCb.cc 2008-12-18 22:30:42.000000000 +0100
@@ -0,0 +1,164 @@
+#include "Tools.h"
+#include
+
+#include
+#include
+#include
+
+struct IRR : public zypp::callback::ReceiveReportzypp::target::rpm::InstallResolvableReport
+{
+ IRR()
+ { connect(); }
+#if 0
+ enum Action {
+ ABORT, // abort and return error
+ RETRY, // retry
+ IGNORE // ignore the failure
+ };
+
+ enum Error {
+ NO_ERROR,
+ NOT_FOUND, // the requested Url was not found
+ IO, // IO error
+ INVALID // th resolvable is invalid
+ };
+
+ // the level of RPM pushing
+ /** \deprecated We fortunately no longer do 3 attempts. */
+ enum RpmLevel {
+ RPM,
+ RPM_NODEPS,
+ RPM_NODEPS_FORCE
+ };
+#endif
+
+ virtual void reportbegin()
+ { SEC << endl; }
+ virtual void reportend()
+ { SEC << endl; }
+
+ virtual void start(Resolvable::constPtr /*resolvable*/)
+ { INT << endl; }
+
+ virtual bool progress(int /*value*/, Resolvable::constPtr /*resolvable*/)
+ {
+ static int i = 4;
+ if ( --i <= 0 )
+ {
+ INT << "return abort" << endl;
+ return false;
+ }
+ return true;
+ }
+
+ virtual Action problem(Resolvable::constPtr /*resolvable*/, Error /*error*/, const std::string &/*description*/, RpmLevel /*level*/)
+ {
+ INT << "return abort" << endl;
+ return ABORT;
+ }
+
+ virtual void finish(Resolvable::constPtr /*resolvable*/, Error /*error*/, const std::string &/*reason*/, RpmLevel /*level*/)
+ { INT << endl; }
+};
+
+struct RRR : public zypp::callback::ReceiveReportzypp::target::rpm::RemoveResolvableReport
+{
+ RRR()
+ { connect(); }
+#if 0
+ enum Action {
+ ABORT, // abort and return error
+ RETRY, // retry
+ IGNORE // ignore the failure
+ };
+
+ enum Error {
+ NO_ERROR,
+ NOT_FOUND, // the requested Url was not found
+ IO, // IO error
+ INVALID // th resolvable is invalid
+ };
+#endif
+
+ virtual void reportbegin()
+ { SEC << endl; }
+ virtual void reportend()
+ { SEC << endl; }
+
+ virtual void start( Resolvable::constPtr /*resolvable*/ )
+ { INT << endl; }
+
+ virtual bool progress(int /*value*/, Resolvable::constPtr /*resolvable*/)
+ { INT << endl; return true; }
+
+ virtual Action problem( Resolvable::constPtr /*resolvable*/ , Error /*error*/ , const std::string &/*description*/ )
+ { INT << endl; return ABORT; }
+
+ virtual void finish( Resolvable::constPtr /*resolvable*/ , Error /*error*/ , const std::string &/*reason*/ )
+ { INT << endl; }
+};
+
+bool solve()
+{
+ static unsigned run = 0;
+ USR << "Solve " << run++ << endl;
+ bool rres = false;
+ {
+ zypp::base::LogControl::TmpLineWriter shutUp;
+ rres = getZYpp()->resolver()->resolvePool();
+ }
+ if ( ! rres )
+ {
+ ERR << "resolve " << rres << endl;
+ getZYpp()->resolver()->problems();
+ return false;
+ }
+ return true;
+}
+
+bool install()
+{
+ ZYppCommitPolicy pol;
+//pol.dryRun(true);
+ pol.rpmInstFlags( pol.rpmInstFlags().setFlag( target::rpm::RPMINST_JUSTDB ) );
+ SEC << "START commit..." << endl;
+ SEC << getZYpp()->commit( pol ) << endl;
+ return true;
+}
+
+/******************************************************************
+**
+** FUNCTION NAME : main
+** FUNCTION TYPE : int
+*/
+int main( int argc, char * argv[] )
+{
+ INT << "===[START]==========================================" << endl;
+ IRR _irr;
+ RRR _rrr;
+ Pathname mroot( "/tmp/ToolScanRepos" );
+ TestSetup test( mroot, Arch_i586 );
+ test.loadTarget();
+ test.loadRepos();
+
+ ResPool pool( test.pool() );
+ ui::Selectable::Ptr sel;
+
+ getSel<Package>( "rpm" )->setToInstall();
+ vdumpPoolStats( USR << "Selected:"<< endl,
+ make_filter_beginresfilter::ByTransact(pool),
+ make_filter_endresfilter::ByTransact(pool) ) << endl;
+
+ if ( solve() )
+ {
+ vdumpPoolStats( USR << "Solved:"<< endl,
+ make_filter_beginresfilter::ByTransact(pool),
+ make_filter_endresfilter::ByTransact(pool) ) << endl;
+
+ install();
+ }
+
+ INT << "===[END]============================================" << endl << endl;
+ return 0;
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/devel/devel.ma/Test.cc new/libzypp-5.25.0/devel/devel.ma/Test.cc
--- old/libzypp-5.24.7/devel/devel.ma/Test.cc 2008-12-10 16:11:11.000000000 +0100
+++ new/libzypp-5.25.0/devel/devel.ma/Test.cc 2008-12-18 22:30:42.000000000 +0100
@@ -2,23 +2,45 @@
#include
#include
+#include
- static std::string pidAndAppname()
+static std::string pidAndAppname()
+{
+ static std::string _val;
+ if ( _val.empty() )
{
- static std::string _val;
- if ( _val.empty() )
- {
- pid_t mypid = getpid();
- Pathname p( "/proc/"+str::numstring(mypid)+"/exe" );
- Pathname myname( filesystem::readlink( p ) );
-
- _val += str::numstring(mypid);
- _val += ":";
- _val += myname.basename();
- }
- return _val;
+ pid_t mypid = getpid();
+ Pathname p( "/proc/"+str::numstring(mypid)+"/exe" );
+ Pathname myname( filesystem::readlink( p ) );
+
+ _val += str::numstring(mypid);
+ _val += ":";
+ _val += myname.basename();
+ }
+ return _val;
+}
+
+bool solve()
+{
+ static unsigned run = 0;
+ USR << "Solve " << run++ << endl;
+ bool rres = false;
+ {
+ zypp::base::LogControl::TmpLineWriter shutUp;
+ rres = getZYpp()->resolver()->resolvePool();
+ }
+ if ( ! rres )
+ {
+ ERR << "resolve " << rres << endl;
+ getZYpp()->resolver()->problems();
+ return false;
}
+ return true;
+}
+
+typedef sat::ArrayAttrstd::string,std::string FileList;
+
/******************************************************************
**
** FUNCTION NAME : main
@@ -28,37 +50,60 @@
{
INT << "===[START]==========================================" << endl;
- SEC << pidAndAppname() << endl;
-
-
- INT << "===[END]============================================" << endl << endl;
- return 0;
- Pathname mroot( "/tmp/Bb" );
+ Pathname mroot( "/tmp/ToolScanRepos" );
TestSetup test( mroot, Arch_x86_64 );
- test.loadRepo( "/Local/ROOT/cache/raw/11.1-update" );
- test.loadRepo( "/Local/ROOT/cache/raw/11.0-update" );
+ test.loadRepo("/Local/ROOT/cache/solv/@System/solv");
- sat::Pool satpool( test.satpool() );
- for_( it, satpool.reposBegin(), satpool.reposEnd() )
+ ResPool pool( test.pool() );
+ {
+ Measure x("filelist");
+ unsigned p = 0;
+ unsigned f = 0;
+ std::string a;
+ for_( it, pool.byKindBegin<Package>(), pool.byKindEnd<Package>() )
+ {
+ ++p;
+ f += (*it)->asKind<Package>()->filelist().size();
+ for_( i, (*it)->asKind<Package>()->filelist().begin(), (*it)->asKind<Package>()->filelist().end() )
+ a = *i;
+ }
+ SEC << p << " : " << f << endl;
+ }
{
- MIL << *it << endl;
- DBG << it->generatedTimestamp() << endl;
- DBG << it->suggestedExpirationTimestamp() << endl;
+ Measure x("filenames");
+ unsigned p = 0;
+ unsigned f = 0;
+ std::string a;
+ for_( it, pool.byKindBegin<Package>(), pool.byKindEnd<Package>() )
+ {
+ ++p;
+ std::liststd::string l( (*it)->asKind<Package>()->filenames() );
+ f += l.size();
+ for_( i, l.begin(), l.end() )
+ a = *i;
+ }
+ SEC << p << " : " << f << endl;
}
INT << "===[END]============================================" << endl << endl;
return 0;
- sat::LookupRepoAttr q( sat::SolvAttr::repositoryAddedFileProvides );
- USR << q << endl;
- USR << dump(q) << endl;
- for_( it, q.begin(), q.end() )
- {
- MIL << it << endl;
- }
+ //ui::Selectable::Ptr getSel( const std::string & name_r )
+ getSel<Package>( "gcompris" )->setToInstall();
+ vdumpPoolStats( USR << "Transacting:"<< endl,
+ make_filter_beginresfilter::ByTransact(pool),
+ make_filter_endresfilter::ByTransact(pool) ) << endl;
+
+ if ( solve() )
+ {
+ vdumpPoolStats( USR << "Transacting:"<< endl,
+ make_filter_beginresfilter::ByTransact(pool),
+ make_filter_endresfilter::ByTransact(pool) ) << endl;
+ SEC << getSel<Package>( "librsvg" ) << endl;
+ }
INT << "===[END]============================================" << endl << endl;
return 0;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/package/libzypp.changes new/libzypp-5.25.0/package/libzypp.changes
--- old/libzypp-5.24.7/package/libzypp.changes 2008-12-10 16:11:11.000000000 +0100
+++ new/libzypp-5.25.0/package/libzypp.changes 2008-12-18 22:30:42.000000000 +0100
@@ -1,4 +1,33 @@
-------------------------------------------------------------------
+Thu Dec 18 22:26:18 CET 2008 - ma@suse.de
+
+- Fixed lost user request to abort during commit. (bnc #388810, bnc #450273)
+- revision 11954
+- version 5.25.0 (23)
+
+-------------------------------------------------------------------
+Thu Dec 18 13:02:27 CET 2008 - ma@suse.de
+
+- Add Package::filelist, faster and less memory consuming
+ implementation of Package::filenames (now deprecated).
+- revision 11949
+
+-------------------------------------------------------------------
+Thu Dec 11 21:39:50 CET 2008 - ma@suse.de
+
+- Add str::hexencode and str::hexdecode to encode special characters
+ in a string as %XX.
+- Hexdecode modalias strings in rpm dependencies because rpm does not
+ allow comma, blank and other special chars. (bnc #456695)
+- revision 11927
+
+-------------------------------------------------------------------
+Thu Dec 11 17:13:06 CET 2008 - ma@suse.de
+
+- Catch and report media errors when proving packages. (bnc #457652)
+- revision 11926
+
+-------------------------------------------------------------------
Wed Dec 10 16:09:08 CET 2008 - ma@suse.de
- Remove obsolete zypp.conf::productsdir and deprecate
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/tests/zypp/base/String_test.cc new/libzypp-5.25.0/tests/zypp/base/String_test.cc
--- old/libzypp-5.24.7/tests/zypp/base/String_test.cc 2008-12-10 16:11:14.000000000 +0100
+++ new/libzypp-5.25.0/tests/zypp/base/String_test.cc 2008-12-18 22:30:45.000000000 +0100
@@ -225,3 +225,28 @@
BOOST_CHECK( ! str::contains("abcXabcYabc", "xabcy") );
BOOST_CHECK( str::containsCI("abcXabcYabc", "xabcy") );
}
+
+BOOST_AUTO_TEST_CASE(hexencode_hexdecode)
+{
+ std::string o;
+ o.reserve( 256 );
+ for ( unsigned i = 1; i < 256; ++i )
+ o += i;
+
+ std::string e( str::hexencode( o ) );
+ // encoded contains nothing but [%a-zA-Z0-9]
+ for ( unsigned i = 0; i < 255; ++i )
+ {
+ char ch = e[i];
+ BOOST_CHECK( ch == '%'
+ || ( 'a' <= ch && ch <= 'z' )
+ || ( 'A' <= ch && ch <= 'Z' )
+ || ( '0' <= ch && ch <= '9' ) );
+ }
+
+ std::string d( str::hexdecode( e ) );
+ BOOST_CHECK( o == d );
+// for ( unsigned i = 0; i < 255; ++i )
+// if ( o[i] != d[i] )
+// WAR << i << " " << unsigned(o[i]) << " != " << unsigned(d[i]) << endl;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/VERSION.cmake new/libzypp-5.25.0/VERSION.cmake
--- old/libzypp-5.24.7/VERSION.cmake 2008-12-10 16:11:11.000000000 +0100
+++ new/libzypp-5.25.0/VERSION.cmake 2008-12-18 22:30:42.000000000 +0100
@@ -60,9 +60,9 @@
#
SET(LIBZYPP_MAJOR "5")
SET(LIBZYPP_COMPATMINOR "23")
-SET(LIBZYPP_MINOR "24")
-SET(LIBZYPP_PATCH "7")
+SET(LIBZYPP_MINOR "25")
+SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 5.24.7 (23)
+# LAST RELEASED: 5.25.0 (23)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/base/Exception.cc new/libzypp-5.25.0/zypp/base/Exception.cc
--- old/libzypp-5.24.7/zypp/base/Exception.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/base/Exception.cc 2008-12-18 22:30:42.000000000 +0100
@@ -68,6 +68,20 @@
return _(str.str().c_str());
}
+ std::string Exception::asUserHistory() const
+ {
+ if ( historyEmpty() )
+ return asUserString();
+
+ std::string ret( asUserString() );
+ if ( ret.empty() )
+ return historyAsString();
+
+ ret += '\n';
+ ret += historyAsString();
+ return ret;
+ }
+
void Exception::remember( const Exception & old_r )
{
if ( &old_r != this ) // no self-remember
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/base/Exception.h new/libzypp-5.25.0/zypp/base/Exception.h
--- old/libzypp-5.24.7/zypp/base/Exception.h 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/base/Exception.h 2008-12-18 22:30:42.000000000 +0100
@@ -181,7 +181,9 @@
/** Error message provided by \ref dumpOn as string. */
std::string asString() const;
- /** Translated error message as string suitable for the user. */
+ /** Translated error message as string suitable for the user.
+ * \see \ref asUserStringHistory
+ */
std::string asUserString() const;
public:
@@ -227,6 +229,8 @@
*/
std::string historyAsString() const;
+ /** A single (multiline) string composed of \ref asUserString and \ref historyAsString. */
+ std::string asUserHistory() const;
//@}
protected:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/base/String.cc new/libzypp-5.25.0/zypp/base/String.cc
--- old/libzypp-5.24.7/zypp/base/String.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/base/String.cc 2008-12-18 22:30:42.000000000 +0100
@@ -83,6 +83,78 @@
);
}
+ ///////////////////////////////////////////////////////////////////
+ // Hexencode
+ ///////////////////////////////////////////////////////////////////
+ namespace {
+ /** What's not decoded. */
+ inline bool heIsAlNum( char ch )
+ {
+ return ( ( 'a' <= ch && ch <= 'z' )
+ ||( 'A' <= ch && ch <= 'Z' )
+ ||( '0' <= ch && ch <= '9' ) );
+ }
+ /** Hex-digit to number or -1. */
+ inline int heDecodeCh( char ch )
+ {
+ if ( '0' <= ch && ch <= '9' )
+ return( ch - '0' );
+ if ( 'A' <= ch && ch <= 'Z' )
+ return( ch - 'A' + 10 );
+ if ( 'a' <= ch && ch <= 'z' )
+ return( ch - 'A' + 10 );
+ return -1;
+ }
+ }
+
+ std::string hexencode( const C_Str & str_r )
+ {
+ static const char *const hdig = "0123456789ABCDEF";
+ std::string res;
+ res.reserve( str_r.size() );
+ for ( const char * it = str_r.c_str(); *it; ++it )
+ {
+ if ( heIsAlNum( *it ) )
+ {
+ res += *it;
+ }
+ else
+ {
+ res += '%';
+ res += hdig[(unsigned char)(*it)/16];
+ res += hdig[(unsigned char)(*it)%16];
+ }
+ }
+ return res;
+ }
+
+ std::string hexdecode( const C_Str & str_r )
+ {
+ std::string res;
+ res.reserve( str_r.size() );
+ for_( it, str_r.c_str(), str_r.c_str()+str_r.size() )
+ {
+ if ( *it == '%' )
+ {
+ int d1 = heDecodeCh( *(it+1) );
+ if ( d1 != -1 )
+ {
+ int d2 = heDecodeCh( *(it+2) );
+ if ( d2 != -1 )
+ {
+ res += (d1<<4)|d2;
+ it += 2;
+ continue;
+ }
+ }
+ }
+ // verbatim if no %XX:
+ res += *it;
+ }
+ return res;
+ }
+ ///////////////////////////////////////////////////////////////////
+
/******************************************************************
**
** FUNCTION NAME : toLower
@@ -285,6 +357,7 @@
}
+
/******************************************************************
**
**
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/base/String.h new/libzypp-5.25.0/zypp/base/String.h
--- old/libzypp-5.24.7/zypp/base/String.h 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/base/String.h 2008-12-18 22:30:42.000000000 +0100
@@ -584,6 +584,11 @@
*
* For use when printing \a c separated values, and where
* \ref joinEscaped() is too heavy.
+ *
+ * \todo use C_Str instead of std::string to prevent unnecessary
+ * promotion to string if used with "string".
+ *
+ * \todo shoud not be documented in doxy-group 'Join'
*/
std::string escape(const std::string & str_r, const char c = ' ' );
@@ -591,6 +596,20 @@
//@}
///////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ /** \name Hexencode.
+ * Encode all characters other than [a-zA-Z0-9] as %XX.
+ * This includes the % character itself, which becomes %25.
+ */
+ //@{
+ /** Encode all characters other than [a-zA-Z0-9] as %XX.
+ * This includes the % character itself, which becomes %25.
+ */
+ std::string hexencode( const C_Str & str_r );
+ /** Decode hexencoded %XX sequences. */
+ std::string hexdecode( const C_Str & str_r );
+ //@}
+ ///////////////////////////////////////////////////////////////////
/** \name Case conversion. */
//@{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/media/MediaAria2c.cc new/libzypp-5.25.0/zypp/media/MediaAria2c.cc
--- old/libzypp-5.24.7/zypp/media/MediaAria2c.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/media/MediaAria2c.cc 2008-12-18 22:30:42.000000000 +0100
@@ -48,9 +48,9 @@
using namespace std;
using namespace zypp::base;
-namespace zypp
+namespace zypp
{
-namespace media
+namespace media
{
Pathname MediaAria2c::_cookieFile = "/var/lib/YaST2/cookies";
@@ -70,7 +70,7 @@
};
ExternalProgram aria(argv, ExternalProgram::Stderr_To_Stdout);
-
+
std::string ariaResponse( aria.receiveLine());
string::size_type pos = ariaResponse.find('/', 0 );
if( pos != string::npos )
@@ -138,7 +138,7 @@
true ) // does_download
{
MIL << "MediaAria2c::MediaAria2c(" << url_r << ", " << attach_point_hint_r << ")" << endl;
-
+
if( !attachPoint().empty())
{
PathInfo ainfo(attachPoint());
@@ -169,7 +169,7 @@
void MediaAria2c::attachTo (bool next)
{
// clear last arguments
- _args.clear();
+ _args.clear();
if ( next )
ZYPP_THROW(MediaNotSupportedException(_url));
@@ -187,7 +187,7 @@
setAttachPoint( mountpoint, true);
}
- disconnectFrom();
+ disconnectFrom();
// Build the aria command.
_args.push_back(_aria2cPath.asString());
@@ -195,12 +195,12 @@
_args.push_back("--summary-interval=1");
_args.push_back("--follow-metalink=mem");
_args.push_back( "--check-integrity=true");
-
+
// add the anonymous id.
_args.push_back(str::form("--header=%s", anonymousIdHeader() ));
_args.push_back(str::form("--header=%s", distributionFlavorHeader() ));
// TODO add debug option
-
+
// Transfer timeout
{
_xfer_timeout = TRANSFER_TIMEOUT;
@@ -231,11 +231,11 @@
DBG << "Anonymous FTP identification: '" << id << "'" << endl;
_userpwd = "anonymous:" + id;
}
- }
- else
+ }
+ else
{
if ( _url.getScheme() == "ftp" )
- {
+ {
_args.push_back(str::form("--ftp-user=%s", _url.getUsername().c_str() ));
}
else if ( _url.getScheme() == "http" ||
@@ -243,11 +243,11 @@
{
_args.push_back(str::form("--http-user=%s", _url.getUsername().c_str() ));
}
-
+
if ( _url.getPassword().size() )
{
if ( _url.getScheme() == "ftp" )
- {
+ {
_args.push_back(str::form("--ftp-passwd=%s", _url.getPassword().c_str() ));
}
else if ( _url.getScheme() == "http" ||
@@ -260,7 +260,7 @@
// note, aria2c does not support setting the auth type with
// (basic, digest yet)
-
+
/*---------------------------------------------------------------*
CURLOPT_PROXY: host[:port]
@@ -343,7 +343,7 @@
if ( ! _proxyuserpwd.empty() ) {
_args.push_back(str::form("--http-proxy-user=%s", _proxyuserpwd.c_str() ));
-
+
string proxypassword( _url.getQueryParam( "proxypassword" ) );
if ( ! proxypassword.empty() ) {
_args.push_back(str::form("--http-proxy-passwd=%s", proxypassword.c_str() ));
@@ -358,7 +358,7 @@
// FIXME: need a derived class to propelly compare url's
MediaSourceRef media( new MediaSource(_url.getScheme(), _url.asString()));
setMediaSource(media);
-
+
}
bool
@@ -407,7 +407,7 @@
void MediaAria2c::getFile( const Pathname & filename ) const
{
// Use absolute file name to prevent access of files outside of the
- // hierarchy below the attach point.
+ // hierarchy below the attach point.
getFileCopy(filename, localPath(filename).absolutename());
}
@@ -415,28 +415,28 @@
{
callback::SendReport<DownloadProgressReport> report;
- Url fileurl(getFileUrl(_url, filename));
+ Url fileurl(getFileUrl(_url, filename));
bool retry = false;
ExternalProgram::Arguments args = _args;
args.push_back(str::form("--dir=%s", target.dirname().c_str()));
args.push_back(fileurl.asString());
-
+
do
{
try
- {
- report->start(_url, target.asString() );
-
- ExternalProgram aria(args, ExternalProgram::Stderr_To_Stdout);
- int nLine = 0;
+ {
+ report->start(_url, target.asString() );
+
+ ExternalProgram aria(args, ExternalProgram::Stderr_To_Stdout);
+ int nLine = 0;
//Process response
for(std::string ariaResponse( aria.receiveLine());
- ariaResponse.length();
+ ariaResponse.length();
ariaResponse = aria.receiveLine())
- {
+ {
//cout << ariaResponse;
if (!ariaResponse.substr(0,31).compare("Exception: Authorization failed") )
@@ -448,11 +448,11 @@
if (!ariaResponse.substr(0,29).compare("Exception: Resource not found") )
{
ZYPP_THROW(MediaFileNotFoundException(_url, filename));
- }
+ }
if (!ariaResponse.substr(0,9).compare("[#2 SIZE:")) {
-
- if (!nLine)
+
+ if (!nLine)
{
size_t left_bound = ariaResponse.find('(',0) + 1;
size_t count = ariaResponse.find('%',left_bound) - left_bound;
@@ -460,19 +460,19 @@
//progressData.toMax();
report->progress ( std::atoi(ariaResponse.substr(left_bound, count).c_str()), _url, -1, -1 );
nLine = 1;
- }
+ }
else
{
nLine = 0;
- }
- }
+ }
+ }
}
aria.close();
-
+
report->finish( _url , zypp::media::DownloadProgressReport::NO_ERROR, "");
retry = false;
}
-
+
// retry with proper authentication data
catch (MediaUnauthorizedException & ex_r)
{
@@ -480,7 +480,7 @@
retry = true;
else
{
- report->finish(fileurl, zypp::media::DownloadProgressReport::ACCESS_DENIED, ex_r.asUserString());
+ report->finish(fileurl, zypp::media::DownloadProgressReport::ACCESS_DENIED, ex_r.asUserHistory());
ZYPP_RETHROW(ex_r);
}
@@ -489,7 +489,7 @@
catch (MediaException & excpt_r)
{
// FIXME: error number fix
- report->finish(fileurl, zypp::media::DownloadProgressReport::ERROR, excpt_r.asUserString());
+ report->finish(fileurl, zypp::media::DownloadProgressReport::ERROR, excpt_r.asUserHistory());
ZYPP_RETHROW(excpt_r);
}
}
@@ -530,7 +530,7 @@
bool MediaAria2c::doGetDoesFileExist( const Pathname & filename ) const
{
-
+
DBG << filename.asString() << endl;
return true;
}
@@ -584,7 +584,7 @@
getDirectoryYast( retlist, dirname, dots );
}
-std::string MediaAria2c::getAria2cVersion()
+std::string MediaAria2c::getAria2cVersion()
{
const char* argv[] =
{
@@ -605,7 +605,7 @@
Pathname MediaAria2c::whereisAria2c()
{
Pathname aria2cPathr(ARIA_DEFAULT_BINARY);
-
+
const char* argv[] =
{
"whereis",
@@ -615,23 +615,23 @@
};
ExternalProgram aria(argv, ExternalProgram::Stderr_To_Stdout);
-
+
std::string ariaResponse( aria.receiveLine());
aria.close();
-
+
string::size_type pos = ariaResponse.find('/', 0 );
- if( pos != string::npos )
+ if( pos != string::npos )
{
aria2cPathr = ariaResponse;
string::size_type pose = ariaResponse.find(' ', pos + 1 );
aria2cPathr = ariaResponse.substr( pos , pose - pos );
MIL << "We will use aria2c located here: " << ariaResponse.substr( pos , pose - pos) << endl;
}
- else
+ else
{
MIL << "We don't know were is ari2ac binary. We will use aria2c located here: " << aria2cPathr << endl;
}
-
+
return aria2cPathr;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/media/MediaCurl.cc new/libzypp-5.25.0/zypp/media/MediaCurl.cc
--- old/libzypp-5.24.7/zypp/media/MediaCurl.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/media/MediaCurl.cc 2008-12-18 22:30:42.000000000 +0100
@@ -846,7 +846,7 @@
retry = true;
else
{
- report->finish(fileurl, zypp::media::DownloadProgressReport::ACCESS_DENIED, ex_r.asUserString());
+ report->finish(fileurl, zypp::media::DownloadProgressReport::ACCESS_DENIED, ex_r.asUserHistory());
ZYPP_RETHROW(ex_r);
}
}
@@ -854,7 +854,7 @@
catch (MediaException & excpt_r)
{
// FIXME: error number fix
- report->finish(fileurl, zypp::media::DownloadProgressReport::ERROR, excpt_r.asUserString());
+ report->finish(fileurl, zypp::media::DownloadProgressReport::ERROR, excpt_r.asUserHistory());
ZYPP_RETHROW(excpt_r);
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/Package.cc new/libzypp-5.25.0/zypp/Package.cc
--- old/libzypp-5.24.7/zypp/Package.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/Package.cc 2008-12-18 22:30:42.000000000 +0100
@@ -122,15 +122,13 @@
return ret;
}
+ Package::FileList Package::filelist() const
+ { return FileList( sat::SolvAttr::filelist, satSolvable() ); }
+
std::liststd::string Package::filenames() const
{
- std::liststd::string files;
- sat::LookupAttr q( sat::SolvAttr::filelist, *this );
- for_( it, q.begin(), q.end() )
- {
- files.push_back(it.asString());
- }
- return files;
+ FileList f( filelist() );
+ return std::liststd::string( f.begin(), f.end() );
}
CheckSum Package::checksum() const
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/Package.h new/libzypp-5.25.0/zypp/Package.h
--- old/libzypp-5.24.7/zypp/Package.h 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/Package.h 2008-12-18 22:30:42.000000000 +0100
@@ -39,13 +39,14 @@
public:
typedef sat::ArrayAttr Keywords;
+ typedef sat::ArrayAttrstd::string,std::string FileList;
public:
/**
* Returns the level of supportability the vendor
* gives to this package.
- *
+ *
* This is one value from \ref VendorSupportOption
*/
VendorSupportOption vendorSupport() const;
@@ -77,8 +78,15 @@
ByteCount sourcesize() const;
/** */
std::liststd::string authors() const;
- /** */
- std::liststd::string filenames() const;
+
+ /** Return the packages filelist (if available).
+ * The returned \ref FileList appears to be a container of
+ * \c std::string. In fact it is a query, so it does not
+ * consume much memory.
+ */
+ FileList filelist() const;
+ /** \deprecated Use filelist, it's faster and saves memory. */
+ std::liststd::string filenames() const ZYPP_DEPRECATED;
/** Name of the source rpm this package was built from.
*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/repo/PackageProvider.cc new/libzypp-5.25.0/zypp/repo/PackageProvider.cc
--- old/libzypp-5.24.7/zypp/repo/PackageProvider.cc 2008-12-10 16:11:11.000000000 +0100
+++ new/libzypp-5.25.0/zypp/repo/PackageProvider.cc 2008-12-18 22:30:42.000000000 +0100
@@ -103,14 +103,44 @@
{
ret = doProvidePackage();
}
- catch ( const Exception & excpt )
+ catch ( const UserRequestException & excpt )
{
+ // UserRequestException e.g. from failOnChecksumError was already reported.
ERR << "Failed to provide Package " << _package << endl;
if ( ! _retry )
{
ZYPP_RETHROW( excpt );
}
}
+ catch ( const Exception & excpt )
+ {
+ ERR << "Failed to provide Package " << _package << endl;
+ if ( ! _retry )
+ {
+ // Aything else gets reported
+ std::string package_str = _package->name() + "-" + _package->edition().asString();
+
+ // TranslatorExplanation %s = name of the package being processed.
+ std::string detail_str( str::form(_("Failed to provide Package %s. Do you want to retry retrieval?"), package_str.c_str() ) );
+ detail_str += str::form( "\n\n%s", excpt.asUserHistory().c_str() );
+
+ switch ( report()->problem( _package, repo::DownloadResolvableReport::IO, detail_str.c_str() ) )
+ {
+ case repo::DownloadResolvableReport::RETRY:
+ _retry = true;
+ break;
+ case repo::DownloadResolvableReport::IGNORE:
+ ZYPP_THROW(SkipRequestException("User requested skip of corrupted file"));
+ break;
+ case repo::DownloadResolvableReport::ABORT:
+ ZYPP_THROW(AbortRequestException("User requested to abort"));
+ break;
+ default:
+ ZYPP_RETHROW( excpt );
+ break;
+ }
+ }
+ }
} while ( _retry );
report()->finish( _package, repo::DownloadResolvableReport::NO_ERROR, std::string() );
@@ -184,7 +214,7 @@
}
catch ( const Exception & excpt )
{
- report()->problemDeltaDownload( excpt.asUserString() );
+ report()->problemDeltaDownload( excpt.asUserHistory() );
return ManagedFile();
}
report()->finishDeltaDownload();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/sat/detail/PoolImpl.cc new/libzypp-5.25.0/zypp/sat/detail/PoolImpl.cc
--- old/libzypp-5.24.7/zypp/sat/detail/PoolImpl.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/sat/detail/PoolImpl.cc 2008-12-18 22:30:42.000000000 +0100
@@ -107,7 +107,11 @@
case NAMESPACE_MODALIAS:
{
- return target::Modalias::instance().query( IdString(rhs) ) ? RET_systemProperty : RET_unsupported;
+ // modalias strings in capability may be hexencoded because rpm does not allow
+ // ',', ' ' or other special chars.
+ return target::Modalias::instance().query( str::hexdecode( IdString(rhs).c_str() ) )
+ ? RET_systemProperty
+ : RET_unsupported;
}
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/sat/LookupAttrTools.h new/libzypp-5.25.0/zypp/sat/LookupAttrTools.h
--- old/libzypp-5.24.7/zypp/sat/LookupAttrTools.h 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/sat/LookupAttrTools.h 2008-12-18 22:30:42.000000000 +0100
@@ -172,7 +172,8 @@
{}
public:
- typedef sat::LookupAttr::transformIterator<_ResultT,_AttrT> iterator;
+ typedef LookupAttr::transformIterator<_ResultT,_AttrT> iterator;
+ typedef LookupAttr::size_type size_type;
iterator begin() const
{ return iterator( _q.begin() ); }
@@ -183,6 +184,14 @@
bool empty() const
{ return _q.empty(); }
+ size_type size() const
+ {
+ size_type count = 0;
+ for_( it, begin(), end() )
+ ++count;
+ return count;
+ }
+
public:
iterator find( const _ResultT & key_r ) const
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/target/rpm/RpmDb.cc new/libzypp-5.25.0/zypp/target/rpm/RpmDb.cc
--- old/libzypp-5.24.7/zypp/target/rpm/RpmDb.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/target/rpm/RpmDb.cc 2008-12-18 22:30:42.000000000 +0100
@@ -828,7 +828,7 @@
}
catch (RpmException & excpt_r)
{
- report->finish(root() + dbPath(), RebuildDBReport::FAILED, excpt_r.asUserString());
+ report->finish(root() + dbPath(), RebuildDBReport::FAILED, excpt_r.asUserHistory());
ZYPP_RETHROW(excpt_r);
}
report->finish(root() + dbPath(), RebuildDBReport::NO_ERROR, "");
@@ -1238,7 +1238,7 @@
}
catch (RpmException & excpt_r)
{
- report->finish(ScanDBReport::FAILED, excpt_r.asUserString ());
+ report->finish(ScanDBReport::FAILED, excpt_r.asUserHistory ());
ZYPP_RETHROW(excpt_r);
}
#warning fixme
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/target/TargetCallbackReceiver.cc new/libzypp-5.25.0/zypp/target/TargetCallbackReceiver.cc
--- old/libzypp-5.24.7/zypp/target/TargetCallbackReceiver.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/target/TargetCallbackReceiver.cc 2008-12-18 22:30:42.000000000 +0100
@@ -32,17 +32,17 @@
RpmInstallPackageReceiver::~RpmInstallPackageReceiver ()
{
}
-
- void RpmInstallPackageReceiver::reportbegin()
+
+ void RpmInstallPackageReceiver::reportbegin()
{
}
-
- void RpmInstallPackageReceiver::reportend()
+
+ void RpmInstallPackageReceiver::reportend()
{
}
/** Start the operation */
- void RpmInstallPackageReceiver::start( const Pathname & name )
+ void RpmInstallPackageReceiver::start( const Pathname & name )
{
_report->start( _resolvable );
_abort = false;
@@ -57,26 +57,27 @@
_abort = ! _report->progress( percent, _resolvable );
return _abort;
}
-
- rpm::RpmInstallReport::Action
+
+ rpm::RpmInstallReport::Action
RpmInstallPackageReceiver::problem( Exception & excpt_r )
{
- rpm::InstallResolvableReport::Action user =
+ rpm::InstallResolvableReport::Action user =
_report->problem( _resolvable
, rpm::InstallResolvableReport::INVALID
- , excpt_r.asUserString()
+ , excpt_r.asUserHistory()
, _level
);
-
+
switch (user) {
- case rpm::InstallResolvableReport::RETRY:
+ case rpm::InstallResolvableReport::RETRY:
return rpm::RpmInstallReport::RETRY;
- case rpm::InstallResolvableReport::ABORT:
+ case rpm::InstallResolvableReport::ABORT:
+ _abort = true;
return rpm::RpmInstallReport::ABORT;
- case rpm::InstallResolvableReport::IGNORE:
+ case rpm::InstallResolvableReport::IGNORE:
return rpm::RpmInstallReport::IGNORE;
}
-
+
return rpm::RpmInstallReport::problem( excpt_r );
}
@@ -91,7 +92,7 @@
{
_report->finish( _resolvable, rpm::InstallResolvableReport::INVALID, std::string(), _level );
}
-
+
void RpmInstallPackageReceiver::tryLevel( target::rpm::InstallResolvableReport::RpmLevel level_r )
{
_level = level_r;
@@ -112,19 +113,20 @@
RpmRemovePackageReceiver::~RpmRemovePackageReceiver ()
{
}
-
- void RpmRemovePackageReceiver::reportbegin()
+
+ void RpmRemovePackageReceiver::reportbegin()
{
}
-
- void RpmRemovePackageReceiver::reportend()
+
+ void RpmRemovePackageReceiver::reportend()
{
}
/** Start the operation */
- void RpmRemovePackageReceiver::start( const std::string & name )
+ void RpmRemovePackageReceiver::start( const std::string & name )
{
_report->start( _resolvable );
+ _abort = false;
}
/**
@@ -136,25 +138,26 @@
_abort = ! _report->progress( percent, _resolvable );
return _abort;
}
-
- rpm::RpmRemoveReport::Action
+
+ rpm::RpmRemoveReport::Action
RpmRemovePackageReceiver::problem( Exception & excpt_r )
{
- rpm::RemoveResolvableReport::Action user =
+ rpm::RemoveResolvableReport::Action user =
_report->problem( _resolvable
, rpm::RemoveResolvableReport::INVALID
- , excpt_r.asUserString()
+ , excpt_r.asUserHistory()
);
-
+
switch (user) {
- case rpm::RemoveResolvableReport::RETRY:
+ case rpm::RemoveResolvableReport::RETRY:
return rpm::RpmRemoveReport::RETRY;
- case rpm::RemoveResolvableReport::ABORT:
+ case rpm::RemoveResolvableReport::ABORT:
+ _abort = true;
return rpm::RpmRemoveReport::ABORT;
- case rpm::RemoveResolvableReport::IGNORE:
+ case rpm::RemoveResolvableReport::IGNORE:
return rpm::RpmRemoveReport::IGNORE;
}
-
+
return rpm::RpmRemoveReport::problem( excpt_r );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.24.7/zypp/target/TargetImpl.cc new/libzypp-5.25.0/zypp/target/TargetImpl.cc
--- old/libzypp-5.24.7/zypp/target/TargetImpl.cc 2008-12-10 16:11:12.000000000 +0100
+++ new/libzypp-5.25.0/zypp/target/TargetImpl.cc 2008-12-18 22:30:42.000000000 +0100
@@ -616,6 +616,11 @@
MIL << "Target loaded: " << system.solvablesSize() << " resolvables" << endl;
}
+ ///////////////////////////////////////////////////////////////////
+ //
+ // COMMIT
+ //
+ ///////////////////////////////////////////////////////////////////
ZYppCommitResult TargetImpl::commit( ResPool pool_r, const ZYppCommitPolicy & policy_rX )
{
// ----------------------------------------------------------------- //
@@ -702,7 +707,7 @@
///////////////////////////////////////////////////////////////////
// Remove/install packages.
///////////////////////////////////////////////////////////////////
- commit (to_uninstall, policy_r, pool_r );
+ commit ( to_uninstall, policy_r, pool_r );
if (policy_r.restrictToMedia() == 0)
{ // commit all
@@ -765,6 +770,11 @@
}
+ ///////////////////////////////////////////////////////////////////
+ //
+ // COMMIT internal
+ //
+ ///////////////////////////////////////////////////////////////////
TargetImpl::PoolItemList
TargetImpl::commit( const TargetImpl::PoolItemList & items_r,
const ZYppCommitPolicy & policy_r,
@@ -794,6 +804,12 @@
{
localfile = packageCache.get( it );
}
+ catch ( const AbortRequestException &e )
+ {
+ WAR << "commit aborted by the user" << endl;
+ abort = true;
+ break;
+ }
catch ( const SkipRequestException &e )
{
ZYPP_CAUGHT( e );
@@ -812,8 +828,9 @@
#warning Exception handling
// create a installation progress report proxy
RpmInstallPackageReceiver progress( it->resolvable() );
- progress.connect();
- bool success = true;
+ progress.connect(); // disconnected on destruction.
+
+ bool success = false;
rpm::RpmInstFlags flags;
// Why force and nodeps?
//
@@ -839,27 +856,34 @@
if ( progress.aborted() )
{
WAR << "commit aborted by the user" << endl;
- progress.disconnect();
- success = false;
abort = true;
break;
}
+ else
+ {
+ success = true;
+ }
}
- catch (Exception & excpt_r)
+ catch ( Exception & excpt_r )
{
ZYPP_CAUGHT(excpt_r);
if ( policy_r.dryRun() )
{
WAR << "dry run failed" << endl;
- progress.disconnect();
break;
}
// else
- WAR << "Install failed" << endl;
+ if ( progress.aborted() )
+ {
+ WAR << "commit aborted by the user" << endl;
+ abort = true;
+ }
+ else
+ {
+ WAR << "Install failed" << endl;
+ }
remaining.push_back( *it );
- progress.disconnect();
- success = false;
- break;
+ break; // stop
}
if ( success && !policy_r.dryRun() )
@@ -868,14 +892,13 @@
// Remember to check this package for presence of patch scripts.
successfullyInstalledPackages.push_back( it->satSolvable() );
}
- progress.disconnect();
}
else
{
- bool success = true;
-
RpmRemovePackageReceiver progress( it->resolvable() );
- progress.connect();
+ progress.connect(); // disconnected on destruction.
+
+ bool success = false;
rpm::RpmInstFlags flags( rpm::RPMINST_NODEPS );
if (policy_r.dryRun()) flags |= rpm::RPMINST_TEST;
try
@@ -886,24 +909,30 @@
if ( progress.aborted() )
{
WAR << "commit aborted by the user" << endl;
- progress.disconnect();
- success = false;
abort = true;
break;
}
+ else
+ {
+ success = true;
+ }
}
catch (Exception & excpt_r)
{
- WAR << "removal of " << p << " failed";
- success = false;
ZYPP_CAUGHT( excpt_r );
+ if ( progress.aborted() )
+ {
+ WAR << "commit aborted by the user" << endl;
+ abort = true;
+ break;
+ }
+ // else
+ WAR << "removal of " << p << " failed";
}
- if (success
- && !policy_r.dryRun())
+ if ( success && !policy_r.dryRun() )
{
it->status().resetTransact( ResStatus::USER );
}
- progress.disconnect();
}
}
else if ( ! policy_r.dryRun() ) // other resolvables (non-Package)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org