Mailinglist Archive: zypp-commit (223 mails)

< Previous Next >
[zypp-commit] r10691 - in /trunk/libzypp/zypp: CMakeLists.txt RepoInfo.cc RepoInfo.h repo/RepoInfoBase.cc repo/RepoInfoBase.h repo/RepoInfoBaseImpl.h sat/Pool.cc
  • From: jkupec@xxxxxxxxxxxxxxxx
  • Date: Tue, 29 Jul 2008 15:54:31 -0000
  • Message-id: <20080729155431.6BB7B2E334@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Tue Jul 29 17:54:30 2008
New Revision: 10691

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10691&view=rev
Log:
- RepoInfoBase added for common SericeInfo and RepoInfo stuff

Added:
trunk/libzypp/zypp/repo/RepoInfoBase.cc
trunk/libzypp/zypp/repo/RepoInfoBase.h
trunk/libzypp/zypp/repo/RepoInfoBaseImpl.h
Modified:
trunk/libzypp/zypp/CMakeLists.txt
trunk/libzypp/zypp/RepoInfo.cc
trunk/libzypp/zypp/RepoInfo.h
trunk/libzypp/zypp/sat/Pool.cc

Modified: trunk/libzypp/zypp/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/CMakeLists.txt?rev=10691&r1=10690&r2=10691&view=diff
==============================================================================
--- trunk/libzypp/zypp/CMakeLists.txt (original)
+++ trunk/libzypp/zypp/CMakeLists.txt Tue Jul 29 17:54:30 2008
@@ -705,6 +705,7 @@
repo/MediaInfoDownloader.cc
repo/Downloader.cc
repo/RepoVariables.cc
+ repo/RepoInfoBase.cc
)

SET( zypp_repo_HEADERS
@@ -720,6 +721,8 @@
repo/MediaInfoDownloader.h
repo/Downloader.h
repo/RepoVariables.h
+ repo/RepoInfoBase.h
+ repo/RepoInfoBaseImpl.h
)

INSTALL( FILES

Modified: trunk/libzypp/zypp/RepoInfo.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoInfo.cc?rev=10691&r1=10690&r2=10691&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoInfo.cc (original)
+++ trunk/libzypp/zypp/RepoInfo.cc Tue Jul 29 17:54:30 2008
@@ -16,6 +16,7 @@
#include "zypp/media/MediaAccess.h"

#include "zypp/RepoInfo.h"
+#include "zypp/repo/RepoInfoBaseImpl.h"

using namespace std;

@@ -28,29 +29,18 @@
// CLASS NAME : RepoInfo::Impl
//
/** RepoInfo implementation. */
- struct RepoInfo::Impl
+ struct RepoInfo::Impl : public repo::RepoInfoBase::Impl
{
- enum FlagsDeterminedState
- {
- FLAG_ENABLED = 1,
- FLAG_AUTOREFRESH = 2,
- FLAG_GPGCHECK = 4,
- FLAG_KEEPPACKAGES = 8
- };
-
Impl()
- : enabled (false),
- autorefresh(false),
- gpgcheck(true),
- keeppackages(false),
- type(repo::RepoType::NONE_e),
- flags_determined(0)
+ : repo::RepoInfoBase::Impl()
+ , gpgcheck(indeterminate)
+ , keeppackages(indeterminate)
+ , type(repo::RepoType::NONE_e)
{}

~Impl()
- {
- //MIL << std::endl;
- }
+ {}
+
public:
static const unsigned defaultPriority = 99;

@@ -65,24 +55,17 @@
}

public:
- bool enabled;
- bool autorefresh;
- bool gpgcheck;
- bool keeppackages;
+ TriBool gpgcheck;
+ TriBool keeppackages;
Url gpgkey_url;
repo::RepoType type;
Url mirrorlist_url;
std::set<Url> baseUrls;
Pathname path;
- std::string alias;
- std::string escaped_alias;
- std::string name;
std::string service;
- Pathname filepath;
Pathname metadatapath;
Pathname packagespath;
DefaultIntegral<unsigned,defaultPriority> priority;
- int flags_determined;
public:

private:
@@ -134,25 +117,9 @@
return *this;
}

