Author: mlandres
Date: Tue Jan 15 15:34:13 2008
New Revision: 8289
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8289&view=rev
Log:
backup
Modified:
branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt
branches/tmp/ma/jump_sat/libzypp/zypp/Edition.cc
branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h
branches/tmp/ma/jump_sat/libzypp/zypp/ResKind.h
branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStrType.h
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt?rev=8289&r1=8288&r2=8289&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt Tue Jan 15 15:34:13 2008
@@ -1091,11 +1091,11 @@
${zypp_target_modalias_SRCS}
${zypp_target_SRCS}
${zypp_solver_detail_SRCS}
-${zypp_sat_SRCS}
${zypp_ui_SRCS}
-${zypp_zypp_detail_SRCS}
${zypp_thread_SRCS}
${zypp_SRCS}
+${zypp_zypp_detail_SRCS}
+${zypp_sat_SRCS}
${zypp_base_SRCS}
)
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/Edition.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/Edition.cc?rev=8289&r1=8288&r2=8289&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/Edition.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/Edition.cc Tue Jan 15 15:34:13 2008
@@ -74,7 +74,7 @@
return 0;
}
- const std::string & Edition::version() const
+ std::string Edition::version() const
{
const char * str( c_str() );
const char * sep = str;
@@ -90,7 +90,7 @@
return str;
}
- const std::string & Edition::release() const
+ std::string Edition::release() const
{
const char * str( c_str() );
const char * sep = ::strrchr( str, '-' );
@@ -100,16 +100,18 @@
return std::string();
}
- int Edition::_doCompareC( const char * rhs ) const
+ int Edition::_doCompare( const char * lhs, const char * rhs )
{
- return ::evrcmp_str( sat::Pool::instance().get(),
- c_str(), rhs, EVRCMP_COMPARE );
+ if ( lhs == rhs ) return 0;
+ if ( lhs && rhs ) return ::evrcmp_str( sat::Pool::instance().get(), lhs, rhs, EVRCMP_COMPARE );
+ return( lhs ? 1 : -1 );
}
- int Edition::_doMatchC( const char * rhs ) const
+ int Edition::_doMatch( const char * lhs, const char * rhs )
{
- return ::evrcmp_str( sat::Pool::instance().get(),
- c_str(), rhs, EVRCMP_MATCH );
+ if ( lhs == rhs ) return 0;
+ if ( lhs && rhs ) return ::evrcmp_str( sat::Pool::instance().get(), lhs, rhs, EVRCMP_MATCH );
+ return( lhs ? 1 : -1 );
}
/////////////////////////////////////////////////////////////////
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h?rev=8289&r1=8288&r2=8289&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h Tue Jan 15 15:34:13 2008
@@ -79,8 +79,8 @@
/** Ctor taking edition as string. */
explicit Edition( sat::detail::IdType id_r ) : _str( sat::IdStr(id_r).c_str() ) {}
explicit Edition( const sat::IdStr & idstr_r ) : _str( idstr_r.c_str() ) {}
- explicit Edition( const char * cstr_r ) : _str( cstr_r ) {}
explicit Edition( const std::string & str_r ) : _str( str_r ) {}
+ explicit Edition( const char * cstr_r ) : _str( cstr_r ) {}
/** Ctor taking \a version_r, \a release_r and optional \a epoch_r */
Edition( const std::string & version_r,
@@ -97,25 +97,12 @@
epoch_t epoch() const;
/** Version */
- const std::string & version() const;
+ std::string version() const;
/** Release */
- const std::string & release() const;
+ std::string release() const;
public:
- /** */
- using sat::IdStrType<Edition>::compare;
-
- /** Compare two Editions returning <tt>-1,0,1</tt>.
- * \return <tt>-1,0,1</tt> if editions are <tt>\<,==,\></tt>.
- *
- * \attention An empty version or release string is not treated
- * specialy. It's the least possible value. If you want an empty
- * string treated as \c ANY, use \ref match.
- */
- static int compare( const Edition & lhs, const Edition & rhs )
- { return lhs.compare( rhs ); }
-
/** \ref compare functor.
* \see \ref RelCompare.
*/
@@ -127,20 +114,37 @@
typedef Range<Edition> CompareRange;
public:
- /** Match two Editions returning <tt>-1,0,1</tt>, treating empty
- * version/release strings as \c ANY.
- */
- int match( const Edition & rhs ) const { return _doMatchI( rhs.idStr() ); }
- int match( const sat::IdStr & rhs ) const { return _doMatchI( rhs ); }
- int match( const char * rhs ) const { return _doMatchC( rhs ); }
- int match( const std::string & rhs ) const { return _doMatchC( rhs.c_str() ); }
-
- /** Match two Editions returning <tt>-1,0,1</tt>, treating empty
+ /** \name Match two Editions
+ * Match two Editions returning <tt>-1,0,1</tt>, treating empty
* version/release strings as \c ANY.
- * \return <tt>-1,0,1</tt> if editions match <tt>\<,==,\></tt>.
*/
- static int match( const Edition & lhs, const Edition & rhs )
- { return lhs.match( rhs ); }
+ //@{
+ static int match( const Edition & lhs, const Edition & rhs ) { return match( lhs.idStr(), rhs.idStr() ); }
+ static int match( const Edition & lhs, const IdStr & rhs ) { return match( lhs.idStr(), rhs ); }
+ static int match( const Edition & lhs, const std::string & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
+ static int match( const Edition & lhs, const char * rhs ) { return _doMatch( lhs.c_str(), rhs );}
+
+ static int match( const IdStr & lhs, const Edition & rhs ) { return match( lhs, rhs.idStr() ); }
+ static int match( const IdStr & lhs, const IdStr & rhs ) { return lhs.compareEQ( rhs ) ? 0 :
+ _doMatch( lhs.c_str(), rhs.c_str() ); }
+ static int match( const IdStr & lhs, const std::string & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
+ static int match( const IdStr & lhs, const char * rhs ) { return _doMatch( lhs.c_str(), rhs ); }
+
+ static int match( const std::string & lhs, const Edition & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() );}
+ static int match( const std::string & lhs, const IdStr & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
+ static int match( const std::string & lhs, const std::string & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
+ static int match( const std::string & lhs, const char * rhs ) { return _doMatch( lhs.c_str(), rhs ); }
+
+ static int match( const char * lhs, const Edition & rhs ) { return _doMatch( lhs, rhs.c_str() );}
+ static int match( const char * lhs, const IdStr & rhs ) { return _doMatch( lhs, rhs.c_str() ); }
+ static int match( const char * lhs, const std::string & rhs ) { return _doMatch( lhs, rhs.c_str() ); }
+ static int match( const char * lhs, const char * rhs ) { return _doMatch( lhs, rhs ); }
+
+ int match( const Edition & rhs ) const { return match( idStr(), rhs.idStr() ); }
+ int match( const IdStr & rhs ) const { return match( idStr(), rhs ); }
+ int match( const std::string & rhs ) const { return _doMatch( c_str(), rhs.c_str() ); }
+ int match( const char * rhs ) const { return _doMatch( c_str(), rhs ); }
+ //@}
/** \ref match functor.
* \see \ref RelCompare.
@@ -157,9 +161,8 @@
typedef Range