29 inline std::string makeevrstr(
const std::string & version_r,
30 const std::string & release_r,
33 std::string ret( version_r );
34 if ( ! release_r.empty() )
43 inline std::string makeevrstr(
const char * version_r,
44 const char * release_r,
46 {
return makeevrstr( std::string(version_r?version_r:
""),
47 std::string(release_r?release_r:
""),
59 const std::string & release_r,
61 : _str( makeevrstr( version_r, release_r, epoch_r ) )
65 const char * release_r,
67 : _str( makeevrstr( version_r, release_r, epoch_r ) )
71 const std::string & release_r,
72 const std::string & epoch_r )
77 const char * release_r,
78 const char * epoch_r )
85 const char * sep =
str;
87 for ( ; *sep >=
'0' && *sep <=
'9'; ++sep )
90 return str::strtonum<epoch_t>( std::string(
str, sep-
str ) );
97 const char * sep =
str;
99 for ( ; *sep >=
'0' && *sep <=
'9'; ++sep )
104 sep = ::strrchr(
str,
'-' );
106 return std::string(
str, sep-
str );
113 const char * sep = ::strrchr(
str,
'-' );
117 return std::string();
122 if ( lhs == rhs )
return 0;
123 if ( lhs && rhs ) return ::pool_evrcmp_str(
myPool().getPool(), lhs, rhs, EVRCMP_COMPARE );
124 return( lhs ? 1 : -1 );
129 if ( lhs == rhs )
return 0;
130 if ( lhs && rhs ) return ::pool_evrcmp_str(
myPool().getPool(), lhs, rhs, EVRCMP_MATCH );
131 return( lhs ? 1 : -1 );