-
- RepoInfo & RepoInfo::setEnabled( bool enabled )
- {
- _pimpl->enabled = enabled;
- _pimpl->flags_determined |= Impl::FLAG_ENABLED;
- return *this;
- }
-
- RepoInfo & RepoInfo::setAutorefresh( bool autorefresh )
- {
- _pimpl->autorefresh = autorefresh;
- _pimpl->flags_determined |= Impl::FLAG_AUTOREFRESH;
- return *this;
- }
-
RepoInfo & RepoInfo::setGpgCheck( bool check )
{
_pimpl->gpgcheck = check;
- _pimpl->flags_determined |= Impl::FLAG_GPGCHECK;
return *this;
}

@@ -170,18 +137,6 @@

RepoInfo & RepoInfo::addBaseUrl( const Url &url )
{
- // set only if not already set externally (bnc #394728)
- if (!(_pimpl->flags_determined & Impl::FLAG_KEEPPACKAGES) &&
- _pimpl->baseUrls.empty())
- {
- if ( media::MediaAccess::downloads( url ) )
- // don't do this via setKeepPackages, it would set the flags_determined
- // for FLAG_KEEPPACKAGES
- _pimpl->keeppackages = true;
- else
- _pimpl->keeppackages = false;
- }
-
_pimpl->baseUrls.insert(url);
return *this;
}
@@ -199,23 +154,6 @@
return *this;
}

