improve serialization of version in PoolQuery.
authorJosef Reidinger <jreidinger@suse.cz>
Fri, 23 May 2008 13:02:52 +0000 (13:02 +0000)
committerJosef Reidinger <jreidinger@suse.cz>
Fri, 23 May 2008 13:02:52 +0000 (13:02 +0000)
tests/zypp/PoolQuery_test.cc
tests/zypp/data/PoolQuery/savedqueries
zypp/PoolQuery.cc

index 713f1c5..6948438 100644 (file)
@@ -592,6 +592,7 @@ BOOST_AUTO_TEST_CASE(pool_query_recovery)
   q.setRequireAll();
   q.setCaseSensitive();
   q.setUninstalledOnly();
+  q.setEdition(Edition("0.8.3"),Rel::NE);
   BOOST_CHECK(q==queries[1]);
 }
 
index a770c55..698efc4 100644 (file)
@@ -9,3 +9,4 @@ match_type: regex
 require_all: on
 case_sensitive: on
 install_status: not-installed
+version: != 0.8.3
index 7df1954..51a9fc9 100644 (file)
@@ -478,6 +478,7 @@ attremptycheckend:
     o << "* SEARCH_NOCASE: " << ((_cflags & SEARCH_NOCASE) ? "yes" : "no") << endl;
     o << "* SEARCH_ALL_REPOS: " << ((_cflags & SEARCH_ALL_REPOS) ? "yes" : "no") << endl;
     o << "status filter flags:" << _status_flags << endl;
+    o << "version: "<< _op << " " << _edition.asString() << endl;
 
     // raw
 
@@ -732,7 +733,7 @@ attremptycheckend:
 
       // copy the iterator to forward check for the next attribute ***
       _tmpit = base_reference();
-      _has_next = (*(++_tmpit) != sat::detail::noId);
+      _has_next = ++_tmpit != LookupAttr::iterator();
 
       if (_has_next)
       {
@@ -1142,12 +1143,12 @@ attremptycheckend:
       else if ( attribute == PoolQueryAttr::editionAttr)
       {
         string::size_type pos;
-        Rel rel;
-        if (attrValue.find_first_of("=<>") == 0)
+        Rel rel("==");
+        if (attrValue.find_first_of("=<>!") == 0)
         {
           pos = attrValue.find_last_of("=<>");
           rel = Rel(attrValue.substr(0, pos+1));
-          attrValue = attrValue.substr(pos+1, attrValue.npos);
+          attrValue = str::trim(attrValue.substr(pos+1, attrValue.npos));
         }
 
         setEdition(Edition(attrValue), rel);
@@ -1329,6 +1330,11 @@ attremptycheckend:
       return false;
     if(a._pimpl->_cflags!= _pimpl->_cflags)
       return false;
+    if(a.edition()!=edition())
+      return false;
+    if(a.editionRel()!= editionRel())
+      return false;
+    
 
     return true;
   }