From 362a3fe325c0e1d66cb6b560cf99dd2147a8aa8d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 2 Sep 2019 16:11:45 +0900 Subject: [PATCH] Imported Upstream version 16.4.0 --- VERSION.cmake | 6 +++--- package/libzypp.changes | 10 ++++++++++ po/fa.po | 7 ++++--- po/fr.po | 10 ++++++---- po/it.po | 10 ++++++---- zypp/CpeId.cc | 10 +++++----- zypp/RepoManager.cc | 2 +- zypp/Target.cc | 3 +++ zypp/Target.h | 5 +++++ zypp/base/StrMatcher.cc | 2 +- zypp/media/MediaCD.cc | 13 +++++++------ zypp/sat/Solvable.cc | 16 ++++++++++++++-- zypp/sat/Solvable.h | 12 +++++++++--- zypp/sat/SolvableType.h | 4 +++- zypp/sat/detail/PoolImpl.h | 3 +++ zypp/target/SolvIdentFile.cc | 10 +++++++++- zypp/target/TargetImpl.cc | 9 +++++++++ zypp/target/TargetImpl.h | 3 +++ 18 files changed, 101 insertions(+), 34 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 1f657cb..7164303 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "16") SET(LIBZYPP_COMPATMINOR "0") -SET(LIBZYPP_MINOR "3") -SET(LIBZYPP_PATCH "2") +SET(LIBZYPP_MINOR "4") +SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 16.3.2 (0) +# LAST RELEASED: 16.4.0 (0) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index a801277..499e256 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Thu Jan 26 13:03:37 CET 2017 - ma@suse.de + +- Add API for updating the AutoInstalled db +- MediaCD: Fix mountpoint creation after failing udf mount (bsc#1022046) +- fix misleading indentation (fixes #65) +- Fix compilation error reported by GCC7 (#63). +- Prefer calling "repo2solv" rather than "repo2solv.sh" +- version 16.4.0 (0) + +------------------------------------------------------------------- Wed Dec 14 12:24:23 CET 2016 - ma@suse.de - Don't raise FileCheckException if user accepted a package with wrong diff --git a/po/fa.po b/po/fa.po index c28de56..c56a7bb 100644 --- a/po/fa.po +++ b/po/fa.po @@ -5,10 +5,10 @@ msgstr "" "Project-Id-Version: opensuse-i 18n\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-11-21 15:07+0100\n" -"PO-Revision-Date: 2016-11-01 20:29+0000\n" +"PO-Revision-Date: 2016-12-15 09:15+0000\n" "Last-Translator: hayyan rostami \n" -"Language-Team: Persian \n" +"Language-Team: Persian " +"\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -4549,6 +4549,7 @@ msgid "" "Create attach point: Can't find a writable directory to create an attach " "point" msgstr "" +"ساخت نقطه ی اتصال: نمیتوان یک فهرست قابل نوشتن را برای ساخت نقطه ی اتصال یافت" #. !\todo add comma to the message for the next release #: zypp/media/MediaCIFS.cc:427 zypp/media/MediaCurl.cc:1687 diff --git a/po/fr.po b/po/fr.po index 2290571..49b8dbb 100644 --- a/po/fr.po +++ b/po/fr.po @@ -20,10 +20,10 @@ msgstr "" "Project-Id-Version: zypp.fr\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-11-21 15:07+0100\n" -"PO-Revision-Date: 2016-07-13 08:38+0000\n" -"Last-Translator: Christine Gabriel \n" -"Language-Team: French \n" +"PO-Revision-Date: 2016-12-29 17:31+0000\n" +"Last-Translator: Benoît Monin \n" +"Language-Team: French " +"\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -4595,6 +4595,8 @@ msgid "" "Create attach point: Can't find a writable directory to create an attach " "point" msgstr "" +"Création d'un point d'attache : Impossible de trouver un répertoire pour " +"créer un point d'attache" #. !\todo add comma to the message for the next release #: zypp/media/MediaCIFS.cc:427 zypp/media/MediaCurl.cc:1687 diff --git a/po/it.po b/po/it.po index ac5c450..a181043 100644 --- a/po/it.po +++ b/po/it.po @@ -15,10 +15,10 @@ msgstr "" "Project-Id-Version: zypp\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-11-21 15:07+0100\n" -"PO-Revision-Date: 2016-07-08 13:22+0000\n" -"Last-Translator: Sabrina D'Alessandro \n" -"Language-Team: Italian \n" +"PO-Revision-Date: 2016-12-30 21:16+0000\n" +"Last-Translator: Alessio Adamo \n" +"Language-Team: Italian " +"\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -4573,6 +4573,8 @@ msgid "" "Create attach point: Can't find a writable directory to create an attach " "point" msgstr "" +"Creazione del punto di collegamento: impossibile trovare una directory " +"scrivibile per creare un punto di collegamento" #. !\todo add comma to the message for the next release #: zypp/media/MediaCIFS.cc:427 zypp/media/MediaCurl.cc:1687 diff --git a/zypp/CpeId.cc b/zypp/CpeId.cc index e8b3015..acce8b2 100644 --- a/zypp/CpeId.cc +++ b/zypp/CpeId.cc @@ -845,9 +845,9 @@ namespace zypp case '*': if ( src.size() == 1 ) return true; // "*" matches always: superset - else - prefx = std::string::npos; - src.erase( 0, 1 ); + // else + prefx = std::string::npos; + src.erase( 0, 1 ); break; case '?': ++prefx; @@ -855,8 +855,8 @@ namespace zypp { if ( *it == '?' ) ++prefx; else break; } if ( src.size() == prefx ) return( trg.size() <= prefx ); // "??..?": superset if at most #prefx chars - else - src.erase( 0, prefx ); + // else + src.erase( 0, prefx ); break; default: break; diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index 3225ad8..d34a792 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -1336,7 +1336,7 @@ namespace zypp scoped_ptr forPlainDirs; ExternalProgram::Arguments cmd; - cmd.push_back( "repo2solv.sh" ); + cmd.push_back( PathInfo( "/usr/bin/repo2solv" ).isFile() ? "repo2solv" : "repo2solv.sh" ); // repo2solv expects -o as 1st arg! cmd.push_back( "-o" ); cmd.push_back( solvfile.asString() ); diff --git a/zypp/Target.cc b/zypp/Target.cc index 2bee5ea..b9d35ec 100644 --- a/zypp/Target.cc +++ b/zypp/Target.cc @@ -99,6 +99,9 @@ namespace zypp LocaleSet Target::requestedLocales( const Pathname & root_r ) { return target::TargetImpl::requestedLocales( root_r ); } + void Target::updateAutoInstalled() + { return _pimpl->updateAutoInstalled(); } + std::string Target::targetDistribution() const { return _pimpl->targetDistribution(); } std::string Target::targetDistribution( const Pathname & root_r ) diff --git a/zypp/Target.h b/zypp/Target.h index 5d42b6e..c13f449 100644 --- a/zypp/Target.h +++ b/zypp/Target.h @@ -127,6 +127,11 @@ namespace zypp */ static LocaleSet requestedLocales( const Pathname & root_r ); + /** Update the database of autoinstalled packages. + * This is done on commit, so you usually don't need to call this explicitly. + */ + void updateAutoInstalled(); + public: /** \name Base product and registration. * diff --git a/zypp/base/StrMatcher.cc b/zypp/base/StrMatcher.cc index 95ab089..6042324 100644 --- a/zypp/base/StrMatcher.cc +++ b/zypp/base/StrMatcher.cc @@ -207,7 +207,7 @@ namespace zypp if ( ! string_r ) return false; // NULL never matches - return ::datamatcher_match( _matcher.get(), string_r ); + return ::datamatcher_match( _matcher.get(), string_r ); } /** The current searchstring. */ diff --git a/zypp/media/MediaCD.cc b/zypp/media/MediaCD.cc index 8452736..9328c9b 100644 --- a/zypp/media/MediaCD.cc +++ b/zypp/media/MediaCD.cc @@ -409,12 +409,6 @@ namespace zypp // This also fills the _devices list on demand DeviceList detected( detectDevices( _url.getScheme() == "dvd" ? true : false ) ); - if( !isUseableAttachPoint( attachPoint() ) ) - { - setAttachPoint( createAttachPoint(), true ); - } - std::string mountpoint( attachPoint().asString() ); - Mount mount; MediaMountException merr; @@ -435,6 +429,7 @@ namespace zypp // try all devices in sequence int count = 0; + std::string mountpoint( attachPoint().asString() ); bool mountsucceeded = false; for ( DeviceList::iterator it = _devices.begin() ; ! mountsucceeded && it != _devices.end() ; ++it, ++count ) { @@ -531,6 +526,12 @@ namespace zypp { try { + if( !isUseableAttachPoint( attachPoint() ) ) + { + setAttachPoint( createAttachPoint(), true ); + mountpoint = attachPoint().asString(); + } + mount.mount(it->name, mountpoint, *fsit, options); setMediaSource(media); diff --git a/zypp/sat/Solvable.cc b/zypp/sat/Solvable.cc index b5f0ede..5e6f051 100644 --- a/zypp/sat/Solvable.cc +++ b/zypp/sat/Solvable.cc @@ -141,10 +141,12 @@ namespace zypp else { for ( Locale l( lang_r ); l; l = l.fallback() ) + { if ( (s = ::solvable_lookup_str_lang( _solvable, attr.id(), l.c_str(), 0 )) ) return s; - // here: no matching locale, so use default - s = ::solvable_lookup_str_lang( _solvable, attr.id(), 0, 0 ); + } + // here: no matching locale, so use default + s = ::solvable_lookup_str_lang( _solvable, attr.id(), 0, 0 ); } return s ? s : std::string(); } @@ -375,6 +377,16 @@ namespace zypp return isSystem() && myPool().isOnSystemByUser( ident() ); } + bool Solvable::onSystemByAuto() const + { + return isSystem() && myPool().isOnSystemByAuto( ident() ); + } + + bool Solvable::identIsAutoInstalled() const + { + return myPool().isOnSystemByAuto( ident() ); + } + bool Solvable::multiversionInstall() const { NO_SOLVABLE_RETURN( false ); diff --git a/zypp/sat/Solvable.h b/zypp/sat/Solvable.h index 2702333..b6d4f98 100644 --- a/zypp/sat/Solvable.h +++ b/zypp/sat/Solvable.h @@ -121,12 +121,18 @@ namespace zypp bool isSystem() const; /** Whether this is known to be installed on behalf of a user request. - * \note This is a hint guessed by evaluating an available install history. - * Returns \c false for non-system (uninstalled) solvables, or if no history - * is available. + * \note Returns \c false for non-system (uninstalled) solvables. */ bool onSystemByUser() const; + /** Whether this is known to be automatically installed (as dependency of a user request package). + * \note Returns \c false for non-system (uninstalled) solvables. + */ + bool onSystemByAuto() const; + + /** Whether an installed solvable with the same ident is flagged as AutoInstalled. */ + bool identIsAutoInstalled() const; + /** Whether different versions of this package can be installed at the same time. * Per default \c false. \see also \ref ZConfig::multiversion. */ diff --git a/zypp/sat/SolvableType.h b/zypp/sat/SolvableType.h index 4c087f2..e666195 100644 --- a/zypp/sat/SolvableType.h +++ b/zypp/sat/SolvableType.h @@ -63,7 +63,7 @@ namespace zypp ResKind kind() const { return satSolvable().kind(); } bool isKind( const ResKind & kind_r ) const { return satSolvable().isKind( kind_r ); } template - bool isKind() const { return satSolvable().isKind(); } + bool isKind() const { return satSolvable().template isKind(); } template bool isKind( TIterator begin, TIterator end ) const { return satSolvable().isKind( begin, end ); } @@ -77,6 +77,8 @@ namespace zypp bool isSystem() const { return satSolvable().isSystem(); } bool onSystemByUser() const { return satSolvable().onSystemByUser(); } + bool onSystemByAuto() const { return satSolvable().onSystemByAuto(); } + bool identIsAutoInstalled() const { return satSolvable().identIsAutoInstalled(); } bool multiversionInstall() const { return satSolvable().multiversionInstall(); } Date buildtime() const { return satSolvable().buildtime(); } diff --git a/zypp/sat/detail/PoolImpl.h b/zypp/sat/detail/PoolImpl.h index 77ced71..92a81a4 100644 --- a/zypp/sat/detail/PoolImpl.h +++ b/zypp/sat/detail/PoolImpl.h @@ -299,6 +299,9 @@ namespace zypp bool isOnSystemByUser( IdString ident_r ) const { return !_autoinstalled.contains( ident_r.id() ); } + + bool isOnSystemByAuto( IdString ident_r ) const + { return _autoinstalled.contains( ident_r.id() ); } //@} public: diff --git a/zypp/target/SolvIdentFile.cc b/zypp/target/SolvIdentFile.cc index f09074a..bd738d2 100644 --- a/zypp/target/SolvIdentFile.cc +++ b/zypp/target/SolvIdentFile.cc @@ -58,7 +58,15 @@ namespace zypp std::ofstream outs( tmp.path().c_str() ); outs << "# " << file_r.basename() << " generated " << Date::now() << endl; - dumpRange( outs, data_r.begin(), data_r.end(), "#", "\n", "\n", "\n", "#\n" ); + if ( true ) + { + std::set sorted( data_r.begin(), data_r.end() ); + dumpRange( outs, sorted.begin(), sorted.end(), "#", "\n", "\n", "\n", "#\n" ); + } + else + { + dumpRange( outs, data_r.begin(), data_r.end(), "#", "\n", "\n", "\n", "#\n" ); + } outs.close(); if ( outs.good() ) diff --git a/zypp/target/TargetImpl.cc b/zypp/target/TargetImpl.cc index baffb9b..74f7644 100644 --- a/zypp/target/TargetImpl.cc +++ b/zypp/target/TargetImpl.cc @@ -1733,6 +1733,15 @@ namespace zypp return RequestedLocalesFile( home(needroot) / "RequestedLocales" ).locales(); } + void TargetImpl::updateAutoInstalled() + { + MIL << "updateAutoInstalled if changed..." << endl; + SolvIdentFile::Data newdata; + for ( auto id : sat::Pool::instance().autoInstalled() ) + newdata.insert( IdString(id) ); // explicit ctor! + _autoInstalledFile.setData( std::move(newdata) ); + } + std::string TargetImpl::targetDistribution() const { return baseproductdata( _root ).registerTarget(); } // static version: diff --git a/zypp/target/TargetImpl.h b/zypp/target/TargetImpl.h index 21f4b04..6658900 100644 --- a/zypp/target/TargetImpl.h +++ b/zypp/target/TargetImpl.h @@ -162,6 +162,9 @@ namespace zypp /** \overload */ static LocaleSet requestedLocales( const Pathname & root_r ); + /** \copydoc Target::updateAutoInstalled */ + void updateAutoInstalled(); + /** \copydoc Target::targetDistribution() */ std::string targetDistribution() const; /** \overload */ -- 2.7.4