SET(LIBZYPP_MAJOR "16")
SET(LIBZYPP_COMPATMINOR "0")
SET(LIBZYPP_MINOR "6")
-SET(LIBZYPP_PATCH "0")
+SET(LIBZYPP_PATCH "1")
#
-# LAST RELEASED: 16.6.0 (0)
+# LAST RELEASED: 16.6.1 (0)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
-------------------------------------------------------------------
+Thu Mar 30 15:00:30 CEST 2017 - ma@suse.de
+
+- Recognize license tarball in rpmmd repos (FATE#316159)
+- Fix media verification to properly propagate media access errors
+ (bsc#1031093)
+- version 16.6.1 (0)
+
+-------------------------------------------------------------------
Mon Mar 27 17:10:52 CEST 2017 - ma@suse.de
- Fix invalidation of PoolItems if Pool IDs are reused (bsc#1028661)
#include "zypp/parser/xml/XmlEscape.h"
#include "zypp/RepoInfo.h"
+#include "zypp/Glob.h"
#include "zypp/TriBool.h"
#include "zypp/Pathname.h"
#include "zypp/ZConfig.h"
}
public:
+ /** Path to a license tarball in case it exists in the repo. */
Pathname licenseTgz() const
- { return metadatapath.empty() ? Pathname() : metadatapath / path / "license.tar.gz"; }
+ {
+ Pathname ret;
+ if ( !metadatapath.empty() )
+ {
+ filesystem::Glob g;
+ g.add( metadatapath / path / "repodata/*license.tar.gz" );
+ if ( g.empty() )
+ g.add( metadatapath / path / "license.tar.gz" );
+
+ if ( !g.empty() )
+ ret = *g.begin();
+ }
+ return ret;
+ }
const RepoVariablesReplacedUrlList & baseUrls() const
{
bool RepoInfo::hasLicense() const
{
- Pathname licenseTgz( _pimpl->licenseTgz() );
- return ! licenseTgz.empty() && PathInfo(licenseTgz).isFile();
+ return !_pimpl->licenseTgz().empty();
}
bool RepoInfo::needToAcceptLicense() const
static const std::string noAcceptanceFile = "no-acceptance-needed\n";
bool accept = true;
- Pathname licenseTgz( _pimpl->licenseTgz() );
- if ( licenseTgz.empty() || ! PathInfo( licenseTgz ).isFile() )
+ const Pathname & licenseTgz( _pimpl->licenseTgz() );
+ if ( licenseTgz.empty() )
return false; // no licenses at all
ExternalProgram::Arguments cmd;
LocaleSet RepoInfo::getLicenseLocales() const
{
- Pathname licenseTgz( _pimpl->licenseTgz() );
- if ( licenseTgz.empty() || ! PathInfo( licenseTgz ).isFile() )
+ const Pathname & licenseTgz( _pimpl->licenseTgz() );
+ if ( licenseTgz.empty() )
return LocaleSet();
ExternalProgram::Arguments cmd;
std::ostream & dumpRangeLine( std::ostream & str,
TIterator begin, TIterator end )
{ return dumpRange( str, begin, end, "(", "", ", ", "", ")" ); }
+ /** \overload for container */
+ template<class TContainer>
+ std::ostream & dumpRangeLine( std::ostream & str, const TContainer & cont )
+ { return dumpRangeLine( str, cont.begin(), cont.end() ); }
+ ///////////////////////////////////////////////////////////////////
+ namespace iomanip
+ {
+ ///////////////////////////////////////////////////////////////////
+ /// \class RangeLine<TIterator>
+ /// \brief Iomanip helper printing dumpRangeLine style
+ ///////////////////////////////////////////////////////////////////
+ template<class TIterator>
+ struct RangeLine
+ {
+ RangeLine( TIterator begin, TIterator end )
+ : _begin( begin )
+ , _end( end )
+ {}
+ TIterator _begin;
+ TIterator _end;
+ };
+
+ /** \relates RangeLine<TIterator> */
+ template<class TIterator>
+ std::ostream & operator<<( std::ostream & str, const RangeLine<TIterator> & obj )
+ { return dumpRangeLine( str, obj._begin, obj._end ); }
+
+ } // namespce iomanip
+ ///////////////////////////////////////////////////////////////////
+
+ /** Iomanip printing dumpRangeLine style
+ * \code
+ * std::vector<int> c( { 1, 1, 2, 3, 5, 8 } );
+ * std::cout << rangeLine(c) << std::endl;
+ * -> (1, 1, 2, 3, 5, 8)
+ * \endcode
+ */
+ template<class TIterator>
+ iomanip::RangeLine<TIterator> rangeLine( TIterator begin, TIterator end )
+ { return iomanip::RangeLine<TIterator>( begin, end ); }
+ /** \overload for container */
+ template<class TContainer>
+ auto rangeLine( const TContainer & cont ) -> decltype( rangeLine( cont.begin(), cont.end() ) )
+ { return rangeLine( cont.begin(), cont.end() ); }
+
template<class Tp>
std::ostream & operator<<( std::ostream & str, const std::vector<Tp> & obj )
{ return dumpRange( str, obj.begin(), obj.end() ); }
}
}
- inline void
- checkDesired(MediaAccessId id)
+ inline void checkDesired( MediaAccessId id )
{
- checkAttached(id);
+ checkAttached( id );
- if( !desired)
+ if ( !desired )
{
- try {
- desired = verifier->isDesiredMedia(handler);
- }
- catch(const zypp::Exception &e) {
- ZYPP_CAUGHT(e);
- desired = false;
- }
+ desired = verifier->isDesiredMedia(handler);
- if( !desired)
+ if( !desired )
{
- DBG << "checkDesired(" << id << "): not desired (report by "
- << verifier->info() << ")" << std::endl;
- ZYPP_THROW(MediaNotDesiredException(
- handler->url()
- ));
+ DBG << "checkDesired(" << id << "): not desired (report by " << verifier->info() << ")" << std::endl;
+ ZYPP_THROW( MediaNotDesiredException( handler->url() ) );
}
- DBG << "checkDesired(" << id << "): desired (report by "
- << verifier->info() << ")" << std::endl;
+ DBG << "checkDesired(" << id << "): desired (report by " << verifier->info() << ")" << std::endl;
} else {
DBG << "checkDesired(" << id << "): desired (cached)" << std::endl;
}