Zypp Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
June 2007
- 7 participants
- 204 discussions
[zypp-commit] r5829 - in /trunk/libzypp/zypp: ProblemSolution.h Resolver.cc Resolver.h ResolverProblem.h solver/detail/Resolver.cc solver/detail/Resolver.h solver/detail/ResolverInfoNeededBy.h
by schubi2@svn.opensuse.org 22 Jun '07
by schubi2@svn.opensuse.org 22 Jun '07
22 Jun '07
Author: schubi2
Date: Fri Jun 22 15:27:34 2007
New Revision: 5829
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5829&view=rev
Log:
New API calls added:
const solver::detail::ItemCapKindList isSelectedBy (const PoolItem_Ref
item);
const solver::detail::ItemCapKindList selects (const PoolItem_Ref
item);
Modified:
trunk/libzypp/zypp/ProblemSolution.h
trunk/libzypp/zypp/Resolver.cc
trunk/libzypp/zypp/Resolver.h
trunk/libzypp/zypp/ResolverProblem.h
trunk/libzypp/zypp/solver/detail/Resolver.cc
trunk/libzypp/zypp/solver/detail/Resolver.h
trunk/libzypp/zypp/solver/detail/ResolverInfoNeededBy.h
Modified: trunk/libzypp/zypp/ProblemSolution.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ProblemSolution.h?r…
==============================================================================
--- trunk/libzypp/zypp/ProblemSolution.h (original)
+++ trunk/libzypp/zypp/ProblemSolution.h Fri Jun 22 15:27:34 2007
@@ -14,7 +14,6 @@
#include "zypp/base/ReferenceCounted.h"
#include "zypp/base/PtrTypes.h"
-#include "zypp/Resolver.h"
#include "zypp/solver/detail/Resolver.h"
#include "zypp/ResolverProblem.h"
#include "zypp/solver/detail/SolutionAction.h"
Modified: trunk/libzypp/zypp/Resolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Resolver.cc?rev=582…
==============================================================================
--- trunk/libzypp/zypp/Resolver.cc (original)
+++ trunk/libzypp/zypp/Resolver.cc Fri Jun 22 15:27:34 2007
@@ -110,7 +110,14 @@
{ return _pimpl->maxSolverPasses(); }
bool Resolver::createSolverTestcase (const std::string & dumpPath)
{ solver::detail::Testcase testcase (dumpPath);
- return testcase.createTestcase(*_pimpl);}
+ return testcase.createTestcase(*_pimpl);}
+#if 1
+ const solver::detail::ItemCapKindList Resolver::isSelectedBy (const PoolItem_Ref item)
+ { return _pimpl->isSelectedBy (item); }
+ const solver::detail::ItemCapKindList Resolver::selects (const PoolItem_Ref item)
+ { return _pimpl->selects (item); }
+#endif
+
/////////////////////////////////////////////////////////////////
} // namespace zypp
Modified: trunk/libzypp/zypp/Resolver.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Resolver.h?rev=5829…
==============================================================================
--- trunk/libzypp/zypp/Resolver.h (original)
+++ trunk/libzypp/zypp/Resolver.h Fri Jun 22 15:27:34 2007
@@ -270,9 +270,40 @@
/**
* Generates a solver Testcase of the current state
*
- * return true if it was successful
+ * \parame dumpPath destination directory of the created directory
+ * \return true if it was successful
*/
- bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase");
+ bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase");
+
+
+ /**
+ * Gives information about WHO has selected an item for installation.
+ *
+ * \param item Evaluate additional information for this resolvable.
+ * \return A list of structures which contains:
+ * item Item which has triggered the selection of the given param item.
+ * cap Capability which has triggerd this selection
+ * capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )
+ *
+ * Note: Start a solver run before in order to have a result. Not matter if it is valid or invalid.
+ *
+ */
+ const solver::detail::ItemCapKindList isSelectedBy (const PoolItem_Ref item);
+
+ /**
+ * Gives information about WHICH additional items have been selected by the given item.
+ *
+ * \param item Evaluate additional information for this resolvable.
+ * \return A list of structures which contains:
+ * item Item which has BEEN triggered by the selection of the given param item.
+ * cap Capability which has BEEN triggerd by this selection
+ * capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )
+ *
+ * Note: Start a solver run before in order to have a result. Not matter if it is valid or invalid.
+ *
+ */
+ const solver::detail::ItemCapKindList selects (const PoolItem_Ref item);
+
protected:
Modified: trunk/libzypp/zypp/ResolverProblem.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResolverProblem.h?r…
==============================================================================
--- trunk/libzypp/zypp/ResolverProblem.h (original)
+++ trunk/libzypp/zypp/ResolverProblem.h Fri Jun 22 15:27:34 2007
@@ -14,7 +14,6 @@
#include "zypp/base/ReferenceCounted.h"
#include "zypp/base/PtrTypes.h"
-#include "zypp/Resolver.h"
#include "zypp/ProblemSolution.h"
/////////////////////////////////////////////////////////////////////////
Modified: trunk/libzypp/zypp/solver/detail/Resolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resol…
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.cc Fri Jun 22 15:27:34 2007
@@ -33,6 +33,7 @@
#include "zypp/CapFilters.h"
#include "zypp/ZYppFactory.h"
#include "zypp/SystemResObject.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
/////////////////////////////////////////////////////////////////////////
@@ -161,12 +162,99 @@
_best_context = NULL;
_timed_out = false;
+ _isSelectedBy.clear();
+ _selects.clear();
+
if (resetValidResults)
contextPool.reset();
}
+//--------------------------------------------------------------------------------------------------
+// Get more information about the solverrun
+// Which item will be triggerd by another item or triggers an item for installation
+typedef struct {
+ ItemCapKindMap isSelectedBy;
+ ItemCapKindMap selects;
+} Collector;
+
+
+static void
+collector_cb_needed (ResolverInfo_Ptr info, void *data)
+{
+ Collector *collector = (Collector *)data;
+ if (info->type() == RESOLVER_INFO_TYPE_NEEDED_BY) {
+ ResolverInfoNeededBy_constPtr needed_by = dynamic_pointer_cast<const ResolverInfoNeededBy>(info);
+ if (needed_by->items().size() >= 1) {
+ PoolItem_Ref item = info->affected();
+ PoolItemList itemList = needed_by->items();
+
+ for (PoolItemList::const_iterator iter = itemList.begin();
+ iter != itemList.end(); iter++) {
+ ItemCapKind capKind( *iter, needed_by->capability(), needed_by->capKind() );
+ collector->isSelectedBy.insert (make_pair( item, capKind));
+
+ ItemCapKind capKindReverse( item, needed_by->capability(), needed_by->capKind() );
+ collector->selects.insert (make_pair( *iter, capKindReverse));
+ }
+
+ }
+ }
+}
+
+void
+Resolver::collectResolverInfo(void)
+{
+ ResolverContext_Ptr collectContext = context(); // best context or failed context
+ if ( collectContext != NULL
+ && _isSelectedBy.empty()
+ && _selects.empty()) {
+ Collector collector;
+ collectContext->foreachInfo (PoolItem(), RESOLVER_INFO_PRIORITY_VERBOSE, collector_cb_needed, &collector);
+ _isSelectedBy = collector.isSelectedBy;
+ _selects = collector.selects;
+ }
+}
+
+
+const ItemCapKindList Resolver::isSelectedBy (const PoolItem_Ref item) {
+ ItemCapKindList ret;
+ collectResolverInfo();
+
+ for (ItemCapKindMap::const_iterator iter = _isSelectedBy.find(item); iter != _isSelectedBy.end();) {
+ ItemCapKind info = iter->second;
+ PoolItem_Ref iterItem = iter->first;
+ if (iterItem == item) {
+ ret.push_back(info);
+ iter++;
+ } else {
+ // exit
+ iter = _isSelectedBy.end();
+ }
+ }
+ return ret;
+}
+
+const ItemCapKindList Resolver::selects (const PoolItem_Ref item) {
+ ItemCapKindList ret;
+ collectResolverInfo();
+
+ for (ItemCapKindMap::const_iterator iter = _selects.find(item); iter != _selects.end();) {
+ ItemCapKind info = iter->second;
+ PoolItem_Ref iterItem = iter->first;
+ if (iterItem == item) {
+ ret.push_back(info);
+ iter++;
+ } else {
+ // exit
+ iter = _selects.end();
+ }
+ }
+ return ret;
+}
+
+//----------------------------------------------------------------------------------------------------
ResolverContext_Ptr
Resolver::context (void) const
{
Modified: trunk/libzypp/zypp/solver/detail/Resolver.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resol…
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.h (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.h Fri Jun 22 15:27:34 2007
@@ -54,6 +54,27 @@
/////////////////////////////////////////////////////////////////////
namespace detail
{ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ItemCapKind
+ //
+ /** */
+ struct ItemCapKind
+ {
+ public:
+ Capability cap; //Capability which has triggerd this selection
+ Dep capKind; //Kind of that capability
+ PoolItem_Ref item; //Item which has triggered this selection
+
+ ItemCapKind( PoolItem i, Capability c, Dep k)
+ : cap( c )
+ , capKind( k )
+ , item( i )
+ { }
+ };
+ typedef std::multimap<PoolItem_Ref,ItemCapKind> ItemCapKindMap;
+ typedef std::list<ItemCapKind> ItemCapKindList;
///////////////////////////////////////////////////////////////////
//
@@ -90,7 +111,10 @@
// list of problematic items after doUpgrade()
PoolItemList _update_items;
-
+ // Additional information about the solverrun
+ ItemCapKindMap _isSelectedBy;
+ ItemCapKindMap _selects;
+
CapSet _extra_caps;
CapSet _extra_conflicts;
@@ -138,6 +162,9 @@
bool doesObsoleteCapability (PoolItem_Ref candidate, const Capability & cap);
bool doesObsoleteItem (PoolItem_Ref candidate, PoolItem_Ref installed);
+ void collectResolverInfo (void);
+
+
public:
Resolver (const ResPool & pool);
@@ -237,6 +264,12 @@
// reset all SOLVER transaction in pool
void undo(void);
+ // Get more information about the solverrun
+ // Which item will be triggerd by another item or triggers an item for
+ // installation
+ const ItemCapKindList isSelectedBy (const PoolItem_Ref item);
+ const ItemCapKindList selects (const PoolItem_Ref item);
+
// only for testsuite
void reset (const bool resetValidResults = false);
Modified: trunk/libzypp/zypp/solver/detail/ResolverInfoNeededBy.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resol…
==============================================================================
--- trunk/libzypp/zypp/solver/detail/ResolverInfoNeededBy.h (original)
+++ trunk/libzypp/zypp/solver/detail/ResolverInfoNeededBy.h Fri Jun 22 15:27:34 2007
@@ -65,7 +65,8 @@
virtual std::string message (void) const;
virtual ResolverInfo_Ptr copy (void) const;
void setCapability (const Capability & cap, const Dep & capKind) { _cap = cap; _capKind = capKind; }
-;
+ Dep capKind() const {return _capKind;}
+ Capability capability() const {return _cap;};
};
///////////////////////////////////////////////////////////////////
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5828 - in /branches/REFACTORING-10_3/libzypp/zypp: Repository.cc Repository.h repo/RepositoryImpl.cc repo/RepositoryImpl.h
by mlandres@svn.opensuse.org 22 Jun '07
by mlandres@svn.opensuse.org 22 Jun '07
22 Jun '07
Author: mlandres
Date: Fri Jun 22 13:47:48 2007
New Revision: 5828
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5828&view=rev
Log:
remove unneeded friends and fix constness
Modified:
branches/REFACTORING-10_3/libzypp/zypp/Repository.cc
branches/REFACTORING-10_3/libzypp/zypp/Repository.h
branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/Repository.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/Repository.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/Repository.cc Fri Jun 22 13:47:48 2007
@@ -41,38 +41,38 @@
Repository::NumericId Repository::numericId() const
{ return _pimpl->numericId(); }
- const ResStore & Repository::resolvables()
+ const ResStore & Repository::resolvables() const
{
return _pimpl->resolvables();
}
-
- const RepoInfo Repository::info() const
+
+ const RepoInfo & Repository::info() const
{
return _pimpl->info();
}
-
+
const std::list<packagedelta::PatchRpm> &
Repository::patchRpms() const
{
return _pimpl->patchRpms();
}
-
+
const std::list<packagedelta::DeltaRpm> &
Repository::deltaRpms() const
{
return _pimpl->deltaRpms();
}
-
+
std::ostream & operator<<( std::ostream & str, const Repository & obj )
{
return str << "[" << obj.info().alias() << "]" << endl;
}
-
+
bool operator==( const Repository & lhs, const Repository & rhs )
{
return (lhs.info().alias() == rhs.info().alias());
}
-
+
bool operator<( const Repository & lhs, const Repository & rhs )
{
return (lhs.info().alias() < rhs.info().alias());
Modified: branches/REFACTORING-10_3/libzypp/zypp/Repository.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/Repository.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/Repository.h Fri Jun 22 13:47:48 2007
@@ -14,7 +14,7 @@
namespace zypp
{
class ResStore;
-
+
namespace repo
{
DEFINE_PTR_TYPE(RepositoryImpl);
@@ -23,24 +23,19 @@
class Repository : private base::SafeBool<Repository>
{
- public:
- friend std::ostream & operator<<( std::ostream & str, const Repository & obj );
- friend bool operator==( const Repository & lhs, const Repository & rhs );
- friend bool operator<( const Repository & lhs, const Repository & rhs );
-
public:
typedef repo::RepositoryImpl Impl;
typedef repo::RepositoryImpl_Ptr Impl_Ptr;
public:
- /**
+ /**
* \short Default ctor: noRepository.
* \see RepoManager::createFromCache.
*/
Repository();
- /**
+ /**
* A dummy Repository (Id \c 0) providing nothing, doing nothing.
*/
static const Repository noRepository;
@@ -59,23 +54,23 @@
/**
* \short Get the resolvables for repo
*/
- const zypp::ResStore & resolvables();
+ const zypp::ResStore & resolvables() const;
/**
* \short Repository info used to create this repository
*/
- const RepoInfo info() const;
+ const RepoInfo & info() const;
/**
* \short Patch RPMs the repository provides
*/
const std::list<packagedelta::PatchRpm> & patchRpms() const;
-
+
/**
* \short Delta RPMs the repository provides
*/
const std::list<packagedelta::DeltaRpm> & deltaRpms() const;
-
+
private:
friend base::SafeBool<Repository>::operator bool_type() const;
/** \ref SafeBool test. */
@@ -97,10 +92,13 @@
RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
};
+ /** \relates Repository */
std::ostream & operator<<( std::ostream & str, const Repository & obj );
+ /** \relates Repository */
bool operator==( const Repository & lhs, const Repository & rhs );
+ /** \relates Repository */
bool operator<( const Repository & lhs, const Repository & rhs );
-
+
}
#endif
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.cc Fri Jun 22 13:47:48 2007
@@ -11,7 +11,7 @@
}
-const RepoInfo RepositoryImpl::info() const
+const RepoInfo & RepositoryImpl::info() const
{
return _info;
}
@@ -36,7 +36,7 @@
{
return _patchRpms;
}
-
+
const std::list<packagedelta::DeltaRpm> &
RepositoryImpl::deltaRpms() const
{
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.h Fri Jun 22 13:47:48 2007
@@ -29,34 +29,34 @@
{
friend std::ostream & operator<<( std::ostream & str, const RepositoryImpl & obj );
public:
-
+
/**
* \short Ctor.
* \param info What is known about this source at construction time.
*
*/
RepositoryImpl( const RepoInfo &info = RepoInfo() );
-
+
+ /**
+ * \short Dtor
+ */
+ ~RepositoryImpl();
+
/**
* \short Information about this repository
* You can't change this information after creation.
* Use \ref RepoManager for that.
*/
- const RepoInfo info() const;
-
- /**
- * \short Dtor
- */
- ~RepositoryImpl();
+ const RepoInfo & info() const;
const ResStore & resolvables() const;
- struct null {};
-
const std::list<packagedelta::PatchRpm> & patchRpms() const;
const std::list<packagedelta::DeltaRpm> & deltaRpms() const;
-
+
public:
+ struct null {};
+
/** Offer default Impl. */
static RepositoryImpl_Ptr nullimpl()
{
@@ -68,13 +68,13 @@
Repository selfRepository()
{ return Repository( this ); }
+
protected:
- RepoInfo _info;
-
ResStore _store;
-
std::list<packagedelta::PatchRpm> _patchRpms;
std::list<packagedelta::DeltaRpm> _deltaRpms;
+ private:
+ RepoInfo _info;
};
}
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
Author: jkupec
Date: Fri Jun 22 10:14:52 2007
New Revision: 5827
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5827&view=rev
Log:
enabled zypper info commands
Modified:
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=5827&r1…
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Fri Jun 22 10:14:52 2007
@@ -462,7 +462,7 @@
"This command has no additional options.\n"
);
}
- else if (command == ZypperCommand::NONE) {//command_str == "info" || command_str == "if") {
+ else if (command == ZypperCommand::INFO) {
static struct option info_options[] = {
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
@@ -476,7 +476,7 @@
"This command has no additional options.\n"
);
}
- else if (command == ZypperCommand::NONE) {//command_str == "patch-info") {
+ else if (command == ZypperCommand::RUG_PATCH_INFO) {
static struct option patch_info_options[] = {
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
@@ -933,7 +933,8 @@
// -----------------------------( info )------------------------------------
- else if (command == ZypperCommand::NONE) {//command_str == "info" || command_str == "if" || command_str == "patch-info") {
+ else if (command == ZypperCommand::INFO ||
+ command == ZypperCommand::RUG_PATCH_INFO) {
if (ghelp || arguments.size() == 0) {
cerr << specific_help;
return !ghelp;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
Author: jkupec
Date: Fri Jun 22 09:52:56 2007
New Revision: 5826
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5826&view=rev
Log:
made help texts consistent
Modified:
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=5826&r1…
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Fri Jun 22 09:52:56 2007
@@ -98,7 +98,7 @@
"\tpatch-check, pchk\tCheck for patches\n"
"\tpatches, pch\t\tList patches\n"
"\tlist-updates, lu\tList updates\n"
- "\tupdate, up\t\tUpdate packages\n"
+ "\tupdate, up\t\tUpdate installed resolvables with newer versions.\n"
"\tinfo, if\t\tShow full information for packages\n"
"\tpatch-info\t\tShow full information for patches\n"
"");
@@ -252,10 +252,14 @@
};
specific_options = install_options;
specific_help = _(
+ "install [options] <name> ...\n"
+ "\n"
+ "'install' - Install resolvabe(s) with specified name(s).\n"
+ "\n"
" Command options:\n"
- "\t--catalog,-c\t\tOnly from this catalog (under development)\n"
- "\t--type,-t\t\tType of resolvable (default: package)\n"
- "\t--no-confirm,-y\tDo not require user confirmation\n"
+ "\t--catalog,-c\t\t\tOnly from this catalog (under development)\n"
+ "\t--type,-t <resolvable_type>\tType of resolvable (default: package)\n"
+ "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
);
}
else if (command == ZypperCommand::REMOVE) {
@@ -267,9 +271,13 @@
};
specific_options = remove_options;
specific_help = _(
+ "remove [options] <name> ...\n"
+ "\n"
+ "'remove' - Remove resolvabe(s) with specified name(s).\n"
+ "\n"
" Command options:\n"
- "\t--type,-t\t\tType of resolvable (default: package)\n"
- "\t--no-confirm,-y\tDo not require user confirmation\n"
+ "\t--type,-t <resolvable_type>\tType of resolvable (default: package)\n"
+ "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
);
}
else if (command == ZypperCommand::ADD_REPO) {
@@ -283,7 +291,7 @@
};
specific_options = service_add_options;
specific_help = _(
- "service-add [options] URI [alias]\n"
+ "service-add [options] <URI> <alias>\n"
"\n"
"Add a service (installation source) to the system."
"\n"
@@ -306,7 +314,7 @@
"\n"
"List all defined system services (installation sources)."
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::REMOVE_REPO) {
@@ -316,11 +324,11 @@
};
specific_options = service_delete_options;
specific_help = _(
- "service-delete [options] <URI|alias>\n"
+ "service-delete [options] <alias>\n"
"\n"
"Remove service (installation source) from the system."
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::NONE) {//command_str == "service-rename" || command_str == "sr") {
@@ -330,11 +338,11 @@
};
specific_options = service_rename_options;
specific_help = _(
- "service-rename [options] <URI|alias> <new-alias>\n"
+ "service-rename [options] <alias> <new-alias>\n"
"\n"
"Assign new alias to the service specified by URI or current alias."
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::REFRESH) {
@@ -344,9 +352,11 @@
};
specific_options = refresh_options;
specific_help = _(
- "zypper refresh\n"
+ "refresh\n"
"\n"
"Refresh all installation sources found in the system.\n"
+ "\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::LIST_UPDATES) {
@@ -362,10 +372,10 @@
"List all available updates\n"
"\n"
" Command options:\n"
- "\t--type,-t\t\tType of resolvable (default: patch)\n"
+ "\t--type,-t <resolvable_type>\tType of resolvable (default: patch)\n"
);
}
- else if (command == ZypperCommand::NONE) { //command_str == "update" || command_str == "up") {
+ else if (command == ZypperCommand::UPDATE) {
static struct option update_options[] = {
{"type", required_argument, 0, 't'},
{"no-confirm", no_argument, 0, 'y'},
@@ -375,9 +385,12 @@
};
specific_options = update_options;
specific_help = _(
+ "'update' - Update all installed resolvables with newer versions, where applicable.\n"
+ "\n"
" Command options:\n"
- "\t--type,-t\t\tType of resolvable (default: patch)\n"
- "\t--no-confirm,-y\t\tDo not require user confirmation\n"
+ "\n"
+ "\t--type,-t <resolvable_type>\tType of resolvable (default: patch)\n"
+ "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
"\t--skip-interactive\t\tSkip interactive updates\n"
);
}
@@ -400,7 +413,7 @@
};
specific_options = search_options;
specific_help = _(
- "zypper [global-options] search [options] [querystring...]\n"
+ "search [options] [querystring...]\n"
"\n"
"'search' - Search for packages matching given search strings\n"
"\n"
@@ -432,7 +445,7 @@
"\n"
"Check for available patches\n"
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::SHOW_PATCHES) {
@@ -446,7 +459,7 @@
"\n"
"List all available patches\n"
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::NONE) {//command_str == "info" || command_str == "if") {
@@ -456,9 +469,11 @@
};
specific_options = info_options;
specific_help = _(
- "zypper [global-options] info [name...]\n"
+ "info <name> ...\n"
"\n"
"'info' -- Show full information for packages\n"
+ "\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::NONE) {//command_str == "patch-info") {
@@ -468,9 +483,11 @@
};
specific_options = patch_info_options;
specific_help = _(
- "zypper [global-options] patch-info [patchname...]\n"
+ "patch-info <patchname> ...\n"
"\n"
"'patch-info' -- Show detailed information for patches\n"
+ "\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::MOO) {
@@ -480,9 +497,11 @@
};
specific_options = moo_options;
specific_help = _(
- "zypper [global-options] moo\n"
+ "moo\n"
"\n"
"'moo' - Show an animal\n"
+ "\n"
+ "This command has no additional options.\n"
);
}
@@ -562,6 +581,8 @@
if (command == ZypperCommand::MOO)
{
+ if (ghelp) { cout << specific_help << endl; return !ghelp; }
+
cout << " \\\\\\\\\\\n \\\\\\\\\\\\\\__o\n__\\\\\\\\\\\\\\'/_" << endl;
return ZYPPER_EXIT_OK;
}
@@ -701,7 +722,7 @@
{
if (command == ZypperCommand::INSTALL) {
if (ghelp || arguments.size() < 1) {
- cerr << "install [options] name...\n" << specific_help;
+ cerr << specific_help;
return !ghelp;
}
@@ -710,9 +731,7 @@
if (command == ZypperCommand::REMOVE) {
if (ghelp || arguments.size() < 1) {
- cerr << "remove [options] name...\n"
- << specific_help
- ;
+ cerr << specific_help;
return !ghelp;
}
@@ -887,13 +906,8 @@
// -----------------------------( update )----------------------------------
- else if (command == ZypperCommand::NONE) {//command_str == "update" || command_str == "up") {
- if (ghelp) {
- cerr << "update [options]\n"
- << specific_help
- ;
- return !ghelp;
- }
+ else if (command == ZypperCommand::UPDATE) {
+ if (ghelp) { cerr << specific_help; return !ghelp; }
string skind = copts.count("type")? copts["type"].front() :
gSettings.is_rug_compatible? "package" : "patch";
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
Author: jkupec
Date: Fri Jun 22 09:29:21 2007
New Revision: 5825
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5825&view=rev
Log:
- fixed consistency of <required> and [optional] arguments
- improved update command description
- changed sa, sr descriptions + some other minor changes
Modified:
trunk/zypper/doc/zypper.8
Modified: trunk/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=5825&r1=…
==============================================================================
--- trunk/zypper/doc/zypper.8 (original)
+++ trunk/zypper/doc/zypper.8 Fri Jun 22 09:29:21 2007
@@ -47,47 +47,47 @@
.TP
-.B info (if) [name] ...
+.B info (if) <name> ...
Displays full info for the specified packages.
.TP
-.B install (in) [name] ...
+.B install (in) <name> ...
Install resolvables.
.TP
-\fI\-c, \-\-catalog\fR
+\fI\-c, \-\-catalog\fR <catalog>
Only from this catalog (FIXME not implemented yet)
.TP
-\fI\-t, \-\-type\fR [resolvable]
+\fI\-t, \-\-type\fR <resolvable_type>
Type of resolvable (default: package)
.TP
.I \-y, \-\-no-confirm
Don't require user confirmation.
.TP
-.B list-updates (lu)
+.B list-updates (lu) [options]
List available updates.
.TP
-\fI\-t, --type\fR
+\fI\-t, --type\fR <resolvable_type>
Type of resolvable (default: patch)
See also the NOTE at
.BR update .
.TP
-.B remove (rm) [name]..
+.B remove (rm) <name> ...
Remove resolvables.
.TP
-\fI\-t, -\-type\fR [resolvable]
+\fI\-t, -\-type\fR <resolvable_type>
Type of resolvable (default: package)
.TP
.I \-y, \-\-no-confirm
Don't require user confirmation.
.TP
-.B update (up)
-Update resolvables.
+.B update (up) [options]
+Update all installed resolvables with newer versions, where applicable.
.TP
-\fI\-t, -\-type\fR [resolvable]
+\fI\-t, -\-type\fR <resolvable_type>
Type of resolvable (default: patch)
.TP
.I \-y, \-\-no-confirm
@@ -167,7 +167,7 @@
installed and not applicable ones.
.TP
-.B patch-info [name] ...
+.B patch-info <name> ...
Displays full info for the specified patches.
.LP
@@ -186,7 +186,7 @@
installation source is a repository is a service is a catalog.
.TP
-.B service-add (sa) <URI> [alias]
+.B service-add (sa) <URI> <alias>
Add a new service (installation source).
.TP
\fI\-r, -\-repo\fR <FILE.repo>
@@ -202,7 +202,7 @@
Do not automatically refresh the metadata.
.TP
-.B service-delete (sd) <URI|alias|number>
+.B service-delete (sd) <alias>
Delete a service (installation source).
.TP
@@ -214,7 +214,7 @@
rug compatibility mode: if \fI-r\fR global option is set, zypper doesn't include 'Enabled' and 'Refresh' columns and prints rug's 'Status' column with values "Active" or "Disabled" instead.
.TP
-.B service-rename (sr) <URI|alias|number> <new-alias>
+.B service-rename (sr) <alias> <new-alias>
Rename a service (installation source).
.TP
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5824 - in /branches/REFACTORING-10_3/libzypp/zypp: ./ cache/ repo/cached/
by mlandres@svn.opensuse.org 21 Jun '07
by mlandres@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: mlandres
Date: Thu Jun 21 17:26:12 2007
New Revision: 5824
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5824&view=rev
Log:
Backup (Introduce CacheAttributes and start fixing the cached resolvable implementations.)
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc
branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h
branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Thu Jun 21 17:26:12 2007
@@ -874,6 +874,7 @@
${CMAKE_BINARY_DIR}/zypp/sqlite-schema.h
cache/CacheInitializer.cc
cache/CacheException.cc
+ cache/Attribute.cc
cache/CacheTypes.cc
cache/ResolvableQuery.cc
cache/CacheStore.cc
@@ -882,6 +883,8 @@
)
SET( zypp_cache_HEADERS
+ cache/Attribute.h
+ cache/CacheAttributes.h
cache/CacheTypes.h
cache/CacheInitializer.h
cache/CacheException.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc Thu Jun 21 17:26:12 2007
@@ -10,6 +10,7 @@
#include "zypp/cache/CacheInitializer.h"
#include "zypp/cache/CacheStore.h"
#include "zypp/cache/CacheException.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp;
@@ -201,36 +202,36 @@
void CacheStore::appendResObjectAttributes( const data::RecordId &rid,
const data::ResObject_Ptr & res )
{
- appendTranslatedStringAttribute( rid, "ResObject", "description", res->description );
- appendTranslatedStringAttribute( rid, "ResObject", "summary", res->summary );
- appendNumericAttribute( rid, "ResObject", "installedSize", res->installedSize );
- appendNumericAttribute( rid, "ResObject", "buildTime", res->buildTime );
- appendBooleanAttribute( rid, "ResObject", "installOnly", res->installOnly );
- appendStringAttribute( rid, "ResObject", "vendor", res->vendor );
- appendTranslatedStringAttribute( rid, "ResObject", "licenseToConfirm", res->licenseToConfirm );
- appendTranslatedStringAttribute( rid, "ResObject", "insnotify", res->insnotify );
- appendTranslatedStringAttribute( rid, "ResObject", "delnotify", res->delnotify );
+ appendTranslatedStringAttribute( rid, attrResObjectDescription(), res->description );
+ appendTranslatedStringAttribute( rid, attrResObjectSummary(), res->summary );
+ appendNumericAttribute( rid, attrResObjectInstalledSize(), res->installedSize );
+ appendNumericAttribute( rid, attrResObjectBuildTime(), res->buildTime );
+ appendBooleanAttribute( rid, attrResObjectInstallOnly(), res->installOnly );
+ appendStringAttribute( rid, attrResObjectVendor(), res->vendor );
+ appendTranslatedStringAttribute( rid, attrResObjectLicenseToConfirm(), res->licenseToConfirm );
+ appendTranslatedStringAttribute( rid, attrResObjectInsnotify(), res->insnotify );
+ appendTranslatedStringAttribute( rid, attrResObjectDelnotify(), res->delnotify );
}
void CacheStore::appendPackageBaseAttributes( const RecordId & pkgid,
const data::Packagebase_Ptr & package )
{
- appendStringAttribute( pkgid, "Package", "checksum", package->repositoryLocation.fileChecksum.checksum() );
- appendStringAttribute( pkgid, "Package", "checksumType", package->repositoryLocation.fileChecksum.type() );
- appendStringAttribute( pkgid, "Package", "buildhost", package->buildhost );
- appendStringAttribute( pkgid, "Package", "distribution", package->distribution );
- appendStringAttribute( pkgid, "Package", "license", package->license );
- appendStringAttribute( pkgid, "Package", "group", package->packager );
- appendStringAttribute( pkgid, "Package", "url", package->url );
- appendStringAttribute( pkgid, "Package", "operatingSystem", package->operatingSystem );
- appendStringAttribute( pkgid, "Package", "prein", package->prein );
- appendStringAttribute( pkgid, "Package", "postin", package->postin );
- appendStringAttribute( pkgid, "Package", "preun", package->preun );
- appendStringAttribute( pkgid, "Package", "postun", package->postun );
- appendStringContainerAttribute( pkgid, "Package", "keywords", package->keywords.begin(), package->keywords.end() );
- appendStringContainerAttribute( pkgid, "Package", "authors", package->authors.begin(), package->authors.end() );
- appendStringAttribute( pkgid, "Package", "location", package->repositoryLocation.filePath.asString() );
+ appendStringAttribute( pkgid, attrPackageChecksum(), package->repositoryLocation.fileChecksum.checksum() );
+ appendStringAttribute( pkgid, attrPackageChecksumType(), package->repositoryLocation.fileChecksum.type() );
+ appendStringAttribute( pkgid, attrPackageBuildhost(), package->buildhost );
+ appendStringAttribute( pkgid, attrPackageDistribution(), package->distribution );
+ appendStringAttribute( pkgid, attrPackageLicense(), package->license );
+ appendStringAttribute( pkgid, attrPackageGroup(), package->packager );
+ appendStringAttribute( pkgid, attrPackageUrl(), package->url );
+ appendStringAttribute( pkgid, attrPackageOperatingSystem(), package->operatingSystem );
+ appendStringAttribute( pkgid, attrPackagePrein(), package->prein );
+ appendStringAttribute( pkgid, attrPackagePostin(), package->postin );
+ appendStringAttribute( pkgid, attrPackagePreun(), package->preun );
+ appendStringAttribute( pkgid, attrPackagePostun(), package->postun );
+ appendStringContainerAttribute( pkgid, attrPackageKeywords(), package->keywords.begin(), package->keywords.end() );
+ appendStringContainerAttribute( pkgid, attrPackageAuthors(), package->authors.begin(), package->authors.end() );
+ appendStringAttribute( pkgid, attrPackageLocation(), package->repositoryLocation.filePath.asString() );
}
RecordId CacheStore::consumePackage( const RecordId & repository_id,
@@ -264,10 +265,10 @@
appendResObjectAttributes( id, patch );
// patch attributes
- appendNumericAttribute( id, "Patch", "timestamp", patch->timestamp );
- appendStringAttribute( id, "Patch", "category", patch->category );
- appendBooleanAttribute( id, "Patch", "rebootNeeded", patch->rebootNeeded );
- appendBooleanAttribute( id, "Patch", "affectsPkgManager", patch->affectsPkgManager );
+ appendNumericAttribute( id, attrPatchTimestamp(), patch->timestamp );
+ appendStringAttribute( id, attrPatchCategory(), patch->category );
+ appendBooleanAttribute( id, attrPatchRebootNeeded(), patch->rebootNeeded );
+ appendBooleanAttribute( id, attrPatchAffectsPkgManager(), patch->affectsPkgManager );
DBG << "got patch " << patch->name << ", atoms: ";
@@ -333,7 +334,7 @@
NVRA( message->name, message->edition, message->arch ), message->deps );
appendResObjectAttributes( id, message );
- appendTranslatedStringAttribute( id, "Message", "text", message->text );
+ appendTranslatedStringAttribute( id, attrMessageText(), message->text );
return id;
}
@@ -344,14 +345,14 @@
NVRA( script->name, script->edition, script->arch ), script->deps );
appendResObjectAttributes( id, script );
- appendStringAttribute( id, "Script", "doScript", script->doScript );
- appendStringAttribute( id, "Script", "doScriptLocation", script->doScriptLocation.filePath.asString() );
- appendStringAttribute( id, "Script", "doScriptChecksum", script->doScriptLocation.fileChecksum.checksum() );
- appendStringAttribute( id, "Script", "doScriptChecksumType", script->doScriptLocation.fileChecksum.type() );
- appendStringAttribute( id, "Script", "undoScript", script->undoScript );
- appendStringAttribute( id, "Script", "undoScriptLocation", script->undoScriptLocation.filePath.asString() );
- appendStringAttribute( id, "Script", "undoScriptChecksum", script->undoScriptLocation.fileChecksum.checksum() );
- appendStringAttribute( id, "Script", "undoScriptChecksumType", script->undoScriptLocation.fileChecksum.type() );
+ appendStringAttribute( id, attrScriptDoScript(), script->doScript );
+ appendStringAttribute( id, attrScriptDoScriptLocation(), script->doScriptLocation.filePath.asString() );
+ appendStringAttribute( id, attrScriptDoScriptChecksum(), script->doScriptLocation.fileChecksum.checksum() );
+ appendStringAttribute( id, attrScriptDoScriptChecksumType(), script->doScriptLocation.fileChecksum.type() );
+ appendStringAttribute( id, attrScriptUndoScript(), script->undoScript );
+ appendStringAttribute( id, attrScriptUndoScriptLocation(), script->undoScriptLocation.filePath.asString() );
+ appendStringAttribute( id, attrScriptUndoScriptChecksum(), script->undoScriptLocation.fileChecksum.checksum() );
+ appendStringAttribute( id, attrScriptUndoScriptChecksumType(), script->undoScriptLocation.fileChecksum.type() );
return id;
}
@@ -362,11 +363,11 @@
NVRA( pattern->name, pattern->edition, pattern->arch ), pattern->deps );
appendResObjectAttributes( id, pattern );
- appendBooleanAttribute( id, "Pattern", "isDefault", pattern->isDefault );
- appendBooleanAttribute( id, "Pattern", "userVisible", pattern->userVisible );
- appendTranslatedStringAttribute( id, "Pattern", "category", pattern->category );
- appendStringAttribute( id, "Pattern", "icon", pattern->icon );
- appendStringAttribute( id, "Pattern", "order", pattern->order );
+ appendBooleanAttribute( id, attrPatternIsDefault(), pattern->isDefault );
+ appendBooleanAttribute( id, attrPatternUserVisible(), pattern->userVisible );
+ appendTranslatedStringAttribute( id, attrPatternCategory(), pattern->category );
+ appendStringAttribute( id, attrPatternIcon(), pattern->icon );
+ appendStringAttribute( id, attrPatternOrder(), pattern->order );
return id;
}
@@ -377,15 +378,15 @@
NVRA( product->name, product->edition, product->arch ), product->deps );
appendResObjectAttributes( id, product );
- appendTranslatedStringAttribute( id, "Product", "shortName", product->shortName );
- appendTranslatedStringAttribute( id, "Product", "longName", product->longName );
- appendStringContainerAttribute( id, "Product", "flags", product->flags.begin(), product->flags.end() );
- appendStringAttribute( id, "Product", "releasenotesUrl", product->releasenotesUrl.asString() );
- appendStringContainerAttribute( id, "Product", "updateUrls", product->updateUrls );
- appendStringContainerAttribute( id, "Product", "extraUrls", product->extraUrls );
- appendStringContainerAttribute( id, "Product", "optionalUrls", product->optionalUrls );
- appendStringAttribute( id, "Product", "distributionName", product->distributionName );
- appendStringAttribute( id, "Product", "distributionEdition", product->distributionEdition.asString() );
+ appendTranslatedStringAttribute( id, attrProductShortName(), product->shortName );
+ appendTranslatedStringAttribute( id, attrProductLongName(), product->longName );
+ appendStringContainerAttribute( id, attrProductFlags(), product->flags.begin(), product->flags.end() );
+ appendStringAttribute( id, attrProductReleasenotesUrl(), product->releasenotesUrl.asString() );
+ appendStringContainerAttribute( id, attrProductUpdateUrls(), product->updateUrls );
+ appendStringContainerAttribute( id, attrProductExtraUrls(), product->extraUrls );
+ appendStringContainerAttribute( id, attrProductOptionalUrls(), product->optionalUrls );
+ appendStringAttribute( id, attrProductDistributionName(), product->distributionName );
+ appendStringAttribute( id, attrProductDistributionEdition(), product->distributionEdition.asString() );
return id;
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h Thu Jun 21 17:26:12 2007
@@ -28,6 +28,7 @@
#include "zypp/base/PtrTypes.h"
#include "zypp/RepoStatus.h"
#include "zypp/ProgressData.h"
+#include "zypp/cache/Attribute.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -385,6 +386,9 @@
*/
data::RecordId lookupOrAppendType( const std::string &klass,
const std::string &name );
+ /** \overload */
+ data::RecordId lookupOrAppendType( const Attribute &attr )
+ { return lookupOrAppendType( attr.klass, attr.name ); }
/**
* Returns the record id of a repository (Source)
@@ -426,6 +430,11 @@
const std::string &klass,
const std::string &name,
int value );
+ /** \overload */
+ void appendNumericAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ int value )
+ { appendNumericAttribute( resolvable_id, attr.klass, attr.name, value ); }
/**
* Append a translated string value to a resolvable
@@ -438,6 +447,11 @@
const std::string &klass,
const std::string &name,
const TranslatedText &text );
+ /** \overload */
+ void appendTranslatedStringAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const TranslatedText &text )
+ { appendTranslatedStringAttribute( resolvable_id, attr.klass, attr.name, text ); }
/**
* Append a string value to a resolvable
@@ -452,6 +466,12 @@
const std::string &klass,
const std::string &name,
const std::string &text );
+ /** \overload */
+ void appendStringAttributeTranslation( const data::RecordId &resolvable_id,
+ const Locale &locale,
+ const Attribute& attr,
+ const std::string &text )
+ { appendStringAttributeTranslation( resolvable_id, locale, attr.klass, attr.name, text ); }
/**
* Append a string value to a resolvable
@@ -464,6 +484,11 @@
const std::string &klass,
const std::string &name,
const std::string &value );
+ /** \overload */
+ void appendStringAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const std::string &value )
+ { appendStringAttribute( resolvable_id, attr.klass, attr.name, value ); }
/**
* Append a string value to a resolvable
@@ -475,7 +500,6 @@
const data::RecordId &type_id,
const std::string &value );
-
/**
* Append strings from _Iterator to a resolvable.
*
@@ -501,6 +525,13 @@
std::string value = str::join(begin, end, ZConfig().cacheDBSplitJoinSeparator());
appendStringAttribute( resolvable_id, klass, name, value );
}
+ /** \overload */
+ template <class _Iterator>
+ void appendStringContainerAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ _Iterator begin,
+ _Iterator end )
+ { appendStringContainerAttribute( resolvable_id, attr.klass, attr.name, begin, end ); }
/**
* Append strings from a _Container to a resolvable.
@@ -516,6 +547,12 @@
const std::string &name,
const _Container & container )
{ appendStringContainerAttribute( resolvable_id, klass, name, container.begin(), container.end() ); }
+ /** \overload */
+ template <class _Container>
+ void appendStringContainerAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const _Container & container )
+ { appendStringContainerAttribute( resolvable_id, attr.klass, attr.name, container ); }
/**
* Update a known repository checksum and timestamp
@@ -676,6 +713,12 @@
const std::string & klass,
const std::string & name,
bool value);
+ /** \overload */
+ void appendBooleanAttribute( const data::RecordId & resolvable_id,
+ const Attribute& attr,
+ bool value)
+ { appendBooleanAttribute( resolvable_id, attr.klass, attr.name, value ); }
+
/** \name Detail Attributes Inserters
* These functions are used by ResolvableConsumer interface functions
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h Thu Jun 21 17:26:12 2007
@@ -8,6 +8,7 @@
#include "zypp/Pathname.h"
#include "zypp/data/ResolvableData.h"
#include "zypp/data/RecordId.h"
+#include "zypp/cache/Attribute.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -15,7 +16,7 @@
///////////////////////////////////////////////////////////////////
namespace cache
{ /////////////////////////////////////////////////////////////////
-
+
/**
* The resolvable query class allows you to query for resolvable
* data and properties from the cache.
@@ -28,16 +29,16 @@
* first parameter is the resolvable id.
* second parameter is a \ref data::ResObjectData object with the resource
*/
- typedef function<bool( const data::RecordId &,
+ typedef function<bool( const data::RecordId &,
data::ResObject_Ptr )> ProcessResolvable;
-
+
/**
* Constructor
*
* \param dbdir Cache location path
*/
ResolvableQuery( const Pathname &dbdir );
-
+
/**
* Query by record id
* \param record_id Resolvable id to query
@@ -45,7 +46,7 @@
*/
void query( const data::RecordId &record_id,
ProcessResolvable fnc );
-
+
/**
* Query by matching text
* \param text text to match
@@ -53,7 +54,7 @@
*/
void query( const std::string &text,
ProcessResolvable fnc );
-
+
/**
* Queries a specifc attribute for a resolvable
*
@@ -68,6 +69,11 @@
const std::string &klass,
const std::string &name,
int default_value = -1 );
+ /** \overload */
+ int queryNumericAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ int default_value = -1 )
+ { return queryNumericAttribute( record_id, attr.klass, attr.name, default_value ); }
/**
@@ -84,6 +90,11 @@
const std::string &klass,
const std::string &name,
bool default_value = false );
+ /** \overload */
+ bool queryBooleanAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ bool default_value = false )
+ { return queryBooleanAttribute( record_id, attr.klass, attr.name, default_value ); }
/**
@@ -100,7 +111,12 @@
const std::string &klass,
const std::string &name,
const std::string &default_value = std::string() );
-
+ /** \overload */
+ std::string queryStringAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ const std::string &default_value = std::string() )
+ { return queryStringAttribute( record_id, attr.klass, attr.name, default_value ); }
+
/**
* Queries a specifc attribute translation
* for a resolvable.
@@ -118,7 +134,13 @@
const std::string &klass,
const std::string &name,
const std::string &default_value = std::string() );
-
+ /** \overload */
+ std::string queryStringAttributeTranslation( const data::RecordId &record_id,
+ const Locale &locale,
+ const Attribute& attr,
+ const std::string &default_value = std::string() )
+ { return queryStringAttributeTranslation( record_id, locale, attr.klass, attr.name, default_value ); }
+
/**
* Queries all translations for a specific attribute
* in a resolvable.
@@ -127,14 +149,19 @@
* \param klass Attribute Class
* \param name Attribute Name
*
- * \return all attribute translations or a empty
+ * \return all attribute translations or a empty
* \ref TranslatedString if no record is found.
*/
TranslatedText queryTranslatedStringAttribute( const data::RecordId &record_id,
const std::string &klass,
const std::string &name,
- const TranslatedText &default_vaue = TranslatedText() );
-
+ const TranslatedText &default_value = TranslatedText() );
+ /** \overload */
+ TranslatedText queryTranslatedStringAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ const TranslatedText &default_value = TranslatedText() )
+ { return queryTranslatedStringAttribute( record_id, attr.klass, attr.name, default_value ); }
+
/**
* Queries for a specific container attribute
* in a resolvable.
@@ -152,14 +179,20 @@
const std::string &name,
_OutputIterator result )
{
-
+
std::string all = queryStringAttribute( record_id, klass, name);
//FIXME use zypp separator
str::split( all, result );
}
-
-
-
+ /** \overload */
+ template<class _OutputIterator>
+ void queryStringContainerAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ _OutputIterator result )
+ { queryStringContainerAttribute( record_id, attr.klass, attr.name, result ); }
+
+
+
private:
/** Implementation. */
class Impl;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,11 +12,11 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "AtomImpl.h"
-
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
-using namespace::zypp::repo;
+//using namespace::zypp::repo;
///////////////////////////////////////////////////////////////////
namespace zypp { namespace repo { namespace cached {
@@ -46,53 +46,52 @@
TranslatedText AtomImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText AtomImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText AtomImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText AtomImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText AtomImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor AtomImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
-
ByteCount AtomImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount AtomImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool AtomImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date AtomImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date AtomImpl::installtime() const
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "MessageImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText MessageImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText MessageImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText MessageImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText MessageImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText MessageImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor MessageImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount MessageImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount MessageImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool MessageImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date MessageImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date MessageImpl::installtime() const
@@ -111,14 +112,14 @@
TranslatedText MessageImpl::text() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Message", "text" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrMessageText() );
}
Patch::constPtr MessageImpl::patch() const
{
return 0;
}
-
+
/////////////////////////////////////////////////////////////////
} } } // namespace zypp::repo::cached
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,7 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PackageImpl.h"
-
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
@@ -49,53 +49,55 @@
TranslatedText PackageImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PackageImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PackageImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PackageImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PackageImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PackageImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PackageImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+#warning CHECK IF ATRIB IS MISSING IN DB
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PackageImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+#warning CHECK IF ATRIB IS MISSING IN DB
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PackageImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PackageImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PackageImpl::installtime() const
@@ -115,33 +117,35 @@
std::string PackageImpl::buildhost() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "buildhost" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageBuildhost() );
}
std::string PackageImpl::distribution() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "distribution" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageDistribution() );
}
Label PackageImpl::license() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "license" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLicense() );
}
std::string PackageImpl::packager() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "packager" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePackager() );
}
PackageGroup PackageImpl::group() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "group" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageGroup() );
}
PackageImpl::Keywords PackageImpl::keywords() const
{
PackageImpl::Keywords keywords;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Package", "keywords", std::inserter(keywords, keywords.begin()) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrPackageKeywords(), std::inserter(keywords, keywords.begin()) );
return keywords;
}
@@ -152,37 +156,37 @@
Pathname PackageImpl::location() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "location" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLocation() );
}
std::string PackageImpl::url() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "url" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageUrl() );
}
std::string PackageImpl::os() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "operatingSystem" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageOperatingSystem() );
}
Text PackageImpl::prein() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "prein" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePrein() );
}
Text PackageImpl::postin() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "postin" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePostin() );
}
Text PackageImpl::preun() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "preun" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePreun() );
}
Text PackageImpl::postun() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "postun" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePostun() );
}
ByteCount PackageImpl::sourcesize() const
@@ -198,7 +202,7 @@
list<string> PackageImpl::authors() const
{
list<string> authors;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Package", "authors", back_inserter(authors) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrPackageAuthors(), back_inserter(authors) );
return authors;
}
@@ -211,7 +215,7 @@
// {
// return std::list<DeltaRpm>();
// }
-//
+//
// std::list<PatchRpm> PackageImpl::patchRpms() const
// {
// return std::list<PatchRpm>();
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PatchImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -49,53 +50,53 @@
TranslatedText PatchImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PatchImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PatchImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PatchImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PatchImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PatchImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PatchImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PatchImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PatchImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PatchImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PatchImpl::installtime() const
@@ -114,36 +115,41 @@
std::string PatchImpl::id() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Patch", "id" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatchId() );
}
Date PatchImpl::timestamp() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "Patch", "timestamp" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrPatchTimestamp() );
}
std::string PatchImpl::category() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Patch", "category" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatchCategory() );
}
bool PatchImpl::reboot_needed() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "rebootNeeded" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchRebootNeeded() );
}
bool PatchImpl::affects_pkg_manager() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "affectsPkgManager" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchAffectsPkgManager() );
}
bool PatchImpl::interactive() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "interactive" );
+#warning DUBIOUS ATTRIBUTE
+ return false;
+ //return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchInteractive() );
}
PatchImpl::AtomList PatchImpl::all_atoms() const
{
+#warning DUBIOUS ATTRIBUTE
return PatchImpl::AtomList();
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PatternImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -49,53 +50,53 @@
TranslatedText PatternImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PatternImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PatternImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PatternImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PatternImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PatternImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PatternImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PatternImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PatternImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PatternImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PatternImpl::installtime() const
@@ -114,43 +115,45 @@
bool PatternImpl::isDefault() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Pattern", "isDefault" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatternIsDefault() );
}
bool PatternImpl::userVisible() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Pattern", "userVisible" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatternUserVisible() );
}
TranslatedText PatternImpl::category() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Pattern", "isDefault" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrPatternCategory() );
}
Pathname PatternImpl::icon() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "icon" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternIcon() );
}
Pathname PatternImpl::script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "script" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternScript() );
}
Label PatternImpl::order() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "order" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternOrder() );
}
//std::set<std::string> install_packages( const Locale & lang = Locale("") ) const;
// const CapSet & PatternImpl::includes() const
// {
-//
+//
// }
-//
+//
// const CapSet & PatternImpl::extends() const
// {
-//
+//
// }
/////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "ProductImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText ProductImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText ProductImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText ProductImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText ProductImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText ProductImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor ProductImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount ProductImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount ProductImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool ProductImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date ProductImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date ProductImpl::installtime() const
@@ -111,55 +112,59 @@
std::string ProductImpl::category() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "category" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductCategory() );
}
Url ProductImpl::releaseNotesUrl() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "releaseNotesUrl" );
+#warning DUBIOUS ATTRIBUTE
+ return Url();
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductReleaseNotesUrl() );
}
std::list<Url> ProductImpl::updateUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "updateUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductUpdateUrls(), back_inserter(urls) );
return urls;
}
std::list<Url> ProductImpl::extraUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "extraUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductExtraUrls(), back_inserter(urls) );
return urls;
}
std::list<Url> ProductImpl::optionalUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "optionalUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductOptionalUrls(), back_inserter(urls) );
return urls;
}
list<string> ProductImpl::flags() const
{
list<string> flags;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "flags", back_inserter(flags) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductFlags(), back_inserter(flags) );
return flags;
}
TranslatedText ProductImpl::shortName() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Product", "shortName" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrProductShortName() );
}
std::string ProductImpl::distributionName() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "distributionName" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionName() );
}
Edition ProductImpl::distributionEdition() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "distributionEdition" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionEdition() );
}
/////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc Thu Jun 21 17:26:12 2007
@@ -31,6 +31,7 @@
#include "zypp/repo/cached/MessageImpl.h"
#include "zypp/repo/cached/ScriptImpl.h"
#include "zypp/repo/cached/AtomImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace zypp::detail;
using namespace zypp::cache;
@@ -76,7 +77,7 @@
debug::Measure m("create resolvables");
CapFactory capfactory;
try
- {
+ {
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
@@ -84,7 +85,7 @@
sqlite3_command cmd( con, "select id,name,version,release,epoch,arch,kind from resolvables where repository_id=:repository_id;");
cmd.bind(":repository_id", _repository_id);
map<data::RecordId, pair<Resolvable::Kind, NVRAD> > nvras;
-
+
sqlite3_reader reader = cmd.executereader();
while(reader.read())
{
@@ -97,11 +98,11 @@
_type_cache.archFor(reader.getint(5)),
deps ) );
}
-
+
MIL << "Done reading resolvables nvra" << endl;
-
+
read_capabilities( con, nvras);
-
+
for ( map<data::RecordId, pair<Resolvable::Kind, NVRAD> >::const_iterator it = nvras.begin(); it != nvras.end(); ++it )
{
if ( it->second.first == ResTraits<Package>::kind )
@@ -147,7 +148,7 @@
cerr << "Exception Occured: " << ex.what() << endl;
}
//extract_packages_from_directory( _store, thePath, selfRepositoryRef(), true );
-
+
}
static CheckSum encoded_string_to_checksum( const std::string &encoded )
@@ -166,7 +167,7 @@
void RepoImpl::createPatchAndDeltas()
{
try
- {
+ {
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
@@ -179,14 +180,14 @@
string pp_bv_query =
"SELECT version, release, epoch "
"FROM patch_packages_baseversions WHERE patch_package_id = :patch_package_id";
-
+
string delta_query =
// 0 1 2 3 4 5 6 7 8 9 10
"SELECT id, media_nr, location, checksum, download_size, build_time, baseversion_version, baseversion_release, baseversion_epoch, baseversion_checksum, baseversion_build_time "
// 11
", baseversion_sequence_info "
"FROM delta_packages WHERE repository_id=:repository_id;";
-
+
// bind the master repo id to the query
sqlite3_command deltas_cmd( con, delta_query);
deltas_cmd.bind(":repository_id", _repository_id);
@@ -196,7 +197,7 @@
zypp::OnMediaLocation on_media;
on_media.medianr(reader.getint(1));
on_media.filename(reader.getstring(2));
-
+
string checksum_string(reader.getstring(3));
CheckSum checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -206,10 +207,10 @@
}
on_media.checksum(checksum);
on_media.downloadsize(reader.getint(4));
-
+
packagedelta::DeltaRpm::BaseVersion baseversion;
baseversion.edition( Edition(reader.getstring(6), reader.getstring(7), reader.getstring(8) ) );
-
+
checksum_string = reader.getstring(9);
checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -220,15 +221,15 @@
baseversion.checksum(checksum);
baseversion.buildtime(reader.getint(10));
baseversion.sequenceinfo(reader.getstring(11));
-
+
zypp::packagedelta::DeltaRpm delta;
delta.location( on_media );
delta.baseversion( baseversion );
delta.buildtime(reader.getint(5));
-
+
//impl->addDeltaRpm(delta);
}
-
+
// patch rpms
// bind the master package id to the query
// bind the master repo id to the query
@@ -240,11 +241,11 @@
while ( reader.read() )
{
long long patch_package_id = reader.getint64(0);
-
+
zypp::OnMediaLocation on_media;
on_media.medianr( reader.getint(1) );
on_media.filename( reader.getstring(2) );
-
+
string checksum_string(reader.getstring(3));
CheckSum checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -254,20 +255,20 @@
}
on_media.checksum(checksum);
on_media.downloadsize(reader.getint(4));
-
+
zypp::packagedelta::PatchRpm patch;
patch.location( on_media );
patch.buildtime(reader.getint(5));
-
+
pp_bv_cmd.bind( ":patch_package_id", patch_package_id );
-
+
sqlite3_reader bv_reader = pp_bv_cmd.executereader();
while (bv_reader.read())
{
packagedelta::PatchRpm::BaseVersion baseversion = packagedelta::PatchRpm::BaseVersion( bv_reader.getstring(0) , bv_reader.getstring(1), bv_reader.getint(2) );
patch.baseversion(baseversion);
}
-
+
//impl->addPatchRpm(patch);
}
}
@@ -275,7 +276,7 @@
cerr << "Exception Occured: " << ex.what() << endl;
}
}
-
+
ResolvableQuery RepoImpl::resolvableQuery()
{
return _rquery;
@@ -284,12 +285,12 @@
void RepoImpl::read_capabilities( sqlite3_connection &con, map<data::RecordId, pair<Resolvable::Kind, NVRAD> > &nvras )
{
CapFactory capfactory;
-
-
+
+
// precompile statements
-
-
-
+
+
+
// map<data::RecordId, capability::CapabilityImpl::Ptr> named_caps;
// sqlite3_command select_named_cmd( con, "select v.id, c.refers_kind, n.name, v.version, v.release, v.epoch, v.relation named_capabilities v, capabilities c, names n where v.name_id=n.id and c.id=ncc.capability_id and ncc.named_capability_id=v.id;");
// {
@@ -297,38 +298,38 @@
// sqlite3_reader reader = select_named_cmd.executereader();
// while ( reader.read() )
// {
-//
+//
// }
// }
sqlite3_command select_named_cmd( con, "select v.refers_kind, n.name, v.version, v.release, v.epoch, v.relation, v.dependency_type, v.resolvable_id from named_capabilities v, names n where v.name_id=n.id;");
sqlite3_command select_file_cmd( con, "select fc.refers_kind, dn.name, fn.name, fc.dependency_type, fc.resolvable_id from file_capabilities fc, files f, dir_names dn, file_names fn where f.id=fc.file_id and f.dir_name_id=dn.id and f.file_name_id=fn.id;");
-
+
{
debug::Measure mnc("read named capabilities");
sqlite3_reader reader = select_named_cmd.executereader();
while ( reader.read() )
{
-
+
Resolvable::Kind refer = _type_cache.kindFor(reader.getint(0));
Rel rel = _type_cache.relationFor(reader.getint(5));
-
+
data::RecordId rid = reader.getint64(7);
-
+
if ( rel == zypp::Rel::NONE )
{
capability::NamedCap *ncap = new capability::NamedCap( refer, reader.getstring(1) );
- zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(ncap) ) );
+ zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(ncap) ) );
}
else
{
capability::VersionedCap *vcap = new capability::VersionedCap( refer, reader.getstring(1), /* rel */ rel, Edition( reader.getstring(2), reader.getstring(3), reader.getint(4) ) );
zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(vcap) ) );
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(vcap) ) );
}
}
}
-
+
{
debug::Measure mnf("read file capabilities");
sqlite3_reader reader = select_file_cmd.executereader();
@@ -338,10 +339,10 @@
capability::FileCap *fcap = new capability::FileCap( refer, reader.getstring(1) + "/" + reader.getstring(2) );
zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(3));
data::RecordId rid = reader.getint64(4);
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(fcap) ) );
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(fcap) ) );
}
}
-
+
MIL << nvras.size() << " capabilities" << endl;
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "ScriptImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText ScriptImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText ScriptImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText ScriptImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText ScriptImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText ScriptImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor ScriptImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount ScriptImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount ScriptImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool ScriptImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date ScriptImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date ScriptImpl::installtime() const
@@ -111,19 +112,21 @@
Pathname ScriptImpl::do_script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Script", "doScript" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrScriptDoScript() );
}
Pathname ScriptImpl::undo_script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Script", "undoScript" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrScriptUndoScript() );
}
bool ScriptImpl::undo_available() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Script", "undoAvailable", false );
+#warning DUBIOUS ATTRIBUTE
+ return false;
+ //return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrScriptUndoAvailable(), false );
}
-
+
/////////////////////////////////////////////////////////////////
} } } // namespace zypp::repo::cached
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/TranslatedText.h"
#include "zypp/base/String.h"
#include "zypp/base/Logger.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
@@ -28,6 +29,7 @@
//
///////////////////////////////////////////////////////////////////
+#warning STILL A DUMMY IMPLEMENTATION
/** Default ctor
*/
SrcPackageImpl::SrcPackageImpl (Repository repo)
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5823 - in /branches/REFACTORING-10_3/libzypp-bindings: ./ examples/ruby/ swig/
by dmacvicar@svn.opensuse.org 21 Jun '07
by dmacvicar@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: dmacvicar
Date: Thu Jun 21 17:17:15 2007
New Revision: 5823
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5823&view=rev
Log:
some updates
Added:
branches/REFACTORING-10_3/libzypp-bindings/examples/ruby/play_with_repos.rb
branches/REFACTORING-10_3/libzypp-bindings/swig/RepoInfo.i
branches/REFACTORING-10_3/libzypp-bindings/swig/RepoManager.i
branches/REFACTORING-10_3/libzypp-bindings/swig/RepoStatus.i
branches/REFACTORING-10_3/libzypp-bindings/swig/RepoType.i
branches/REFACTORING-10_3/libzypp-bindings/swig/Repository.i
branches/REFACTORING-10_3/libzypp-bindings/swig/std_list.i
branches/REFACTORING-10_3/libzypp-bindings/swig/std_set.i
Removed:
branches/REFACTORING-10_3/libzypp-bindings/swig/Source.i
branches/REFACTORING-10_3/libzypp-bindings/swig/SourceFactory.i
Modified:
branches/REFACTORING-10_3/libzypp-bindings/CMakeLists.txt
branches/REFACTORING-10_3/libzypp-bindings/swig/Capability.i
branches/REFACTORING-10_3/libzypp-bindings/swig/ResObject.i
branches/REFACTORING-10_3/libzypp-bindings/swig/Url.i
branches/REFACTORING-10_3/libzypp-bindings/swig/ruby.i
branches/REFACTORING-10_3/libzypp-bindings/swig/zypp.i
Modified: branches/REFACTORING-10_3/libzypp-bindings/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/CMakeLists.txt Thu Jun 21 17:17:15 2007
@@ -32,7 +32,7 @@
INCLUDE(CPack)
#FIND_PACKAGE(SWIG REQUIRED)
-
+MESSAGE(STATUS "Looking modules in ${CMAKE_MODULE_PATH}")
FIND_PROGRAM(SWIG_EXECUTABLE
NAMES swig-1.3 swig
PATHS ${SWIG_DIR} ${SWIG_DIR}/.. ${SWIG_DIR}/../../bin /usr/bin /usr/local/bin ${CMAKE_INSTALL_PREFIX}/bin
Added: branches/REFACTORING-10_3/libzypp-bindings/examples/ruby/play_with_repos.rb
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/examples/ruby/play_with_repos.rb (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/examples/ruby/play_with_repos.rb Thu Jun 21 17:17:15 2007
@@ -0,0 +1,18 @@
+
+require 'rzypp'
+include Rzypp
+
+a = Arch.new("i386")
+puts a.to_s
+#exit
+
+z = ZYppFactory::instance.get_zypp
+
+manager = RepoManager.new
+
+manager.known_repositories.each do | repo |
+ repo.base_urls.each do | url |
+ puts url.to_s
+ end
+end
+
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/Capability.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/Capability.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/Capability.i Thu Jun 21 17:17:15 2007
@@ -44,11 +44,7 @@
/** accessors needed by solver/zmd */
/** Deprecated */
std::string index() const;
- /** Deprecated, defaults to Rel::NONE */
- Rel op() const;
- /** Deprecated, defaults to Edition::noedition */
- Edition edition() const;
-
+
private:
typedef capability::CapabilityImpl Impl;
typedef capability::CapabilityImpl_Ptr Impl_Ptr ;
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/RepoInfo.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/RepoInfo.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/RepoInfo.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,144 @@
+
+%template(UrlSet) std::set<Url>;
+
+class RepoInfo
+ {
+ friend std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
+
+ public:
+ RepoInfo();
+ ~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;
+
+ /**
+ * 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
+ * unless the download of the mirror list succeeds and it
+ * contains a valid url.
+ */
+ std::set<Url> baseUrls() const;
+
+ /**
+ * Url of a file which contains a list of Urls
+ * If empty, the base url will be used.
+ */
+ Url mirrorListUrl() const;
+
+ typedef std::set<Url>::const_iterator urls_const_iterator;
+
+ /**
+ * iterator that points at begin of repository urls
+ */
+ urls_const_iterator baseUrlsBegin() const;
+
+ /**
+ * iterator that points at end of repository urls
+ */
+ urls_const_iterator baseUrlsEnd() const;
+
+ /**
+ * If enabled is false, then this repository must be ignored as if does
+ * not exists, except when checking for duplicate alias.
+ */
+ boost::tribool enabled() const;
+
+ /**
+ * If true, the repostory must be refreshed before creating resolvables
+ * from it
+ */
+ boost::tribool autorefresh() const;
+
+ /**
+ * Type of repository,
+ *
+ */
+ 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;
+
+ /**
+ * Add a base url. \see baseUrls
+ * \param url The base url for the repository.
+ *
+ * To edit or remove urls, create a new RepoInfo instead.
+ */
+ RepoInfo & addBaseUrl( const Url &url );
+
+ /**
+ * Set mirror list url. \see mirrorListUrl
+ * \param url The base url for the list
+ */
+ RepoInfo & setMirrorListUrl( const Url &url );
+
+ /**
+ * enable or disable the repository \see enabled
+ * \param enabled
+ */
+ RepoInfo & setEnabled( boost::tribool enabled );
+
+ /**
+ * enable or disable autorefresh \see autorefresh
+ * \param enabled
+ */
+ RepoInfo & setAutorefresh( boost::tribool autorefresh );
+
+ /**
+ * set the repository alias \see alias
+ * \param alias
+ */
+ RepoInfo & setAlias( const std::string &alias );
+
+ /**
+ * set the repository type \see type
+ * \param t
+ */
+ RepoInfo & setType( const repo::RepoType &t );
+
+ /**
+ * set the repository name \see name
+ * \param name
+ */
+ RepoInfo & setName( const std::string &name );
+
+ /**
+ * \short set the repository filepath
+ * \param path File path
+ */
+ RepoInfo & setFilepath( const Pathname &filename );
+
+ std::ostream & dumpOn( std::ostream & str ) const;
+
+ std::ostream & dumpRepoOn( std::ostream & str ) const;
+
+ class Impl;
+ private:
+ /** Pointer to implementation */
+ RWCOW_pointer<Impl> _pimpl;
+ };
+ typedef std::list<RepoInfo> RepoInfoList;
+ %template(RepoInfoList) std::list<RepoInfo>;
+
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/RepoManager.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/RepoManager.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/RepoManager.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,57 @@
+
+ std::list<RepoInfo> readRepoFile(const Url & repo_file);
+
+ struct RepoManagerOptions
+ {
+ RepoManagerOptions();
+
+ Pathname repoCachePath;
+ Pathname repoRawCachePath;
+ Pathname knownReposPath;
+ };
+
+ class RepoManager
+ {
+ public:
+ RepoManager( const RepoManagerOptions &options = RepoManagerOptions() );
+ ~RepoManager();
+
+ enum RawMetadataRefreshPolicy
+ {
+ RefreshIfNeeded,
+ RefreshForced
+ };
+
+ enum CacheBuildPolicy
+ {
+ BuildIfNeeded,
+ BuildForced
+ };
+
+ enum RepoRemovePolicy
+ {
+
+ };
+
+ std::list<RepoInfo> knownRepositories() const;
+ void refreshMetadata( const RepoInfo &info,
+ RawMetadataRefreshPolicy policy = RefreshIfNeeded,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void cleanMetadata( const RepoInfo &info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void buildCache( const RepoInfo &info,
+ CacheBuildPolicy policy = BuildIfNeeded,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void cleanCache( const RepoInfo &info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ bool isCached( const RepoInfo &info ) const;
+ Repository createFromCache( const RepoInfo &info,const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ repo::RepoType probe( const Url &url );
+ void addRepository( const RepoInfo &info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void addRepositories( const Url &url,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void removeRepository( const RepoInfo & info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+
+ };
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/RepoStatus.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/RepoStatus.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/RepoStatus.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,57 @@
+class RepoStatus
+ {
+ friend std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
+
+ public:
+
+ /**
+ * Checksum of the repository.
+ * Usually the checksum of the index, but any
+ * checksum that changes when the repository changes
+ * in any way is sufficient.
+ */
+ std::string checksum() const;
+
+ /**
+ * timestamp of the repository. If the repository
+ * changes, it has to be updated as well with the
+ * new timestamp.
+ */
+ Date timestamp() const;
+
+ /**
+ * set the repository checksum \see checksum
+ * \param checksum
+ */
+ RepoStatus & setChecksum( const std::string &checksum );
+
+ /**
+ * set the repository timestamp \see timestamp
+ * \param timestamp
+ */
+ RepoStatus & setTimestamp( const Date ×tamp );
+
+ /** Implementation */
+ class Impl;
+
+ public:
+ /** Default ctor */
+ RepoStatus();
+
+ /**
+ * \short Status from a single file
+ * As most repository state is represented
+ * by the status of the index file, you can
+ * construct the status from a file.
+ */
+ RepoStatus( const Pathname &file );
+
+ /** Dtor */
+ ~RepoStatus();
+
+ public:
+
+ private:
+ /** Pointer to implementation */
+ RWCOW_pointer<Impl> _pimpl;
+ };
\ No newline at end of file
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/RepoType.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/RepoType.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/RepoType.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,26 @@
+
+struct RepoType
+ {
+ static const RepoType RPMMD;
+ static const RepoType YAST2;
+ //static const RepoType NONE;
+
+ enum Type
+ {
+ NONE_e,
+ RPMMD_e,
+ YAST2_e
+ };
+
+ RepoType(Type type) : _type(type) {}
+
+ explicit RepoType(const std::string & strval_r);
+
+ const Type toEnum() const { return _type; }
+
+ RepoType::Type parse(const std::string & strval_r);
+
+ const std::string & asString() const;
+
+ Type _type;
+ };
\ No newline at end of file
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/Repository.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/Repository.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/Repository.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,15 @@
+
+ class Repository : private base::SafeBool<Repository>
+ {
+ public:
+ Repository();
+ static const Repository noRepository;
+ public:
+ typedef unsigned long NumericId;
+ NumericId numericId() const;
+ const zypp::ResStore & resolvables();
+ const RepoInfo info() const;
+ const std::list<packagedelta::PatchRpm> & patchRpms() const;
+ const std::list<packagedelta::DeltaRpm> & deltaRpms() const;
+ };
+
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/ResObject.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/ResObject.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/ResObject.i Thu Jun 21 17:17:15 2007
@@ -19,8 +19,8 @@
Vendor vendor() const;
ByteCount size() const;
ByteCount archivesize() const;
- Source_Ref source() const;
- unsigned sourceMediaNr() const;
+ Repository repository() const;
+ unsigned mediaNr() const;
bool installOnly() const;
Date buildtime() const;
Date installtime() const;
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/Url.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/Url.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/Url.i Thu Jun 21 17:17:15 2007
@@ -10,3 +10,8 @@
%typemap(freearg) const Url & {
delete $1;
}
+
+%typemap(out) Url {
+ VALUE rburlstr = rb_str_new2($1.asString().c_str());
+ $result = rburlstr ;
+}
\ No newline at end of file
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/ruby.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/ruby.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/ruby.i Thu Jun 21 17:17:15 2007
@@ -1,5 +1,12 @@
-%rename("asString") foo(to_s);
+%rename("asString") to_s;
+
+#define auto_string( cl ) \
+%extend cl { \
+ std::string to_s() { \
+ return self->asString();\
+ } \
+}
#define iter( cl, storetype ) \
%mixin cl "Enumerable"; \
@@ -25,6 +32,19 @@
} \
}
+#define auto_iterator( cl, storetype ) \
+%mixin cl "Enumerable"; \
+%extend cl { \
+ void each() { \
+ cl::iterator i = self->begin(); \
+ while ( i != self->end() ) { \
+ rb_yield( SWIG_NewPointerObj( (void *) &*i, $descriptor(storetype), 0)); \
+ ++i; \
+ } \
+ } \
+}
+
+
%extend Target {
void each_by_kind( const ResObject::Kind & kind_r )
{
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/std_list.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/std_list.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/std_list.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,533 @@
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * std_list.i
+ *
+ * SWIG typemaps for std::list
+ * ----------------------------------------------------------------------------- */
+
+%include <std_common.i>
+
+// ------------------------------------------------------------------------
+// std::list
+//
+// The aim of all that follows would be to integrate std::list with
+// Ruby as much as possible, namely, to allow the user to pass and
+// be returned Ruby arrays
+// const declarations are used to guess the intent of the function being
+// exported; therefore, the following rationale is applied:
+//
+// -- f(std::list<T>), f(const std::list<T>&), f(const std::list<T>*):
+// the parameter being read-only, either a Ruby array or a
+// previously wrapped std::list<T> can be passed.
+// -- f(std::list<T>&), f(std::list<T>*):
+// the parameter must be modified; therefore, only a wrapped std::list
+// can be passed.
+// -- std::list<T> f():
+// the list is returned by copy; therefore, a Ruby array of T:s
+// is returned which is most easily used in other Ruby functions
+// -- std::list<T>& f(), std::list<T>* f(), const std::list<T>& f(),
+// const std::list<T>* f():
+// the list is returned by reference; therefore, a wrapped std::list
+// is returned
+// ------------------------------------------------------------------------
+
+%{
+#include <list>
+#include <algorithm>
+#include <stdexcept>
+%}
+
+// exported class
+
+namespace std {
+
+ %mixin list "Enumerable";
+
+ template<class T> class list {
+ %typemap(in) list<T> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ $1.push_back(*x);
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const list<T>& (std::list<T> temp),
+ const list<T>* (std::list<T> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ temp.push_back(*x);
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+
+ void each() {
+ for ( std::list<T>::const_iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+
+
+ %typemap(out) list<T> {
+ $result = rb_ary_new2($1.size());
+ unsigned int i = 0;
+ for ( std::list<T>::iterator it = $1.begin();
+ it != $1.end();
+ ++it )
+ {
+ T* x = new T((*it));
+ rb_ary_store($result,i,
+ SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 1));
+ ++i;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) list<T> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const list<T>&,
+ const list<T>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ list();
+ list(unsigned int size);
+ list(unsigned int size, const T& value);
+ list(const list<T> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) push_back;
+ void push_back(const T& x);
+ %extend {
+ /*
+ T pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty list");
+ T x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T& __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ void __setitem__(int i, const T& x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ */
+ void each() {
+ for ( std::list<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+
+ // Partial specialization for lists of pointers. [ beazley ]
+
+ %mixin list<T*> "Enumerable";
+ template<class T> class list<T*> {
+ %typemap(in) list<T*> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = std::list<T* >(size);
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ (($1_type &)$1)[i] = x;
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const list<T*>& (std::list<T*> temp),
+ const list<T*>* (std::list<T*> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ temp = std::list<T* >(size);
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ temp[i] = x;
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+ %typemap(out) list<T*> {
+ $result = rb_ary_new2($1.size());
+ for (unsigned int i=0; i<$1.size(); i++) {
+ T* x = (($1_type &)$1)[i];
+ rb_ary_store($result,i,
+ SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) list<T*> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T* >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const list<T*>&,
+ const list<T*>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T* >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ list();
+ list(unsigned int size);
+ list(unsigned int size, T * &value);
+ list(const list<T*> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) push_back;
+ void push_back(T* x);
+ %extend {
+ /*
+ T* pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty list");
+ T* x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T* __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ void __setitem__(int i, T* x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ */
+ void each() {
+ for ( std::list<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+
+
+ // specializations for built-ins
+
+ %define specialize_std_list(T,CHECK,CONVERT_FROM,CONVERT_TO)
+ %mixin list<T> "Enumerable";
+ template<> class list<T> {
+ %typemap(in) list<T> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = std::list<T >(size);
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ if (CHECK(o))
+ (($1_type &)$1)[i] = (T)(CONVERT_FROM(o));
+ else
+ rb_raise(rb_eTypeError,
+ "wrong argument type"
+ " (expected list<" #T ">)");
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const list<T>& (std::list<T> temp),
+ const list<T>* (std::list<T> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ temp = std::list<T >(size);
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ if (CHECK(o))
+ temp[i] = (T)(CONVERT_FROM(o));
+ else
+ rb_raise(rb_eTypeError,
+ "wrong argument type"
+ " (expected list<" #T ">)");
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+ %typemap(out) list<T> {
+ $result = rb_ary_new2($1.size());
+ for (unsigned int i=0; i<$1.size(); i++)
+ rb_ary_store($result,i,CONVERT_TO((($1_type &)$1)[i]));
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) list<T> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ VALUE o = RARRAY($input)->ptr[0];
+ if (CHECK(o))
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const list<T>&,
+ const list<T>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ VALUE o = RARRAY($input)->ptr[0];
+ if (CHECK(o))
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ list();
+ list(unsigned int size);
+ list(unsigned int size, const T& value);
+ list(const list<T> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) push_back;
+ void push_back(T x);
+ %extend {
+ /*
+ T pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty list");
+ T x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ void __setitem__(int i, T x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ */
+ void each() {
+ for ( std::list<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+ %enddef
+
+ specialize_std_list(bool,SWIG_BOOL_P,SWIG_RB2BOOL,SWIG_BOOL2RB);
+ specialize_std_list(char,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(int,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(short,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(long,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(unsigned char,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(unsigned int,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(unsigned short,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(unsigned long,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(double,SWIG_FLOAT_P,SWIG_NUM2DBL,rb_float_new);
+ specialize_std_list(float,SWIG_FLOAT_P,SWIG_NUM2DBL,rb_float_new);
+ specialize_std_list(std::string,SWIG_STRING_P,SWIG_RB2STR,SWIG_STR2RB);
+
+}
+
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/std_set.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/std_set.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/std_set.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,527 @@
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * std_set.i
+ *
+ * SWIG typemaps for std::set
+ * ----------------------------------------------------------------------------- */
+
+%include <std_common.i>
+
+// ------------------------------------------------------------------------
+// std::set
+//
+// The aim of all that follows would be to integrate std::set with
+// Ruby as much as possible, namely, to allow the user to pass and
+// be returned Ruby arrays
+// const declarations are used to guess the intent of the function being
+// exported; therefore, the following rationale is applied:
+//
+// -- f(std::set<T>), f(const std::set<T>&), f(const std::set<T>*):
+// the parameter being read-only, either a Ruby array or a
+// previously wrapped std::set<T> can be passed.
+// -- f(std::set<T>&), f(std::set<T>*):
+// the parameter must be modified; therefore, only a wrapped std::set
+// can be passed.
+// -- std::set<T> f():
+// the set is returned by copy; therefore, a Ruby array of T:s
+// is returned which is most easily used in other Ruby functions
+// -- std::set<T>& f(), std::set<T>* f(), const std::set<T>& f(),
+// const std::set<T>* f():
+// the set is returned by reference; therefore, a wrapped std::set
+// is returned
+// ------------------------------------------------------------------------
+
+%{
+#include <set>
+#include <algorithm>
+#include <stdexcept>
+%}
+
+// exported class
+
+namespace std {
+
+ %mixin set "Enumerable";
+
+ template<class T> class set {
+ %typemap(in) set<T> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ $1.insert(*x);
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const set<T>& (std::set<T> temp),
+ const set<T>* (std::set<T> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ temp.insert(*x);
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+
+ void each() {
+ for ( std::set<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = (T *) &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+
+
+ %typemap(out) set<T> {
+ $result = rb_ary_new2($1.size());
+ unsigned int i = 0;
+ for ( std::set<T>::iterator it = $1.begin();
+ it != $1.end();
+ ++it )
+ {
+ T* x = new T((*it));
+ rb_ary_store($result,i,
+ SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 1));
+ ++i;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) set<T> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const set<T>&,
+ const set<T>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ set();
+ set(const set<T> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) insert;
+ void insert(const T& x);
+ %extend {
+ /*
+ T pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty set");
+ T x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T& __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ void __setitem__(int i, const T& x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ */
+ void each() {
+ for ( std::set<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = (T *)&(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+
+ // Partial specialization for sets of pointers. [ beazley ]
+
+ %mixin set<T*> "Enumerable";
+ template<class T> class set<T*> {
+ %typemap(in) set<T*> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = std::set<T* >(size);
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ (($1_type &)$1)[i] = x;
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const set<T*>& (std::set<T*> temp),
+ const set<T*>* (std::set<T*> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ temp = std::set<T* >(size);
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ temp[i] = x;
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+ %typemap(out) set<T*> {
+ $result = rb_ary_new2($1.size());
+ for (unsigned int i=0; i<$1.size(); i++) {
+ T* x = (($1_type &)$1)[i];
+ rb_ary_store($result,i,
+ SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) set<T*> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T* >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const set<T*>&,
+ const set<T*>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T* >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ set();
+ set(const set<T*> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) insert;
+ void insert(T* x);
+ %extend {
+ /*
+ T* pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty set");
+ T* x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T* __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ void __setitem__(int i, T* x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ */
+ void each() {
+ for ( std::set<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = (T*) &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+
+
+ // specializations for built-ins
+
+ %define specialize_std_set(T,CHECK,CONVERT_FROM,CONVERT_TO)
+ %mixin set<T> "Enumerable";
+ template<> class set<T> {
+ %typemap(in) set<T> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = std::set<T >(size);
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ if (CHECK(o))
+ (($1_type &)$1)[i] = (T)(CONVERT_FROM(o));
+ else
+ rb_raise(rb_eTypeError,
+ "wrong argument type"
+ " (expected set<" #T ">)");
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const set<T>& (std::set<T> temp),
+ const set<T>* (std::set<T> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ temp = std::set<T >(size);
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ if (CHECK(o))
+ temp[i] = (T)(CONVERT_FROM(o));
+ else
+ rb_raise(rb_eTypeError,
+ "wrong argument type"
+ " (expected set<" #T ">)");
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+ %typemap(out) set<T> {
+ $result = rb_ary_new2($1.size());
+ for (unsigned int i=0; i<$1.size(); i++)
+ rb_ary_store($result,i,CONVERT_TO((($1_type &)$1)[i]));
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) set<T> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ VALUE o = RARRAY($input)->ptr[0];
+ if (CHECK(o))
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const set<T>&,
+ const set<T>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ VALUE o = RARRAY($input)->ptr[0];
+ if (CHECK(o))
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ set();
+ set(const set<T> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) insert;
+ void insert(T x);
+ %extend {
+ /*
+ T pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty set");
+ T x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ void __setitem__(int i, T x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ */
+ void each() {
+ for ( std::set<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+ %enddef
+
+ specialize_std_set(bool,SWIG_BOOL_P,SWIG_RB2BOOL,SWIG_BOOL2RB);
+ specialize_std_set(char,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(int,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(short,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(long,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(unsigned char,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(unsigned int,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(unsigned short,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(unsigned long,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(double,SWIG_FLOAT_P,SWIG_NUM2DBL,rb_float_new);
+ specialize_std_set(float,SWIG_FLOAT_P,SWIG_NUM2DBL,rb_float_new);
+ specialize_std_set(std::string,SWIG_STRING_P,SWIG_RB2STR,SWIG_STR2RB);
+
+}
+
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/zypp.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/zypp.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/zypp.i Thu Jun 21 17:17:15 2007
@@ -1,5 +1,4 @@
%module rzypp
-%include std_string.i
%{
/* Includes the header in the wrapper code */
@@ -12,8 +11,6 @@
#include <zypp/ZYpp.h>
#include <zypp/Pathname.h>
#include "zypp/base/ReferenceCounted.h"
- #include "zypp/SourceFactory.h"
- #include "zypp/Source.h"
#include "zypp/ResObject.h"
#include "zypp/Target.h"
#include "zypp/target/TargetImpl.h"
@@ -21,19 +18,20 @@
#include "zypp/CapFactory.h"
#include "zypp/Package.h"
#include "zypp/ResFilters.h"
-#include "zypp/source/OnMediaLocation.h"
+#include "zypp/OnMediaLocation.h"
+ #include "zypp/Repository.h"
+ #include "zypp/RepoManager.h"
+ #include "zypp/repo/RepoType.h"
#include "zypp/MediaSetAccess.h"
using namespace boost;
using namespace zypp;
+ using namespace zypp::repo;
using namespace zypp::resfilter;
+ typedef std::set<Url> UrlSet;
%}
-#ifdef SWIGRUBY
-%include "ruby.i"
-#endif
-
%rename("+") "operator+";
%rename("<<") "operator<<";
%rename("!=") "operator!=";
@@ -57,6 +55,13 @@
};
%include "Pathname.i"
+%include "Url.i"
+
+%include std_string.i
+%include "stl.i"
+%include "std_list.i"
+%include "std_set.i"
+
%include "Arch.i"
%include "ResStore.i"
%include "Edition.i"
@@ -64,8 +69,11 @@
%include "Date.i"
%include "Resolvable.i"
%include "ByteCount.i"
-%include "Source.i"
-%include "SourceFactory.i"
+%include "RepoType.i"
+%include "Repository.i"
+%include "RepoInfo.i"
+%include "RepoManager.i"
+%include "RepoStatus.i"
%include "ResObject.i"
%include "TranslatedText.i"
%include "CheckSum.i"
@@ -85,11 +93,18 @@
%include "ResPool.i"
%include "ZYppCommitPolicy.i"
%include "ZYppCommitResult.i"
-%include "Url.i"
%include "MediaSetAccess.i"
+
+#ifdef SWIGRUBY
+%include "ruby.i"
+#endif
+
+
/* define iterators using swig macros */
iter2( ResStore, ResObject::Ptr )
+auto_iterator( std::list<RepoInfo>, RepoInfo )
+%alias Arch::asString "to_s";
class ZYpp
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5822 - in /trunk/zypper/src: zypp-checkpatches.cc zypper-info.cc zypper-media-callbacks.h zypper-misc.cc zypper-search.h zypper-source-callbacks.h zypper-tabulator.cc zypper-updates.cc zypper.cc
by jkupec@svn.opensuse.org 21 Jun '07
by jkupec@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: jkupec
Date: Thu Jun 21 17:10:10 2007
New Revision: 5822
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5822&view=rev
Log:
adapted to libzypp after removing the old API (libzypp r5820, branch
REFACTORING-10_3)
Modified:
trunk/zypper/src/zypp-checkpatches.cc
trunk/zypper/src/zypper-info.cc
trunk/zypper/src/zypper-media-callbacks.h
trunk/zypper/src/zypper-misc.cc
trunk/zypper/src/zypper-search.h
trunk/zypper/src/zypper-source-callbacks.h
trunk/zypper/src/zypper-tabulator.cc
trunk/zypper/src/zypper-updates.cc
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypp-checkpatches.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypp-checkpatches.cc?…
==============================================================================
--- trunk/zypper/src/zypp-checkpatches.cc (original)
+++ trunk/zypper/src/zypp-checkpatches.cc Thu Jun 21 17:10:10 2007
@@ -9,6 +9,7 @@
/* (c) Novell Inc. */
+#include <fcntl.h>
#include <iostream>
#include <fstream>
@@ -17,6 +18,7 @@
#include <zypp/base/Gettext.h>
#include <zypp/target/store/PersistentStorage.h>
#include <zypp/RepoManager.h>
+#include <zypp/PathInfo.h>
#include "checkpatches-keyring-callbacks.h"
#include "zypper.h"
Modified: trunk/zypper/src/zypper-info.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-info.cc?rev=58…
==============================================================================
--- trunk/zypper/src/zypper-info.cc (original)
+++ trunk/zypper/src/zypper-info.cc Thu Jun 21 17:10:10 2007
@@ -81,7 +81,7 @@
*/
void printPkgInfo(const PoolItem & pool_item, const PoolItem & ins_pool_item) {
- cout << _("Catalog: ") << pool_item.resolvable()->source().alias() << endl;
+ cout << _("Catalog: ") << pool_item.resolvable()->repository().info().alias() << endl;
cout << _("Name: ") << pool_item.resolvable()->name() << endl;
cout << _("Version: ") << pool_item.resolvable()->edition().asString() << endl;
cout << _("Arch: ") << pool_item.resolvable()->arch().asString() << endl;
Modified: trunk/zypper/src/zypper-media-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-media-callback…
==============================================================================
--- trunk/zypper/src/zypper-media-callbacks.h (original)
+++ trunk/zypper/src/zypper-media-callbacks.h Thu Jun 21 17:10:10 2007
@@ -21,7 +21,6 @@
#include <zypp/KeyRing.h>
#include <zypp/Digest.h>
#include <zypp/Url.h>
-#include <zypp/Source.h>
#include "AliveCursor.h"
@@ -33,7 +32,7 @@
{
struct MediaChangeReportReceiver : public zypp::callback::ReceiveReport<MediaChangeReport>
- {
+ {/*
virtual MediaChangeReport::Action requestMedia( zypp::Source_Ref source, unsigned mediumNr, MediaChangeReport::Error error, const std::string & description )
{
cout << "Please insert media [" << description << "] # " << mediumNr << ". Retry [y/n]: " << endl;
@@ -43,6 +42,7 @@
return MediaChangeReport::ABORT;
}
+ */
};
// progress for downloading a file
Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=58…
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Thu Jun 21 17:10:10 2007
@@ -435,7 +435,7 @@
cout_vv << format(_("(%d resolvables found)")) % store.size() << endl;
}
- catch ( const repo::RepoNotCachedException &e )
+ catch (const Exception & e)
{
ZYPP_CAUGHT(e);
cerr << format(_("Problem loading data from '%s'")) % repo.alias();
@@ -553,7 +553,7 @@
Patch::constPtr patch = asKind<Patch>(res);
TableRow tr;
- tr << patch->source ().alias ();
+ tr << patch->repository().info().alias ();
tr << res->name () << res->edition ().asString();
tr << patch->category();
tr << string_status (it->status ());
@@ -589,7 +589,7 @@
if (true) {
TableRow tr (cols);
- tr << patch->source ().alias ();
+ tr << patch->repository().info().alias ();
tr << res->name () << res->edition ().asString();
tr << patch->category();
tr << string_status (it->status ());
@@ -726,7 +726,7 @@
// candstat.setToBeInstalled (ResStatus::USER);
ResObject::constPtr res = ci->resolvable();
TableRow tr (cols);
- tr << "v" << res->source ().alias ();
+ tr << "v" << res->repository().info().alias();
if (gSettings.is_rug_compatible)
tr << ""; // Bundle
tr << res->name ()
Modified: trunk/zypper/src/zypper-search.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-search.h?rev=5…
==============================================================================
--- trunk/zypper/src/zypper-search.h (original)
+++ trunk/zypper/src/zypper-search.h Thu Jun 21 17:10:10 2007
@@ -262,7 +262,7 @@
}
// add other fields to the result table
- row << pool_item.resolvable()->source().alias()
+ row << pool_item.resolvable()->repository().info().alias()
// TODO what about rug's Bundle?
<< (gSettings.is_rug_compatible ? "" : pool_item.resolvable()->kind().asString())
<< pool_item.resolvable()->name()
Modified: trunk/zypper/src/zypper-source-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-source-callbac…
==============================================================================
--- trunk/zypper/src/zypper-source-callbacks.h (original)
+++ trunk/zypper/src/zypper-source-callbacks.h Thu Jun 21 17:10:10 2007
@@ -20,7 +20,6 @@
#include <zypp/KeyRing.h>
#include <zypp/Digest.h>
#include <zypp/Url.h>
-#include <zypp/Source.h>
#include "zypper-callbacks.h"
@@ -28,8 +27,7 @@
namespace ZmartRecipients
{
///////////////////////////////////////////////////////////////////
-#ifndef LIBZYPP_1xx
- // progress for probing a source
+/* // progress for probing a source
struct ProbeSourceReceive : public zypp::callback::ReceiveReport<zypp::source::ProbeSourceReport>
{
virtual void start(const zypp::Url &url)
@@ -37,7 +35,7 @@
cout << "Determining " << url << " source type..." << endl;
}
- virtual void failedProbe( const zypp::Url &/*url*/, const std::string & type )
+ virtual void failedProbe( const zypp::Url &/*url*//*, const std::string & type )
{
cout << ".. not " << type << endl;
}
@@ -47,7 +45,7 @@
cout << url << " is type " << type << endl;
}
- virtual void finish(const zypp::Url &/*url*/, Error error, const std::string & reason )
+ virtual void finish(const zypp::Url &/*url*//*, Error error, const std::string & reason )
{
if ( error == INVALID )
{
@@ -56,10 +54,10 @@
}
}
- virtual bool progress(const zypp::Url &/*url*/, int /*value*/)
+ virtual bool progress(const zypp::Url &/*url*//*, int /*value*//*)
{ return true; }
- virtual Action problem( const zypp::Url &/*url*/, Error error, const std::string & description )
+ virtual Action problem( const zypp::Url &/*url*//*, Error error, const std::string & description )
{
display_done ();
display_error (error, description);
@@ -67,8 +65,7 @@
return ABORT;
}
};
-#endif
-
+ */
// progress for downloading a resolvable
struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport<zypp::source::DownloadResolvableReport>
{
@@ -203,7 +200,7 @@
}
};
-#ifndef LIBZYPP_1xx
+/*
struct SourceReportReceiver : public zypp::callback::ReceiveReport<zypp::source::SourceReport>
{
virtual void start( zypp::Source_Ref source, const std::string & task )
@@ -225,14 +222,14 @@
return true;
}
- virtual Action problem( zypp::Source_Ref /*source*/, Error error, const std::string & description )
+ virtual Action problem( zypp::Source_Ref /*source*//*, Error error, const std::string & description )
{
display_done ();
display_error (error, description);
return (Action) read_action_ari ();
}
- virtual void finish( zypp::Source_Ref /*source*/, const std::string & task, Error error, const std::string & reason )
+ virtual void finish( zypp::Source_Ref /*source*//*, const std::string & task, Error error, const std::string & reason )
{
display_step(100);
// many of these, avoid newline
@@ -246,8 +243,7 @@
std::string _task;
zypp::Source_Ref _source;
};
-#endif
-
+*/
///////////////////////////////////////////////////////////////////
}; // namespace ZmartRecipients
///////////////////////////////////////////////////////////////////
@@ -255,27 +251,21 @@
class SourceCallbacks {
private:
-#ifndef LIBZYPP_1xx
- ZmartRecipients::ProbeSourceReceive _sourceProbeReport;
- ZmartRecipients::SourceReportReceiver _SourceReport;
-#endif
+// ZmartRecipients::ProbeSourceReceive _sourceProbeReport;
+// ZmartRecipients::SourceReportReceiver _SourceReport;
ZmartRecipients::DownloadResolvableReportReceiver _downloadReport;
public:
SourceCallbacks()
{
-#ifndef LIBZYPP_1xx
- _sourceProbeReport.connect();
- _SourceReport.connect();
-#endif
+// _sourceProbeReport.connect();
+// _SourceReport.connect();
_downloadReport.connect();
}
~SourceCallbacks()
{
-#ifndef LIBZYPP_1xx
- _sourceProbeReport.disconnect();
- _SourceReport.disconnect();
-#endif
+// _sourceProbeReport.disconnect();
+// _SourceReport.disconnect();
_downloadReport.disconnect();
}
Modified: trunk/zypper/src/zypper-tabulator.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-tabulator.cc?r…
==============================================================================
--- trunk/zypper/src/zypper-tabulator.cc (original)
+++ trunk/zypper/src/zypper-tabulator.cc Thu Jun 21 17:10:10 2007
@@ -5,7 +5,7 @@
TableStyle Table::defaultStyle = Ascii;
static
-char * lines[][3] = {
+const char * lines[][3] = {
{ "|", "-", "+"}, ///< Ascii
// utf 8. TODO wchars?
{ "\xE2\x94\x82", "\xE2\x94\x80", "\xE2\x94\xBC"}, ///< light
@@ -38,7 +38,7 @@
void TableRow::dumpTo (ostream &stream, const vector<unsigned>& widths,
TableStyle st) const {
- char * vline = lines[st][0];
+ const char * vline = lines[st][0];
bool seen_first = false;
container::const_iterator
@@ -90,8 +90,8 @@
}
void Table::dumpRule (ostream &stream) const {
- char * hline = lines[_style][1];
- char * cross = lines[_style][2];
+ const char * hline = lines[_style][1];
+ const char * cross = lines[_style][2];
bool seen_first = false;
Modified: trunk/zypper/src/zypper-updates.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-updates.cc?rev…
==============================================================================
--- trunk/zypper/src/zypper-updates.cc (original)
+++ trunk/zypper/src/zypper-updates.cc Thu Jun 21 17:10:10 2007
@@ -102,8 +102,8 @@
out << " <update category=\"" << patch ->category() << "\" name=\"" << patch->name() << "\" edition=\"" << patch->edition() << "\"" << ">" << std::endl;
out << " <summary>" << xml_escape(patch->summary()) << "</summary>" << endl;
out << " <description>" << xml_escape(patch->description()) << "</description>" << endl;
- if ( patch->source() != Source_Ref::noSource )
- out << "<source url=\"" << patch->source().url() << "\" alias=\"" << patch->source().alias() << "\"/>" << std::endl;
+ if ( patch->repository() != Repository::noRepository )
+ out << "<source url=\"" << *(patch->repository().info().baseUrlsBegin()) << "\" alias=\"" << patch->repository().info().alias() << "\"/>" << std::endl;
out << "</update>" << endl;
count++;
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=5822&r1…
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Thu Jun 21 17:10:10 2007
@@ -435,7 +435,7 @@
"This command has no options.\n"
);
}
- else if (command == ZypperCommand::NONE) {//command_str == "patches" || command_str == "pch") {
+ else if (command == ZypperCommand::SHOW_PATCHES) {
static struct option patches_options[] = {
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
@@ -844,7 +844,7 @@
// --------------------------( patches )------------------------------------
- else if (command == ZypperCommand::NONE) {//command_str == "patches" || command_str == "pch") {
+ else if (command == ZypperCommand::SHOW_PATCHES) {
if (ghelp) {
cerr << specific_help;
return !ghelp;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5821 - in /trunk/zypper/src: zypper-command.cc zypper-command.h
by jkupec@svn.opensuse.org 21 Jun '07
by jkupec@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: jkupec
Date: Thu Jun 21 17:07:22 2007
New Revision: 5821
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5821&view=rev
Log:
SHOW_PATCHES added
Modified:
trunk/zypper/src/zypper-command.cc
trunk/zypper/src/zypper-command.h
Modified: trunk/zypper/src/zypper-command.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-command.cc?rev…
==============================================================================
--- trunk/zypper/src/zypper-command.cc (original)
+++ trunk/zypper/src/zypper-command.cc Thu Jun 21 17:07:22 2007
@@ -29,6 +29,7 @@
const ZypperCommand ZypperCommand::INFO(ZypperCommand::INFO_e);
const ZypperCommand ZypperCommand::LIST_UPDATES(ZypperCommand::LIST_UPDATES_e);
const ZypperCommand ZypperCommand::PATCH_CHECK(ZypperCommand::PATCH_CHECK_e);
+const ZypperCommand ZypperCommand::SHOW_PATCHES(ZypperCommand::SHOW_PATCHES_e);
const ZypperCommand ZypperCommand::HELP(ZypperCommand::HELP_e);
const ZypperCommand ZypperCommand::SHELL(ZypperCommand::SHELL_e);
@@ -62,6 +63,7 @@
_table["info"] = _table["if"] = ZypperCommand::INFO_e;
_table["list-updates"] = _table["lu"] = ZypperCommand::LIST_UPDATES_e;
_table["patch-check"] = _table["pchk"] = ZypperCommand::PATCH_CHECK_e;
+ _table["patches"] = _table["pch"] = ZypperCommand::SHOW_PATCHES_e;
_table["help"] = ZypperCommand::HELP_e;
_table["shell"] = _table["sh"] = ZypperCommand::SHELL_e;
Modified: trunk/zypper/src/zypper-command.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-command.h?rev=…
==============================================================================
--- trunk/zypper/src/zypper-command.h (original)
+++ trunk/zypper/src/zypper-command.h Thu Jun 21 17:07:22 2007
@@ -23,6 +23,7 @@
static const ZypperCommand INFO;
static const ZypperCommand LIST_UPDATES;
static const ZypperCommand PATCH_CHECK;
+ static const ZypperCommand SHOW_PATCHES;
static const ZypperCommand HELP;
static const ZypperCommand SHELL;
@@ -52,6 +53,7 @@
INFO_e,
LIST_UPDATES_e,
PATCH_CHECK_e,
+ SHOW_PATCHES_e,
HELP_e,
SHELL_e,
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5820 - /branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
by dmacvicar@svn.opensuse.org 21 Jun '07
by dmacvicar@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: dmacvicar
Date: Thu Jun 21 14:01:49 2007
New Revision: 5820
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5820&view=rev
Log:
install
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Thu Jun 21 14:01:49 2007
@@ -161,11 +161,6 @@
Selection.h
Signature.h
SilentCallbacks.h
- Source.h
- SourceCache.h
- SourceFactory.h
- SourceFeed.h
- SourceManager.h
SrcPackage.h
SysContent.h
SystemResObject.h
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0