#include "zypp/detail/PackageImplIf.h"
#include "zypp/Package.h"
#include "zypp2/RepositoryFactory.h"
-#include "zypp2/repository/cached/CachedRepositoryImpl.h"
+#include "zypp2/repo/cached/RepoImpl.h"
#include "zypp/data/ResolvableData.h"
using namespace std;
using namespace zypp;
-using namespace zypp::repository;
-using namespace zypp::repository::cached;
+using namespace zypp::repo;
+using namespace zypp::repo::cached;
int main(int argc, char **argv)
#include "zypp/detail/PackageImplIf.h"
#include "zypp/Package.h"
#include "zypp2/RepositoryFactory.h"
-#include "zypp2/RepositoryInfo.h"
+#include "zypp2/RepoInfo.h"
-#include "zypp2/repository/cached/CachedRepositoryImpl.h"
+#include "zypp2/repo/cached/RepoImpl.h"
#include "zypp/data/ResolvableData.h"
-#include "zypp2/RepositoryManager.h"
-#include "zypp2/RepositoryInfo.h"
+#include "zypp2/RepoManager.h"
+#include "zypp2/RepoInfo.h"
using namespace std;
Pathname dbpath = Pathname(getenv("PWD"));
- RepositoryManager manager;
- RepositoryInfoList repos = manager.knownRepositories();
+ RepoManager manager;
+ RepoInfoList repos = manager.knownRepositories();
- for ( RepositoryInfoList::const_iterator it = repos.begin(); it != repos.end(); ++it )
+ for ( RepoInfoList::const_iterator it = repos.begin(); it != repos.end(); ++it )
{
cout << *it << endl;
}
return str << url.asString();
}
+ bool operator<( const Url &lhs, const Url &rhs )
+ {
+ return (lhs.asString() < rhs.asString());
+ }
////////////////////////////////////////////////////////////////////
} // namespace zypp
std::ostream & operator<<( std::ostream & str, const Url & url );
+ /**
+ * needed for std::set
+ */
+ bool operator<( const Url &lhs, const Url &rhs );
+
////////////////////////////////////////////////////////////////////
} // namespace zypp
//////////////////////////////////////////////////////////////////////
{
str << "--------------------------------------" << std::endl;
str << "- alias : " << alias() << std::endl;
- //str << "- url : " << baseUrl() << std::endl;
+ std::set<Url> url_set(urls());
+ for ( std::set<Url>::const_iterator it = url_set.begin();
+ it != url_set.end();
+ ++it )
+ {
+ str << "- url : " << *it << std::endl;
+ }
+
str << "- type : " << type() << std::endl;
str << "- enabled : " << enabled() << std::endl;
str << "- autorefresh : " << autorefresh() << std::endl;
return str;
}
+ std::ostream & operator<<( std::ostream & str, const RepoInfo & obj )
+ {
+ return obj.dumpOn(str);
+ }
+
/////////////////////////////////////////////////////////////////
} // namespace zypp2
///////////////////////////////////////////////////////////////////
++it )
{
- MIL << (*it).first << endl;
+ //MIL << (*it).first << endl;
if (it->first == "name" )
info.setName(it-> second);
else if ( it->first == "enabled" )
}
// add it to the list.
+ repos.push_back(info);
}
-// dictionary *d = iniparser_new(file.c_str());
-//
-// if ( d == NULL )
-// ZYPP_THROW(Exception("Failed creating dictionary"));
-//
-// int n = iniparser_getnsec(d);
-// MIL << n << endl;
-//
-// for ( int i = 0; i < n; i++ )
-// {
-// MIL << iniparser_getsecname(d, i) << endl;
-//
-// }
- return std::list<RepoInfo>();
+ return repos;
}
static std::list<RepoInfo> repositories_in_path( const Pathname &dir )
std::list<RepoInfo> RepoManager::knownRepositories()
{
-
-
- return std::list<RepoInfo>();
+ return repositories_in_path("/etc/zypp/repos.d");
}
} // ns zypp