Hello community, here is the log from the commit of package libzypp for openSUSE:Factory checked in at 2014-12-21 12:02:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzypp (Old) and /work/SRC/openSUSE:Factory/.libzypp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzypp" Changes: -------- --- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes 2014-12-16 14:51:09.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libzypp.new/libzypp.changes 2014-12-21 12:01:04.000000000 +0100 @@ -1,0 +2,25 @@ +Fri Dec 19 10:05:00 CET 2014 - m...@suse.de + +- Parse and offer productRegisterFlavor attribute (bnc#896224) +- version 14.33.0 (30) + +------------------------------------------------------------------- +Thu Dec 18 01:13:20 CET 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Wed Dec 17 18:44:26 CET 2014 - m...@suse.de + +- Improve conflict message for locked packages (bnc#828631) +- Fix broken de-escaping in str::splitEscaped (bnc#909772) +- cleanup loging +- version 14.32.2 (30) + +------------------------------------------------------------------- +Fri Dec 12 14:00:01 CET 2014 - m...@suse.de + +- CheckAccessDeleted: Filter PIDs running in a container (bnc#909143) +- version 14.32.1 (30) + +------------------------------------------------------------------- Old: ---- libzypp-14.32.0.tar.bz2 New: ---- libzypp-14.33.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp.spec ++++++ --- /var/tmp/diff_new_pack.B7FjVo/_old 2014-12-21 12:01:06.000000000 +0100 +++ /var/tmp/diff_new_pack.B7FjVo/_new 2014-12-21 12:01:06.000000000 +0100 @@ -19,7 +19,7 @@ %define force_gcc_46 0 Name: libzypp -Version: 14.32.0 +Version: 14.33.0 Release: 0 Url: git://gitorious.org/opensuse/libzypp.git Summary: Package, Patch, Pattern, and Product Management @@ -75,7 +75,7 @@ BuildRequires: pkg-config %endif -BuildRequires: libsolv-devel >= 0.6.6 +BuildRequires: libsolv-devel >= 0.6.7 %if 0%{?suse_version} >= 1100 BuildRequires: libsolv-tools %requires_eq libsolv-tools ++++++ libzypp-14.32.0.tar.bz2 -> libzypp-14.33.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/VERSION.cmake new/libzypp-14.33.0/VERSION.cmake --- old/libzypp-14.32.0/VERSION.cmake 2014-12-10 16:09:01.000000000 +0100 +++ new/libzypp-14.33.0/VERSION.cmake 2014-12-19 13:37:01.000000000 +0100 @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "14") SET(LIBZYPP_COMPATMINOR "30") -SET(LIBZYPP_MINOR "32") +SET(LIBZYPP_MINOR "33") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 14.32.0 (30) +# LAST RELEASED: 14.33.0 (30) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/cmake/modules/FindGettext.cmake new/libzypp-14.33.0/cmake/modules/FindGettext.cmake --- old/libzypp-14.32.0/cmake/modules/FindGettext.cmake 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/cmake/modules/FindGettext.cmake 2014-12-17 18:49:01.000000000 +0100 @@ -49,6 +49,8 @@ ADD_CUSTOM_COMMAND( OUTPUT ${TRANSLATION_SET_CONTENT} COMMAND tar xfj ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET} + COMMAND sed -i '/^msgid/s/do not forbid installation of %s/remove lock to allow installation of %s/' *.po + COMMAND sed -i '/^msgid/s/do not keep %s installed/remove lock to allow removal of %s/' *.po DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/libzypp.spec.cmake new/libzypp-14.33.0/libzypp.spec.cmake --- old/libzypp-14.32.0/libzypp.spec.cmake 2014-11-27 15:08:48.000000000 +0100 +++ new/libzypp-14.33.0/libzypp.spec.cmake 2014-12-19 13:37:01.000000000 +0100 @@ -75,7 +75,7 @@ BuildRequires: pkg-config %endif -BuildRequires: libsolv-devel >= 0.6.6 +BuildRequires: libsolv-devel >= 0.6.7 %if 0%{?suse_version} >= 1100 BuildRequires: libsolv-tools %requires_eq libsolv-tools diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/package/libzypp.changes new/libzypp-14.33.0/package/libzypp.changes --- old/libzypp-14.32.0/package/libzypp.changes 2014-12-10 16:09:01.000000000 +0100 +++ new/libzypp-14.33.0/package/libzypp.changes 2014-12-19 13:37:01.000000000 +0100 @@ -1,4 +1,29 @@ ------------------------------------------------------------------- +Fri Dec 19 10:05:00 CET 2014 - m...@suse.de + +- Parse and offer productRegisterFlavor attribute (bnc#896224) +- version 14.33.0 (30) + +------------------------------------------------------------------- +Thu Dec 18 01:13:20 CET 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Wed Dec 17 18:44:26 CET 2014 - m...@suse.de + +- Improve conflict message for locked packages (bnc#828631) +- Fix broken de-escaping in str::splitEscaped (bnc#909772) +- cleanup loging +- version 14.32.2 (30) + +------------------------------------------------------------------- +Fri Dec 12 14:00:01 CET 2014 - m...@suse.de + +- CheckAccessDeleted: Filter PIDs running in a container (bnc#909143) +- version 14.32.1 (30) + +------------------------------------------------------------------- Wed Dec 10 16:06:04 CET 2014 - m...@suse.de - suppress informal license (no need to accept) upon update (bnc#908976) Files old/libzypp-14.32.0/po/zypp-po.tar.bz2 and new/libzypp-14.33.0/po/zypp-po.tar.bz2 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/tests/parser/ProductFileReader_test.cc new/libzypp-14.33.0/tests/parser/ProductFileReader_test.cc --- old/libzypp-14.32.0/tests/parser/ProductFileReader_test.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/tests/parser/ProductFileReader_test.cc 2014-12-19 13:37:01.000000000 +0100 @@ -19,6 +19,7 @@ BOOST_CHECK_EQUAL( data.productline(), "" ); BOOST_CHECK_EQUAL( data.registerTarget(), "sle-11-i586" ); BOOST_CHECK_EQUAL( data.registerRelease(), "whatever" ); + BOOST_CHECK_EQUAL( data.registerFlavor(), "module" ); BOOST_CHECK_EQUAL( data.updaterepokey(), "A43242DKD" ); BOOST_REQUIRE_EQUAL( data.upgrades().size(), 2 ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/tests/parser/ProductFileReader_test.dat new/libzypp-14.33.0/tests/parser/ProductFileReader_test.dat --- old/libzypp-14.32.0/tests/parser/ProductFileReader_test.dat 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/tests/parser/ProductFileReader_test.dat 2014-12-19 13:37:01.000000000 +0100 @@ -39,6 +39,7 @@ <register> <target>sle-11-i586</target> <release>whatever</release> + <flavor>module</flavor> </register> <buildconfig> <!-- This section is needed to generate the installation media --> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/tests/zypp/base/String_test.cc new/libzypp-14.33.0/tests/zypp/base/String_test.cc --- old/libzypp-14.32.0/tests/zypp/base/String_test.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/tests/zypp/base/String_test.cc 2014-12-17 18:49:02.000000000 +0100 @@ -45,45 +45,88 @@ string s( "simple non-escaped string" ); vector<string> v; - insert_iterator<vector<string> > ii (v,v.end()); - splitEscaped( s, ii ); + splitEscaped( s, std::back_inserter(v) ); BOOST_CHECK_EQUAL( v.size(), 3 ); + BOOST_CHECK_EQUAL( v[0], "simple" ); + BOOST_CHECK_EQUAL( v[1], "non-escaped" ); + BOOST_CHECK_EQUAL( v[2], "string" ); v.clear(); s = string( "\"escaped sentence \"" ); - ii = insert_iterator<vector<string> >( v, v.end() ); - splitEscaped( s, ii ); + splitEscaped( s, std::back_inserter(v) ); BOOST_CHECK_EQUAL( v.size(), 1 ); - BOOST_CHECK_EQUAL( v.front(), string( "escaped sentence " ) ); + BOOST_CHECK_EQUAL( v[0], "escaped sentence " ); v.clear(); s = string( "\"escaped \\\\sent\\\"ence \\\\\"" ); - ii = insert_iterator<vector<string> >( v, v.end() ); - splitEscaped( s, ii ); + splitEscaped( s, std::back_inserter(v) ); BOOST_CHECK_EQUAL( v.size(), 1 ); - BOOST_CHECK_EQUAL( v.front(), string( "escaped \\sent\"ence \\" ) ); - + BOOST_CHECK_EQUAL( v[0], "escaped \\sent\"ence \\" ); v.clear(); s = string( "escaped sentence\\ with\\ space" ); - ii = insert_iterator<vector<string> >( v, v.end() ); - splitEscaped( s, ii ); + splitEscaped( s, std::back_inserter(v) ); BOOST_CHECK_EQUAL( v.size(), 2 ); - BOOST_CHECK_EQUAL( v[1], string( "sentence with space" ) ); + BOOST_CHECK_EQUAL( v[0], "escaped" ); + BOOST_CHECK_EQUAL( v[1], "sentence with space" ); // split - join v.clear(); s = "some line \"\" foo\\ a foo\\\\ b"; str::splitEscaped( s, std::back_inserter(v) ); + BOOST_CHECK_EQUAL( v.size(), 6 ); + BOOST_CHECK_EQUAL( v[0], "some" ); + BOOST_CHECK_EQUAL( v[1], "line" ); + BOOST_CHECK_EQUAL( v[2], "" ); + BOOST_CHECK_EQUAL( v[3], "foo a" ); + BOOST_CHECK_EQUAL( v[4], "foo\\" ); + BOOST_CHECK_EQUAL( v[5], "b" ); BOOST_CHECK_EQUAL( s, str::joinEscaped( v.begin(), v.end() ) ); // split - join using alternate sepchar s = str::joinEscaped( v.begin(), v.end(), 'o' ); v.clear(); str::splitEscaped( s, std::back_inserter(v), "o" ); + BOOST_CHECK_EQUAL( v.size(), 6 ); + BOOST_CHECK_EQUAL( v[0], "some" ); + BOOST_CHECK_EQUAL( v[1], "line" ); + BOOST_CHECK_EQUAL( v[2], "" ); + BOOST_CHECK_EQUAL( v[3], "foo a" ); + BOOST_CHECK_EQUAL( v[4], "foo\\" ); + BOOST_CHECK_EQUAL( v[5], "b" ); BOOST_CHECK_EQUAL( s, str::joinEscaped( v.begin(), v.end(), 'o' ) ); } +BOOST_AUTO_TEST_CASE(bnc_909772) +{ + // While \-escaping processes single-quote, double-quote, backslash and sepchar[ ] + // deescaping failed to process the quotes correctly. + std::string s; + std::vector<std::string> v; + + v.clear(); + v.push_back(""); + v.push_back("'\" \\"); + v.push_back("\\'\\\"\\ \\\\"); + s = str::joinEscaped( v.begin(), v.end() ); + BOOST_CHECK_EQUAL( s, "\"\"" " " "\\'\\\"\\ \\\\" " " "\\\\\\'\\\\\\\"\\\\\\ \\\\\\\\" ); + + s += " "; + s += "'" "\\\\\" \\ \\\\" "'\\ single"; // single quote: all literal, no ' inside + + s += " "; + s += "\"" "\\'\\\" \\ \\\\" "\"\\ double";// double quote: all literal except \\ \" + + v.clear(); + splitEscaped( s, std::back_inserter(v) ); + BOOST_CHECK_EQUAL( v.size(), 5 ); + BOOST_CHECK_EQUAL( v[0], "" ); + BOOST_CHECK_EQUAL( v[1], "'\" \\" ); + BOOST_CHECK_EQUAL( v[2], "\\'\\\"\\ \\\\" ); + BOOST_CHECK_EQUAL( v[3], "\\\\\" \\ \\\\ single" ); + BOOST_CHECK_EQUAL( v[4], "\\'\" \\ \\ double" ); +} + BOOST_AUTO_TEST_CASE(testsplitEscapedWithEmpty) { string s( "simple:non-escaped:string" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/Date.h new/libzypp-14.33.0/zypp/Date.h --- old/libzypp-14.32.0/zypp/Date.h 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/Date.h 2014-12-19 13:37:01.000000000 +0100 @@ -61,7 +61,7 @@ : _date( date_r ) {} /** Ctor taking time_t value as string. */ - Date( const std::string & seconds_r ); + explicit Date( const std::string & seconds_r ); /** * Ctor from a \a date_str (in localtime) formatted using \a format. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/Product.cc new/libzypp-14.33.0/zypp/Product.cc --- old/libzypp-14.32.0/zypp/Product.cc 2014-09-05 12:49:26.000000000 +0200 +++ new/libzypp-14.33.0/zypp/Product.cc 2014-12-19 13:37:01.000000000 +0100 @@ -238,6 +238,9 @@ std::string Product::registerRelease() const { return lookupStrAttribute( sat::SolvAttr::productRegisterRelease ); } + std::string Product::registerFlavor() const + { return lookupStrAttribute( sat::SolvAttr::productRegisterFlavor ); } + ///////////////////////////////////////////////////////////////// Product::UrlList Product::urls( const std::string & key_r ) const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/Product.h new/libzypp-14.33.0/zypp/Product.h --- old/libzypp-14.32.0/zypp/Product.h 2014-09-05 12:49:26.000000000 +0200 +++ new/libzypp-14.33.0/zypp/Product.h 2014-12-19 13:37:01.000000000 +0100 @@ -132,6 +132,11 @@ */ std::string registerRelease() const; + /** This is \c register.flavor attribute of a product. + * Used for registration. + */ + std::string registerFlavor() const; + public: /***/ class UrlList; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/SysContent.cc new/libzypp-14.33.0/zypp/SysContent.cc --- old/libzypp-14.32.0/zypp/SysContent.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/SysContent.cc 2014-12-19 13:37:01.000000000 +0100 @@ -335,7 +335,7 @@ virtual void text( const Node & node_r ) { - *_value = node_r.value().asString(); + *_value = Date(node_r.value().asString()); } Date *_value; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/Target.cc new/libzypp-14.33.0/zypp/Target.cc --- old/libzypp-14.32.0/zypp/Target.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/Target.cc 2014-12-19 13:37:01.000000000 +0100 @@ -121,6 +121,11 @@ std::string Target::targetDistributionRelease( const Pathname & root_r ) { return target::TargetImpl::targetDistributionRelease( root_r ); } + std::string Target::targetDistributionFlavor() const + { return _pimpl->targetDistributionFlavor(); } + std::string Target::targetDistributionFlavor( const Pathname & root_r ) + { return target::TargetImpl::targetDistributionFlavor( root_r ); } + Target::DistributionLabel Target::distributionLabel() const { return _pimpl->distributionLabel(); } Target::DistributionLabel Target::distributionLabel( const Pathname & root_r ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/Target.h new/libzypp-14.33.0/zypp/Target.h --- old/libzypp-14.32.0/zypp/Target.h 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/Target.h 2014-12-19 13:50:09.000000000 +0100 @@ -153,6 +153,14 @@ /** \overload */ static std::string targetDistributionRelease( const Pathname & root_r ); + /** This is \c register.flavor attribute of the installed base product. + * Used for registration. + * \note don't mistake this for \ref distributionFlavor + */ + std::string targetDistributionFlavor() const; + /** \overload */ + static std::string targetDistributionFlavor( const Pathname & root_r ); + struct DistributionLabel { std::string shortName; std::string summary; }; /** This is \c shortName and \c summary attribute of the installed base product. * Used e.g. for the bootloader menu. @@ -175,6 +183,7 @@ * the last used one. It can be empty is the target has never * been loaded, as the value is not present in the system * but computer from a package provides + * \note don't mistake this for \ref targetDistributionFlavor */ std::string distributionFlavor() const; /** \overload */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/base/String.h new/libzypp-14.33.0/zypp/base/String.h --- old/libzypp-14.32.0/zypp/base/String.h 2014-12-08 13:12:41.000000000 +0100 +++ new/libzypp-14.33.0/zypp/base/String.h 2014-12-17 18:49:02.000000000 +0100 @@ -487,7 +487,16 @@ /** Split \a line_r into words with respect to escape delimeters. * Any sequence of characters in \a sepchars_r is treated as - * delimiter if not inside "" or "" or escaped by \, but not \\. + * delimiter if not inside \c "" or \c '' or escaped by \c \. + * + * \li A non-quoted backslash (\) preserves the literal value of the next character. + * \li Enclosing characters in single quotes preserves the literal value of each + * character within the quotes. A single quote may not occur between single + * quotes, even when preceded by a backslash. + * \li Enclosing characters in double quotes preserves the literal value of all + * characters within the quotes, with the exception of \c \. The backslash + * retains its special meaning only when followed by \c " or \c \. + * * The words are passed to OutputIterator \a result_r. * * \see \ref splitEscaped @@ -500,10 +509,10 @@ * \code * example splitted strings * normal line -> 2 elements ( "normal", "line" ) - * escaped\ line -> 1 element( "escaped line" ) + * escaped\ line -> 1 element(escaped line) * "quoted line" -> 1 element same as above * 'quoted line' -> 1 element same as above - * "escaped quote\'" -> 1 element ( "escaped quote'" ) + * "escaped quote\"" -> 1 element (escaped quote") * * \param line_r The string to parse. * \param result_r @@ -541,91 +550,86 @@ } // after the leading sepchars + enum class Quote { None, Slash, Single, Double, DoubleSlash }; + std::vector<char> buf; + Quote quoting = Quote::None; for ( beg = cur; *beg; beg = cur, ++result_r, ++ret ) - { - if ( *cur == '"' || *cur == '\'' ) - { - char closeChar = *cur; - ++cur; - bool cont = true; - while (cont) - { - while ( *cur && *cur != closeChar) - ++cur; - if ( *cur == '\0' ) - { - return ret; //TODO parsing exception no closing quote - } - int escCount = 0; - const char * esc = cur-1; - while ( esc != beg && *esc == '\\' ) - { - escCount++; - --esc; - } - cont = (escCount % 2 == 1); // find some non escaped escape char - cur++; //skip quote - } - - std::string s( beg+1, cur-beg-2 ); //without quotes - //transform escaped escape - replaceAll( s, "\\\\", "\\" ); - //transform escaped quotes (only same as open - char tmpn[2] = { closeChar, 0 }; - char tmpo[3] = { '\\', closeChar, 0 }; - replaceAll( s, tmpo, tmpn ); - - *result_r = s; - } - else - { - // skip non sepchars - while( *cur && !::strchr( sepchars_r, *cur ) ) - { - //ignore char after backslash - if ( *cur == '\\' ) - { - ++cur; - } - ++cur; - } - // build string - std::string s( beg, cur-beg ); - //transform escaped escape - replaceAll( s, "\\\\", "\\" ); - - const char *delimeter = sepchars_r; - while ( *delimeter ) - { - std::string ds("\\"); - const char tmp[2] = { *delimeter, '\0' }; - std::string del(tmp); - ds+= del; - replaceAll( s, ds, del ); - ++delimeter; - } - - *result_r = s; - } - // skip sepchars - if ( *cur && ::strchr( sepchars_r, *cur ) ) - ++cur; - while ( *cur && ::strchr( sepchars_r, *cur ) ) - { - ++cur; - if (withEmpty) - { - *result_r = ""; - ++ret; - } - } - // the last was a separator => one more field - if ( !*cur && withEmpty && ::strchr( sepchars_r, *(cur-1) ) ) - { - *result_r = ""; - ++ret; - } - } + { + // read next value until unquoted sepchar + buf.clear(); + quoting = Quote::None; + do { + switch ( quoting ) + { + case Quote::None: + switch ( *cur ) + { + case '\\': quoting = Quote::Slash; break; + case '\'': quoting = Quote::Single; break; + case '"': quoting = Quote::Double; break; + default: buf.push_back( *cur ); break; + } + break; + + case Quote::Slash: + buf.push_back( *cur ); + quoting = Quote::None; + break; + + case Quote::Single: + switch ( *cur ) + { + case '\'': quoting = Quote::None; break; + default: buf.push_back( *cur ); break; + } + break; + + case Quote::Double: + switch ( *cur ) + { + case '\"': quoting = Quote::None; break; + case '\\': quoting = Quote::DoubleSlash; break; + default: buf.push_back( *cur ); break; + } + break; + + case Quote::DoubleSlash: + switch ( *cur ) + { + case '\"': /*fallthrough*/ + case '\\': buf.push_back( *cur ); break; + default: + buf.push_back( '\\' ); + buf.push_back( *cur ); + break; + } + quoting = Quote::Double; + break; + } + ++cur; + } while ( *cur && ( quoting != Quote::None || !::strchr( sepchars_r, *cur ) ) ); + *result_r = std::string( buf.begin(), buf.end() ); + + + // skip sepchars + if ( *cur && ::strchr( sepchars_r, *cur ) ) + ++cur; + while ( *cur && ::strchr( sepchars_r, *cur ) ) + { + ++cur; + if (withEmpty) + { + *result_r = ""; + ++ret; + } + } + // the last was a separator => one more field + if ( !*cur && withEmpty && ::strchr( sepchars_r, *(cur-1) ) ) + { + *result_r = ""; + ++ret; + } + } return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/base/Xml.h new/libzypp-14.33.0/zypp/base/Xml.h --- old/libzypp-14.32.0/zypp/base/Xml.h 2014-12-08 13:12:41.000000000 +0100 +++ new/libzypp-14.33.0/zypp/base/Xml.h 2014-12-19 13:37:01.000000000 +0100 @@ -79,6 +79,8 @@ /// } // </node> /// \endcode /// + /// \note If the nodename is empty or starts with an \c !, a comment is written. + /// struct Node { NON_COPYABLE_BUT_MOVE( Node ); @@ -110,7 +112,9 @@ /** Dtor wrting end tag */ ~Node() { - if ( ! _name.empty() ) + if ( _name.empty() ) + _out << "-->"; + else { if ( _hasContent ) _out << "</" << _name << ">"; @@ -125,7 +129,9 @@ if ( ! _hasContent ) { _hasContent = true; - if ( ! _name.empty() ) + if ( _name.empty() ) + _out << "|"; + else _out << ">"; } return _out; @@ -134,14 +140,19 @@ private: void printStart( const std::initializer_list<Attr> & attrs_r ) { - if ( ! _name.empty() ) + if ( _name.empty() || _name[0] == '!' ) { - _out << "<" << _name; - for ( const auto & pair : attrs_r ) - _out << " " << pair.first << "=\"" << xml::escape( pair.second ) << "\""; - if ( _hasContent ) - _out << ">"; + _out << "<!--" << _name; + _name.clear(); } + else + _out << "<" << _name; + + for ( const auto & pair : attrs_r ) + _out << " " << pair.first << "=\"" << xml::escape( pair.second ) << "\""; + + if ( ! _name.empty() && _hasContent ) + _out << ">"; } private: std::ostream & _out; @@ -166,6 +177,20 @@ } // namespace xmlout /////////////////////////////////////////////////////////////////// + + /// \name Default dumpAsXmlOn based on asString. + /// + //@{ + template <class _Tp> + inline std::ostream & dumpAsXmlOn( std::ostream & str, const _Tp & obj, const std::string & name_r ) + { + xmlout::Node guard( str, name_r, xmlout::Node::optionalContent ); + const std::string & content( asString( obj ) ); + if ( ! content.empty() ) *guard << content; + return str; + } + //@} + // } // namespace zypp /////////////////////////////////////////////////////////////////// #endif // ZYPP_BASE_XML_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/misc/CheckAccessDeleted.cc new/libzypp-14.33.0/zypp/misc/CheckAccessDeleted.cc --- old/libzypp-14.32.0/zypp/misc/CheckAccessDeleted.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/misc/CheckAccessDeleted.cc 2014-12-12 14:01:01.000000000 +0100 @@ -46,8 +46,8 @@ typedef std::pair<std::string,std::unordered_set<std::string>> CacheEntry; /** Add \c cache to \c data if the process is accessing deleted files. - * \c pid string in \c cache is the proc line \c (pcuLR), \c iles - * are lready in place. Always clear the \c cache.files! + * \c pid string in \c cache is the proc line \c (pcuLR), \c files + * are already in place. Always clear the \c cache.files! */ inline void addDataIf( std::vector<CheckAccessDeleted::ProcInfo> & data_r, const CacheEntry & cache_r ) { @@ -168,6 +168,33 @@ // Add if no duplicate cache_r.second.insert( n ); } + + ///////////////////////////////////////////////////////////////// + /// \class FilterRunsInLXC + /// \brief Functor guessing whether \a PID is running in a container. + /// + /// Asumme a using different \c pid/mnt namespace than \c self. + ///////////////////////////////////////////////////////////////// + struct FilterRunsInLXC + { + bool operator()( pid_t pid_r ) const + { return( nsIno( pid_r, "pid" ) != pidNS || nsIno( pid_r, "mnt" ) != mntNS ); } + + FilterRunsInLXC() + : pidNS( nsIno( "self", "pid" ) ) + , mntNS( nsIno( "self", "mnt" ) ) + {} + + static inline ino_t nsIno( const std::string & pid_r, const std::string & ns_r ) + { return PathInfo("/proc/"+pid_r+"/ns/"+ns_r).ino(); } + + static inline ino_t nsIno( pid_t pid_r, const std::string & ns_r ) + { return nsIno( asString(pid_r), ns_r ); } + + ino_t pidNS; + ino_t mntNS; + }; + ///////////////////////////////////////////////////////////////// } // namespace /////////////////////////////////////////////////////////////////// @@ -183,17 +210,22 @@ ExternalProgram prog( argv, ExternalProgram::Discard_Stderr ); // cachemap: PID => (deleted files) + // NOTE: omit PIDs running in a (lxc/docker) container std::map<pid_t,CacheEntry> cachemap; - pid_t cachepid; + pid_t cachepid = 0; + FilterRunsInLXC runsInLXC; for( std::string line = prog.receiveLine(); ! line.empty(); line = prog.receiveLine() ) { // NOTE: line contains '\0' separeated fields! if ( line[0] == 'p' ) { str::strtonum( line.c_str()+1, cachepid ); // line is "p<PID>\0...." - cachemap[cachepid].first.swap( line ); + if ( !runsInLXC( cachepid ) ) + cachemap[cachepid].first.swap( line ); + else + cachepid = 0; // ignore this pid } - else + else if ( cachepid ) { addCacheIf( cachemap[cachepid], line, verbose_r ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/parser/ProductFileReader.cc new/libzypp-14.33.0/zypp/parser/ProductFileReader.cc --- old/libzypp-14.32.0/zypp/parser/ProductFileReader.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/parser/ProductFileReader.cc 2014-12-19 13:37:01.000000000 +0100 @@ -76,6 +76,7 @@ std::string _productline; std::string _registerTarget; std::string _registerRelease; + std::string _registerFlavor; std::string _updaterepokey; @@ -97,6 +98,7 @@ std::string ProductFileData::productline() const { return _pimpl->_productline; } std::string ProductFileData::registerTarget() const { return _pimpl->_registerTarget; } std::string ProductFileData::registerRelease() const { return _pimpl->_registerRelease; } + std::string ProductFileData::registerFlavor() const { return _pimpl->_registerFlavor; } std::string ProductFileData::updaterepokey() const { return _pimpl->_updaterepokey; } @@ -157,6 +159,7 @@ (*this)["register"] ("target", OPTIONAL, xml::parseDefAssign( _pdata._registerTarget ) ) ("release", OPTIONAL, xml::parseDefAssign( _pdata._registerRelease ) ) + ("flavor", OPTIONAL, xml::parseDefAssign( _pdata._registerFlavor ) ) ; (*this)["upgrades"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/parser/ProductFileReader.h new/libzypp-14.33.0/zypp/parser/ProductFileReader.h --- old/libzypp-14.32.0/zypp/parser/ProductFileReader.h 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/parser/ProductFileReader.h 2014-12-19 13:37:01.000000000 +0100 @@ -61,6 +61,7 @@ std::string productline() const; std::string registerTarget() const; std::string registerRelease() const; + std::string registerFlavor() const; public: std::string updaterepokey() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/parser/RepoFileReader.cc new/libzypp-14.33.0/zypp/parser/RepoFileReader.cc --- old/libzypp-14.32.0/zypp/parser/RepoFileReader.cc 2014-10-15 15:12:42.000000000 +0200 +++ new/libzypp-14.33.0/zypp/parser/RepoFileReader.cc 2014-12-17 18:49:02.000000000 +0100 @@ -145,7 +145,6 @@ ERR << "Unknown attribute in [" << *its << "]: " << it->first << "=" << it->second << " ignored" << endl; } - USR << dict.baseurls( *its ) << endl; for ( auto & url : dict.baseurls( *its ) ) { if ( ! proxy.empty() && url.getQueryParam( "proxy" ).empty() ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/sat/SolvAttr.cc new/libzypp-14.33.0/zypp/sat/SolvAttr.cc --- old/libzypp-14.32.0/zypp/sat/SolvAttr.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/sat/SolvAttr.cc 2014-12-19 13:37:01.000000000 +0100 @@ -120,6 +120,7 @@ const SolvAttr SolvAttr::productEndOfLife ( PRODUCT_ENDOFLIFE ); const SolvAttr SolvAttr::productRegisterTarget ( PRODUCT_REGISTER_TARGET ); const SolvAttr SolvAttr::productRegisterRelease( PRODUCT_REGISTER_RELEASE ); + const SolvAttr SolvAttr::productRegisterFlavor ( PRODUCT_REGISTER_FLAVOR ); const SolvAttr SolvAttr::productUrl ( PRODUCT_URL ); const SolvAttr SolvAttr::productUrlType ( PRODUCT_URL_TYPE ); /** array of repoids, hopefully label s too */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/sat/SolvAttr.h new/libzypp-14.33.0/zypp/sat/SolvAttr.h --- old/libzypp-14.32.0/zypp/sat/SolvAttr.h 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/sat/SolvAttr.h 2014-12-19 13:37:01.000000000 +0100 @@ -149,6 +149,7 @@ static const SolvAttr productEndOfLife; static const SolvAttr productRegisterTarget; static const SolvAttr productRegisterRelease; + static const SolvAttr productRegisterFlavor; static const SolvAttr productUrl; static const SolvAttr productUrlType; static const SolvAttr productUpdates; // SUB-STRUCTURE: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/solver/detail/SATResolver.cc new/libzypp-14.33.0/zypp/solver/detail/SATResolver.cc --- old/libzypp-14.32.0/zypp/solver/detail/SATResolver.cc 2014-10-15 15:12:42.000000000 +0200 +++ new/libzypp-14.33.0/zypp/solver/detail/SATResolver.cc 2014-12-17 18:49:02.000000000 +0100 @@ -1201,7 +1201,7 @@ if (poolItem) { if (pool->installed && s.get()->repo == pool->installed) { problemSolution->addSingleAction (poolItem, REMOVE); - string description = str::form (_("do not keep %s installed"), s.asString().c_str() ); + string description = str::form (_("remove lock to allow removal of %s"), s.asString().c_str() ); MIL << description << endl; problemSolution->addDescription (description); } else { @@ -1226,7 +1226,7 @@ problemSolution->addDescription (description); } else { problemSolution->addSingleAction (poolItem, UNLOCK); - string description = str::form (_("do not forbid installation of %s"), itemToString( poolItem ).c_str()); + string description = str::form (_("remove lock to allow installation of %s"), itemToString( poolItem ).c_str()); MIL << description << endl; problemSolution->addDescription (description); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/target/TargetImpl.cc new/libzypp-14.33.0/zypp/target/TargetImpl.cc --- old/libzypp-14.32.0/zypp/target/TargetImpl.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/target/TargetImpl.cc 2014-12-19 13:37:01.000000000 +0100 @@ -1863,6 +1863,12 @@ std::string TargetImpl::targetDistributionRelease( const Pathname & root_r ) { return baseproductdata( staticGuessRoot(root_r) ).registerRelease();} + std::string TargetImpl::targetDistributionFlavor() const + { return baseproductdata( _root ).registerFlavor(); } + // static version: + std::string TargetImpl::targetDistributionFlavor( const Pathname & root_r ) + { return baseproductdata( staticGuessRoot(root_r) ).registerFlavor();} + Target::DistributionLabel TargetImpl::distributionLabel() const { Target::DistributionLabel ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.32.0/zypp/target/TargetImpl.h new/libzypp-14.33.0/zypp/target/TargetImpl.h --- old/libzypp-14.32.0/zypp/target/TargetImpl.h 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.33.0/zypp/target/TargetImpl.h 2014-12-19 13:37:01.000000000 +0100 @@ -175,6 +175,11 @@ /** \overload */ static std::string targetDistributionRelease( const Pathname & root_r ); + /** \copydoc Target::targetDistributionFlavor()*/ + std::string targetDistributionFlavor() const; + /** \overload */ + static std::string targetDistributionFlavor( const Pathname & root_r ); + /** \copydoc Target::distributionVersion()*/ Target::DistributionLabel distributionLabel() const; /** \overload */ -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org