#
SET(LIBZYPP_MAJOR "14")
SET(LIBZYPP_COMPATMINOR "30")
-SET(LIBZYPP_MINOR "33")
+SET(LIBZYPP_MINOR "34")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 14.33.0 (30)
+# LAST RELEASED: 14.34.0 (30)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
\li \c ZYPP_CONF=<PATH> Location of the zypp.conf file.
\li \c ZYPP_LOCK_TIMEOUT=<sec> If zypp is locked by another process wait this number of seconds for the lock becoming available.
+\subsection zypp-envars-repos Variables related to repositories
+
+\li \c ZYPP_REPO_RELEASEVER=<ver> Overwrite the \c $releasever variable in repository URLs and names (\see zypp::repo::RepoVariablesStringReplacer).
+
\subsection zypp-envars-commit Variables related to commit
\li \c ZYPP_IS_RUNNING=1 Set during commit so packages pre/post/trigger scripts can detect whether rpm was called from within libzypp.
-------------------------------------------------------------------
+Mon Jan 12 15:04:17 CET 2015 - ma@suse.de
+
+- Properly propagate repo variables in service refresh.
+- Let $ZYPP_REPO_RELEASEVER overwrite $releasever in .repo files
+ (bnc#911658)
+- Call pool_set_rootdir to properly check for file conflicts.
+- Use xgettext --boost to support boost-format (%N%)
+- version 14.34.0 (30)
+
+-------------------------------------------------------------------
+Sun Jan 11 01:13:15 CET 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Jan 8 01:13:23 CET 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Jan 1 01:13:29 CET 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Dec 21 01:13:33 CET 2014 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
Fri Dec 19 10:05:00 CET 2014 - ma@suse.de
- Parse and offer productRegisterFlavor attribute (bnc#896224)
-o -name "*.cc" \
-o -name "*.cpp"`
#calling xgettext with the sourcefiles
-xgettext -s --no-wrap --add-comments --add-location --keyword=_ --keyword=_:1,2 --keyword=__ --keyword=N_ --foreign-user --copyright-holder="SuSE Linux Products GmbH, Nuernberg" --default-domain=libzypp --output="$POTFILE" $SRCFILES
+xgettext -L C++ --boost -s --no-wrap --add-comments --add-location --keyword=_ --keyword=_:1,2 --keyword=__ --keyword=N_ --foreign-user --copyright-holder="SuSE Linux Products GmbH, Nuernberg" --default-domain=libzypp --output="$POTFILE" $SRCFILES
Pathname licenseTgz() const
{ return metadatapath.empty() ? Pathname() : metadatapath / path / "license.tar.gz"; }
- Url getmirrorListUrl() const
+ Url mirrorListUrl() const
{ return replacer(mirrorlist_url); }
- Url &setmirrorListUrl()
+ void mirrorListUrl( const Url & url_r )
+ { mirrorlist_url = url_r; }
+
+ const Url & rawMirrorListUrl() const
{ return mirrorlist_url; }
const url_set & baseUrls() const
{
- if ( _baseUrls.empty() && ! getmirrorListUrl().asString().empty() )
+ if ( _baseUrls.empty() && ! mirrorListUrl().asString().empty() )
{
emptybaseurls = true;
DBG << "MetadataPath: " << metadatapath << endl;
- repo::RepoMirrorList rmurls( getmirrorListUrl(), metadatapath );
+ repo::RepoMirrorList rmurls( mirrorListUrl(), metadatapath );
_baseUrls.insert( _baseUrls.end(), rmurls.getUrls().begin(), rmurls.getUrls().end() );
}
return _baseUrls;
{ _pimpl->gpgcheck = check; }
void RepoInfo::setMirrorListUrl( const Url & url_r )
- { _pimpl->setmirrorListUrl() = url_r; }
+ { _pimpl->mirrorListUrl( url_r ); }
void RepoInfo::setGpgKeyUrl( const Url & url_r )
{ _pimpl->gpgkey_url = url_r; }
{ return _pimpl->type; }
Url RepoInfo::mirrorListUrl() const
- { return _pimpl->getmirrorListUrl(); }
+ { return _pimpl->mirrorListUrl(); }
+
+ Url RepoInfo::rawMirrorListUrl() const
+ { return _pimpl->rawMirrorListUrl(); }
Url RepoInfo::gpgKeyUrl() const
{ return _pimpl->gpgkey_url; }
std::string RepoInfo::targetDistribution() const
{ return _pimpl->targetDistro; }
+ Url RepoInfo::rawUrl() const
+ { return( _pimpl->baseUrls().empty() ? Url() : *_pimpl->baseUrls().begin() ); }
+
RepoInfo::urls_const_iterator RepoInfo::baseUrlsBegin() const
{
return make_transform_iterator( _pimpl->baseUrls().begin(),
accept = false;
}
}
- MIL << "License for " << this->name() << " has to be accepted: " << (accept?"true":"false" ) << endl;
+ MIL << "License for " << name() << " has to be accepted: " << (accept?"true":"false" ) << endl;
return accept;
}
str << tag_r << value_r << std::endl;
});
- strif( "- mirrorlist : ", _pimpl->getmirrorListUrl().asString() );
+ strif( "- mirrorlist : ", _pimpl->rawMirrorListUrl().asString() );
strif( "- path : ", path().asString() );
str << "- type : " << type() << std::endl;
str << "- priority : " << priority() << std::endl;
if ( ! _pimpl->path.empty() )
str << "path="<< path() << endl;
- if ( ! (_pimpl->getmirrorListUrl().asString().empty()) )
- str << "mirrorlist=" << _pimpl->getmirrorListUrl() << endl;
+ if ( ! (_pimpl->rawMirrorListUrl().asString().empty()) )
+ str << "mirrorlist=" << _pimpl->rawMirrorListUrl() << endl;
str << "type=" << type().asString() << endl;
if ( _pimpl->baseurl2dump() )
{
- for ( const auto & url : _pimpl->baseUrls() )
- str << "<url>" << escape(url.asString()) << "</url>" << endl;
+ for_( it, baseUrlsBegin(), baseUrlsEnd() ) // !transform iterator replaces variables
+ str << "<url>" << escape((*it).asString()) << "</url>" << endl;
}
str << "</repo>" << endl;
*
* \note A RepoInfo is a hint about how
* to create a Repository.
+ *
+ * \note Name, baseUrls and mirrorUrl are subject to repo variable replacement
+ * (\see \ref RepoVariablesStringReplacer).
*/
class RepoInfo : public repo::RepoInfoBase
{
*/
bool baseUrlsEmpty() const;
/**
- * whether there are manualy configured repository urls
+ * Whether there are manualy configured repository urls.
+ * If \c false, a mirrorlist might be used.
*/
bool baseUrlSet() const;
/**
Url url() const
{ return( baseUrlsEmpty() ? Url() : *baseUrlsBegin()); }
/**
+ * Pars pro toto: The first repository url (no variables replaced)
+ */
+ Url rawUrl() const;
+ /**
* A Url under which the metadata are located, or a set of mirrors.
*
* This can't be empty in order the repository to be valid
*/
Url mirrorListUrl() const;
/**
+ * The raw mirrorListUrl (no variables replaced).
+ */
+ Url rawMirrorListUrl() const;
+ /**
* Set mirror list url. \see mirrorListUrl
* \param url The base url for the list
*/
/**
* Write this RepoInfo object into \a str in a <tr>.repo</tt> file format.
+ * Raw values, no variable replacement.
*/
virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
/**
* Write an XML representation of this RepoInfo object.
+ * Repo variables replaced.
*
* \param str
* \param content this argument is ignored (used in other classed derived
else
{
// service repo can contain only one URL now, so no need to iterate.
- url = *it->baseUrlsBegin();
+ url = it->rawUrl(); // raw!
}
// libzypp currently has problem with separate url + path handling
// all other attributes follow the service request:
+ // changed name (raw!)
+ if ( oldRepo->rawName() != it->rawName() )
+ {
+ DBG << "Service repo " << it->alias() << " gets new NAME " << it->rawName() << endl;
+ oldRepo->setName( it->rawName() );
+ oldRepoModified = true;
+ }
+
// changed autorefresh
if ( oldRepo->autorefresh() != it->autorefresh() )
{
// changed url?
// service repo can contain only one URL now, so no need to iterate.
- if ( oldRepo->url() != it->url() )
+ if ( oldRepo->rawUrl() != it->rawUrl() )
{
- DBG << "Service repo " << it->alias() << " gets new URL " << it->url() << endl;
- oldRepo->setBaseUrl( it->url() );
+ DBG << "Service repo " << it->alias() << " gets new URL " << it->rawUrl() << endl;
+ oldRepo->setBaseUrl( it->rawUrl() );
oldRepoModified = true;
}
/** \overload */
static std::string targetDistributionRelease( const Pathname & root_r );
- /** This is \c register.release attribute of the installed base product.
+ /** This is \c register.flavor attribute of the installed base product.
* Used for registration.
* \note don't mistake this for \ref distributionFlavor
*/
std::string RepoInfoBase::name() const
{
- if ( _pimpl->_name.empty() )
+ if ( rawName().empty() )
return alias();
- return repo::RepoVariablesStringReplacer()( _pimpl->_name );
+ return repo::RepoVariablesStringReplacer()( rawName() );
}
+ std::string RepoInfoBase::rawName() const
+ { return _pimpl->_name; }
+
std::string RepoInfoBase::label() const
{
if ( ZConfig::instance().repoLabelIsAlias() )
{
str << "--------------------------------------" << std::endl;
str << "- alias : " << alias() << std::endl;
- str << "- name : " << name() << std::endl;
+ if ( ! rawName().empty() )
+ str << "- name : " << rawName() << std::endl;
str << "- enabled : " << enabled() << std::endl;
str << "- autorefresh : " << autorefresh() << std::endl;
{
// we save the original data without variable replacement
str << "[" << alias() << "]" << endl;
- str << "name=" << name() << endl;
+ if ( ! rawName().empty() )
+ str << "name=" << rawName() << endl;
str << "enabled=" << (enabled() ? "1" : "0") << endl;
str << "autorefresh=" << (autorefresh() ? "1" : "0") << endl;
/**
* \short Base class implementing common features of \ref RepoInfo and
* \ref ServiceInfo.
+ *
+ * \note Name is subject to repo variable replacement
+ * (\see \ref RepoVariablesStringReplacer).
*/
class RepoInfoBase
{
std::string escaped_alias() const;
/**
- * \short Repository short label
+ * \short Repository name
*
- * Short label or description of the repository.
+ * Short label or description of the repository. Defaults to \ref alias.
+ * Subject to repo variable replacement (\see \ref RepoVariablesStringReplacer).
* ie: "SUSE Linux 10.2 updates"
*/
std::string name() const;
+ /** The raw metadata name (no default, no variables replaced). */
+ std::string rawName() const;
+
/**
* \short Label for use in messages for the user interface.
*
virtual std::ostream & dumpOn( std::ostream & str ) const;
/**
- * Write this RepoInfoBase object into \a str in
- * a <tr>.repo</tt> (ini) file format.
+ * Write this RepoInfoBase object into \a str in a <tr>.repo</tt> (ini) file format.
+ * Raw values, no variable replacement.
*/
virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
/**
* Write an XML representation of this object with content (if available).
+ * Repo variables replaced.
*/
virtual std::ostream & dumpAsXmlOn( std::ostream & str, const std::string & content = "" ) const;
///////////////////////////////////////////////////////////////////
namespace zypp
{
+ namespace env
+ {
+ /** Use faked releasever (e.g. for 'zupper dup' to next distro version */
+ inline std::string ZYPP_REPO_RELEASEVER()
+ {
+ const char * env = getenv("ZYPP_REPO_RELEASEVER");
+ return( env ? env : "" );
+ }
+ }
+
///////////////////////////////////////////////////////////////////
namespace repo
{
const std::string & releasever() const
{
if( _releasever.empty() )
- _releasever = Target::distributionVersion( Pathname()/*guess*/ );
+ {
+ _releasever = env::ZYPP_REPO_RELEASEVER();
+ if( _releasever.empty() )
+ _releasever = Target::distributionVersion( Pathname()/*guess*/ );
+ else
+ WAR << "ENV overwrites $releasever=" << _releasever << endl;
+ }
return _releasever;
}
*
* Replaces '$arch', '$basearch' and $releasever in a string
* with the global ZYpp values.
+ *
+ * \note The $releasever value is overwritten by the environment
+ * variable \c ZYPP_REPO_RELEASEVER. This might be handy for
+ * distribution upogrades like this:
+ * \code
+ * $ export ZYPP_REPO_RELEASEVER=13.2
+ * $ zypper lr -u
+ * $ zypper dup
+ * ....upgrades to 13.2...
+ * \endcode
+ * (see \ref zypp-envars)
+ *
* \code
* Example:
* ftp://user:secret@site.net/$arch/ -> ftp://user:secret@site.net/i686/
void Pool::prepareForSolving() const
{ return myPool().prepareForSolving(); }
+ Pathname Pool::rootDir() const
+ { return myPool().rootDir(); }
+
+ void Pool::rootDir( const Pathname & root_r )
+ { return myPool().rootDir( root_r ); }
+
bool Pool::reposEmpty() const
{ return ! myPool()->urepos; }
/** \ref prepare plus some expensive checks done before solving only. */
void prepareForSolving() const;
+ /** Get rootdir (for file conflicts check) */
+ Pathname rootDir() const;
+
+ /** Set rootdir (for file conflicts check) */
+ void rootDir( const Pathname & root_r );
+
public:
/** Whether \ref Pool contains repos. */
bool reposEmpty() const;
::_Repo * systemRepo() const
{ return _pool->installed; }
+ /** Get rootdir (for file conflicts check) */
+ Pathname rootDir() const
+ {
+ const char * rd = ::pool_get_rootdir( _pool );
+ return( rd ? rd : "/" );
+ }
+
+ /** Set rootdir (for file conflicts check) */
+ void rootDir( const Pathname & root_r )
+ {
+ if ( root_r.empty() || root_r == "/" )
+ ::pool_set_rootdir( _pool, nullptr );
+ else
+ ::pool_set_rootdir( _pool, root_r.c_str() );
+ }
+
public:
/** \name Actions invalidating housekeeping data.
*
system.addSolv( rpmsolv );
}
+ sat::Pool::instance().rootDir( _root );
// (Re)Load the requested locales et al.
// If the requested locales are empty, we leave the pool untouched