- RepoInfo & RepoInfo::setAlias( const std::string &alias )
- {
- _pimpl->alias = alias;
- // replace slashes with underscores
- std::string fnd="/";
- std::string rep="_";
- std::string escaped_alias = alias;
- size_t pos = escaped_alias.find(fnd);
- while(pos!=string::npos)
- {
- escaped_alias.replace(pos,fnd.length(),rep);
- pos = escaped_alias.find(fnd,pos+rep.length());
- }
- _pimpl->escaped_alias = escaped_alias;
- return *this;
- }
-
RepoInfo & RepoInfo::setType( const repo::RepoType &t )
{
_pimpl->type = t;
@@ -225,17 +163,6 @@
void RepoInfo::setProbedType( const repo::RepoType &t ) const
{ _pimpl->setProbedType( t ); }

- RepoInfo & RepoInfo::setName( const std::string &name )
- {
- _pimpl->name = name;
- return *this;
- }
-
- RepoInfo & RepoInfo::setFilepath( const Pathname &filepath )
- {
- _pimpl->filepath = filepath;
- return *this;
- }

RepoInfo & RepoInfo::setMetadataPath( const Pathname &path )
{
@@ -252,7 +179,6 @@
RepoInfo & RepoInfo::setKeepPackages( bool keep )
{
_pimpl->keeppackages = keep;
- _pimpl->flags_determined |= Impl::FLAG_KEEPPACKAGES;
return *this;
}

@@ -262,34 +188,8 @@
return *this;
}

- bool RepoInfo::enabled() const
- { return _pimpl->enabled; }
-
- bool RepoInfo::autorefresh() const
- { return _pimpl->autorefresh; }
-
bool RepoInfo::gpgCheck() const
- { return _pimpl->gpgcheck; }
-
- std::string RepoInfo::alias() const
- { return _pimpl->alias; }
-
- std::string RepoInfo::escaped_alias() const
- { return _pimpl->escaped_alias; }
-
- std::string RepoInfo::name() const
- {
- if ( _pimpl->name.empty() )
- {
- return alias();
- }
-
- repo::RepoVariablesStringReplacer replacer;
- return replacer(_pimpl->name);
- }
-
- Pathname RepoInfo::filepath() const
- { return _pimpl->filepath; }
+ { return indeterminate(_pimpl->gpgcheck) ? true : (bool) _pimpl->gpgcheck; }

Pathname RepoInfo::metadataPath() const
{ return _pimpl->metadatapath; }
@@ -347,13 +247,26 @@
bool RepoInfo::baseUrlsEmpty() const
{ return _pimpl->baseUrls.empty(); }

+ // false by default (if not set by setKeepPackages)
bool RepoInfo::keepPackages() const
- { return _pimpl->keeppackages; }
+ {
+ if (indeterminate(_pimpl->keeppackages))
+ {
+ if (_pimpl->baseUrls.empty())
+ return false;
+ else if ( media::MediaAccess::downloads( *baseUrlsBegin() ) )
+ return true;
+ else
+ return false;
+ }
+
+ return (bool) _pimpl->keeppackages;
+ }
+

std::ostream & RepoInfo::dumpOn( std::ostream & str ) const
{
- str << "--------------------------------------" << std::endl;
- str << "- alias : " << alias() << std::endl;
+ RepoInfoBase::dumpOn(str);
for ( urls_const_iterator it = baseUrlsBegin();
it != baseUrlsEnd();
++it )
@@ -362,10 +275,8 @@
}
str << "- path : " << path() << std::endl;
str << "- type : " << type() << std::endl;
- str << "- enabled : " << enabled() << std::endl;
str << "- priority : " << priority() << std::endl;

- str << "- autorefresh : " << autorefresh() << std::endl;
str << "- gpgcheck : " << gpgCheck() << std::endl;
str << "- gpgkey : " << gpgKeyUrl() << std::endl;
str << "- keeppackages: " << keepPackages() << std::endl;
@@ -376,9 +287,7 @@

std::ostream & RepoInfo::dumpRepoOn( std::ostream & str ) const
{
- // we save the original data without variable replacement
- str << "[" << alias() << "]" << endl;
- str << "name=" << _pimpl->name << endl;
+ RepoInfoBase::dumpAsIniOn(str);

if ( ! _pimpl->baseUrls.empty() )
str << "baseurl=";
@@ -396,17 +305,17 @@
str << "mirrorlist=" << _pimpl->mirrorlist_url << endl;

str << "type=" << type().asString() << endl;
- str << "enabled=" << (enabled() ? "1" : "0") << endl;

if ( priority() != defaultPriority() )
str << "priority=" << priority() << endl;

- str << "autorefresh=" << (autorefresh() ? "1" : "0") << endl;
- str << "gpgcheck=" << (gpgCheck() ? "1" : "0") << endl;
+ if (!indeterminate(_pimpl->gpgcheck))
+ str << "gpgcheck=" << (gpgCheck() ? "1" : "0") << endl;
if ( ! (gpgKeyUrl().asString().empty()) )
str << "gpgkey=" <<gpgKeyUrl() << endl;

- str << "keeppackages=" << keepPackages() << endl;
+ if (!indeterminate(_pimpl->keeppackages))
+ str << "keeppackages=" << keepPackages() << endl;

if( ! service().empty() )
str << "service=" << service() << endl;

Modified: trunk/libzypp/zypp/RepoInfo.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoInfo.h?rev=10691&r1=10690&r2=10691&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoInfo.h (original)
+++ trunk/libzypp/zypp/RepoInfo.h Tue Jul 29 17:54:30 2008
@@ -12,18 +12,18 @@
#ifndef ZYPP2_REPOSITORYINFO_H
#define ZYPP2_REPOSITORYINFO_H

-#include <iosfwd>
#include <list>
#include <set>
-#include "zypp/base/PtrTypes.h"
+
#include "zypp/base/Iterator.h"
#include "zypp/base/Deprecated.h"

-#include "zypp/Pathname.h"
#include "zypp/Url.h"
#include "zypp/repo/RepoType.h"
#include "zypp/repo/RepoVariables.h"

+#include "zypp/repo/RepoInfoBase.h"
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
@@ -62,7 +62,7 @@
* \note A RepoInfo is a hint about how
* to create a Repository.
*/
- class RepoInfo
+ class RepoInfo : public repo::RepoInfoBase
{
friend std::ostream & operator<<( std::ostream & str, const RepoInfo & obj
);

@@ -74,20 +74,6 @@
~RepoInfo();

/**
- * unique identifier for this source. If not specified
- * It should be generated from the base url.
- *
- * Normally, in a .repo file the section name is used
- * ( [somerepo] )
- */
- std::string alias() const;
-
- /**
- * Same as alias(), just escaped in a way to be a valid file name.
- */
- std::string escaped_alias() const;
-
- /**
* Repository priority for solver.
* Some number between \c 1 (highest priority) and \c 99 (\ref
defaultPriority).
*/
@@ -165,18 +151,6 @@
*/
bool baseUrlsEmpty() const;

- /**
- * If enabled is false, then this repository must be ignored as if does
- * not exists, except when checking for duplicate alias.
- */
- bool enabled() const;
-
- /**
- * If true, the repostory must be refreshed before creating resolvables
- * from it
- */
- bool autorefresh() const;
-
/**
* Type of repository,
*
@@ -184,23 +158,6 @@
repo::RepoType type() const;

/**
- * \short Repository short label
- *
- * Short label or description of the repository, to be used on
- * the user interface.
- * ie: "SUSE Linux 10.2 updates"
- */
- std::string name() const;
-
- /**
- * \short File where this repo was read from
- *
- * \note could be an empty pathname for repo
- * infos created in memory.
- */
- Pathname filepath() const;
-
- /**
* \short Path where this repo metadata was read from
*
* \note could be an empty pathname for repo
@@ -208,12 +165,12 @@
*/
Pathname metadataPath() const;

- /**
+ /**
* \short Path where this repo packages are cached
*/
Pathname packagesPath() const;

- /**
+ /**
* \short Whether to check or not this repository with gpg
*
* \note This is a just a hint to the application and can
@@ -274,24 +231,6 @@
RepoInfo & setMirrorListUrl( const Url &url );

/**
- * enable or disable the repository \see enabled
- * \param enabled
- */
- RepoInfo & setEnabled( bool enabled );
-
- /**
- * enable or disable autorefresh \see autorefresh
- * \param enabled
- */
- RepoInfo & setAutorefresh( bool autorefresh );
-
- /**
- * set the repository alias \see alias
- * \param alias
- */
- RepoInfo & setAlias( const std::string &alias );
-
- /**
* set the repository type \see type
* \param t
*/
@@ -306,22 +245,6 @@
void setProbedType( const repo::RepoType &t ) const;

/**
- * set the repository name \see name
- * \param name
- */
- RepoInfo & setName( const std::string &name );
-
- /**
- * \short set the path to the .repo file
- *
- * The path to the .repo file where this repository
- * was defined, or empty if nowhere.
- *
- * \param path File path
- */
- RepoInfo & setFilepath( const Pathname &filename );
-
- /**
* \short set the path where the local metadata is stored
*
* The path to the metadata of this repository
@@ -380,12 +303,12 @@
* Write a human-readable representation of this RepoInfo object
* into the \a str stream. Useful for logging.
*/
- std::ostream & dumpOn( std::ostream & str ) const;
+ virtual std::ostream & dumpOn( std::ostream & str ) const;

/**
* Write this RepoInfo object into \a str in a <tr>.repo</tt> file format.
*/
- std::ostream & dumpRepoOn( std::ostream & str ) const;
+ virtual std::ostream & dumpRepoOn( std::ostream & str ) const;

class Impl;
private:

Added: trunk/libzypp/zypp/repo/RepoInfoBase.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/RepoInfoBase.cc?rev=10691&view=auto
==============================================================================
--- trunk/libzypp/zypp/repo/RepoInfoBase.cc (added)
+++ trunk/libzypp/zypp/repo/RepoInfoBase.cc Tue Jul 29 17:54:30 2008
@@ -0,0 +1,158 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/repo/RepoInfoBase.cc
+ *
+ */
+#include <iostream>
+
+#include "zypp/repo/RepoInfoBase.h"
+#include "zypp/repo/RepoInfoBaseImpl.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace repo
+ { /////////////////////////////////////////////////////////////////
+
+
+ /** \relates RepoInfo::Impl Stream output */
+ inline std::ostream & operator<<( std::ostream & str, const
RepoInfoBase::Impl & obj )
+ {
+ return str << "RepoInfo::Impl";
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : RepoInfoBase
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : RepoInfo::RepoInfo
+ // METHOD TYPE : Ctor
+ //
+ RepoInfoBase::RepoInfoBase()
+ : _pimpl( new Impl() )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : RepoInfoBase::~RepoInfoBase
+ // METHOD TYPE : Dtor
+ //
+ RepoInfoBase::~RepoInfoBase()
+ {}
+
+ RepoInfoBase & RepoInfoBase::setEnabled( bool enabled )
+ {
+ _pimpl->enabled = enabled;
+ return *this;
+ }
+
+ RepoInfoBase & RepoInfoBase::setAutorefresh( bool autorefresh )
+ {
+ _pimpl->autorefresh = autorefresh;
+ return *this;
+ }
+
+ RepoInfoBase & RepoInfoBase::setAlias( const std::string &alias )
+ {
+ _pimpl->alias = alias;
+ // replace slashes with underscores
+ std::string fnd="/";
+ std::string rep="_";
+ std::string escaped_alias = alias;
+ size_t pos = escaped_alias.find(fnd);
+ while(pos!=string::npos)
+ {
+ escaped_alias.replace(pos,fnd.length(),rep);
+ pos = escaped_alias.find(fnd,pos+rep.length());
+ }
+ _pimpl->escaped_alias = escaped_alias;
+ return *this;
+ }
+
+ RepoInfoBase & RepoInfoBase::setName( const std::string &name )
+ {
+ _pimpl->name = name;
+ return *this;
+ }
+
+ RepoInfoBase & RepoInfoBase::setFilepath( const Pathname &filepath )
+ {
+ _pimpl->filepath = filepath;
+ return *this;
+ }
+
+ // true by default (if not set by setEnabled())
+ bool RepoInfoBase::enabled() const
+ { return indeterminate(_pimpl->enabled) ? true : (bool) _pimpl->enabled; }
+
+ // false by default (if not set by setAutorefresh())
+ bool RepoInfoBase::autorefresh() const
+ { return indeterminate(_pimpl->autorefresh) ? false : (bool)
_pimpl->autorefresh; }
+
+ std::string RepoInfoBase::alias() const
+ { return _pimpl->alias; }
+
+ std::string RepoInfoBase::escaped_alias() const
+ { return _pimpl->escaped_alias; }
+
+ std::string RepoInfoBase::name() const
+ {
+ if ( _pimpl->name.empty() )
+ {
+ return alias();
+ }
+
+ //! \todo repo::RepoVariablesStringReplacer replacer;
+ return _pimpl->name; //replacer(_pimpl->name);
+ }
+
+ Pathname RepoInfoBase::filepath() const
+ { return _pimpl->filepath; }
+
+
+ std::ostream & RepoInfoBase::dumpOn( std::ostream & str ) const
+ {
+ str << "--------------------------------------" << std::endl;
+ str << "- alias : " << alias() << std::endl;
+ str << "- alias : " << name() << std::endl;
+ str << "- enabled : " << enabled() << std::endl;
+ str << "- autorefresh : " << autorefresh() << std::endl;
+
+ return str;
+ }
+
+ std::ostream & RepoInfoBase::dumpAsIniOn( std::ostream & str ) const
+ {
+ // we save the original data without variable replacement
+ str << "[" << alias() << "]" << endl;
+ str << "name=" << name() << endl;
+ str << "enabled=" << (enabled() ? "1" : "0") << endl;
+ str << "autorefresh=" << (autorefresh() ? "1" : "0") << endl;
+
+ return str;
+ }
+
+ std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj )
+ {
+ return obj.dumpOn(str);
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace repo
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////

Added: trunk/libzypp/zypp/repo/RepoInfoBase.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/RepoInfoBase.h?rev=10691&view=auto
==============================================================================
--- trunk/libzypp/zypp/repo/RepoInfoBase.h (added)
+++ trunk/libzypp/zypp/repo/RepoInfoBase.h Tue Jul 29 17:54:30 2008
@@ -0,0 +1,158 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/repo/RepoInfoBase.h
+ *
+ */
+#ifndef REPOINFOBASE_H_
+#define REPOINFOBASE_H_
+
+#include <iosfwd>
+
+#include "zypp/base/PtrTypes.h"
+
+#include "zypp/Pathname.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace repo
+ { /////////////////////////////////////////////////////////////////
+
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : RepoInfoBase
+ //
+ /**
+ * \short Base class implementing common features of \ref RepoInfo and
+ * \ref ServiceInfo.
+ */
+ class RepoInfoBase
+ {
+ friend std::ostream & operator<<( std::ostream & str, const RepoInfoBase
& obj );
+
+ public:
+ RepoInfoBase();
+ ~RepoInfoBase();
+
+ /**
+ * unique identifier for this source. If not specified
+ * It should be generated from the base url.
+ *
+ * Normally, in a .repo file the section name is used
+ * ( [somerepo] )
+ */
+ std::string alias() const;
+
+ /**
+ * Same as alias(), just escaped in a way to be a valid file name.
+ */
+ std::string escaped_alias() const;
+
+ /**
+ * \short Repository short label
+ *
+ * Short label or description of the repository, to be used on
+ * the user interface.
+ * ie: "SUSE Linux 10.2 updates"
+ */
+ std::string name() const;
+
+ /**
+ * If enabled is false, then this repository must be ignored as if does
+ * not exists, except when checking for duplicate alias.
+ */
+ bool enabled() const;
+
+ /**
+ * If true, the repostory must be refreshed before creating resolvables
+ * from it
+ */
+ bool autorefresh() const;
+
+ /**
+ * \short File where this repo was read from
+ *
+ * \note could be an empty pathname for repo
+ * infos created in memory.
+ */
+ Pathname filepath() const;
+
+
+ public:
+
+ /**
+ * set the repository alias \see alias
+ * \param alias
+ */
+ RepoInfoBase & setAlias( const std::string &alias );
+
+ /**
+ * set the repository name \see name
+ * \param name
+ */
+ RepoInfoBase & setName( const std::string &name );
+
+ /**
+ * enable or disable the repository \see enabled
+ * \param enabled
+ */
+ RepoInfoBase & setEnabled( bool enabled );
+
+ /**
+ * enable or disable autorefresh \see autorefresh
+ * \param enabled
+ */
+ RepoInfoBase & setAutorefresh( bool autorefresh );
+
+ /**
+ * \short set the path to the .repo file
+ *
+ * The path to the .repo file where this repository
+ * was defined, or empty if nowhere.
+ *
+ * \param path File path
+ */
+ RepoInfoBase & setFilepath( const Pathname &filename );
+
+ /**
+ * Write a human-readable representation of this RepoInfoBase object
+ * into the \a str stream. Useful for logging.
+ */
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ /**
+ * Write this RepoInfoBase object into \a str in
+ * a <tr>.repo</tt> (ini) file format.
+ */
+ virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
+
+ class Impl;
+ private:
+ /** Pointer to implementation */
+ RWCOW_pointer<Impl> _pimpl;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /** \relates RepoInfoBase Stream output */
+ std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj );
+
+ inline bool operator<( const RepoInfoBase & lhs, const RepoInfoBase & rhs )
+ { return lhs.alias() < rhs.alias(); }
+
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace repo
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+
+#endif /*REPOINFOBASE_H_*/

Added: trunk/libzypp/zypp/repo/RepoInfoBaseImpl.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/RepoInfoBaseImpl.h?rev=10691&view=auto
==============================================================================
--- trunk/libzypp/zypp/repo/RepoInfoBaseImpl.h (added)
+++ trunk/libzypp/zypp/repo/RepoInfoBaseImpl.h Tue Jul 29 17:54:30 2008
@@ -0,0 +1,65 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/repo/RepoInfoBaseImpl.h
+ *
+ */
+#ifndef REPOINFOBASEIMPL_H_
+#define REPOINFOBASEIMPL_H_
+
+#include <string>
+
+#include "zypp/TriBool.h"
+#include "zypp/Pathname.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace repo
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : RepoInfoBase::Impl
+ //
+ struct RepoInfoBase::Impl
+ {
+ Impl()
+ : enabled (indeterminate)
+ , autorefresh (indeterminate)
+ {}
+
+ ~Impl()
+ {}
+
+ public:
+ TriBool enabled;
+ TriBool autorefresh;
+ std::string alias;
+ std::string escaped_alias;
+ std::string name;
+ Pathname filepath;
+ public:
+
+ private:
+ friend Impl * rwcowClone<Impl>( const Impl * rhs );
+ /** clone for RWCOW_pointer */
+ Impl * clone() const
+ { return new Impl( *this ); }
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace repo
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+
+#endif /*REPOINFOBASEIMPL_H_*/

Modified: trunk/libzypp/zypp/sat/Pool.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.cc?rev=10691&r1=10690&r2=10691&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.cc (original)
+++ trunk/libzypp/zypp/sat/Pool.cc Tue Jul 29 17:54:30 2008
@@ -107,11 +107,13 @@
if ( alias_r == systemRepoAlias() )
{
// autoprovide (dummy) RepoInfo
- ret.setInfo( RepoInfo()
- .setAlias( alias_r )
- .setName( alias_r )
- .setAutorefresh( true )
- .setEnabled( true ) );
+ RepoInfo info;
+ info
+ .setAlias( alias_r )
+ .setName( alias_r )
+ .setAutorefresh( true )
+ .setEnabled( true );
+ ret.setInfo( info );
}
return ret;
}

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages