- initial support for enhances/suggests in rpm >= 4.4.3
authorpmatilai <pmatilai>
Mon, 16 Jan 2006 23:56:03 +0000 (23:56 +0000)
committerpmatilai <pmatilai>
Mon, 16 Jan 2006 23:56:03 +0000 (23:56 +0000)
apt-pkg/rpm/rpmlistparser.cc

index 8d034c7..f353221 100644 (file)
@@ -390,9 +390,16 @@ bool rpmListParser::ParseDepends(pkgCache::VerIterator Ver,
       if (DepMode == true) {
         if (flagl[i] & RPMSENSE_PREREQ)
            Type = pkgCache::Dep::PreDepends;
-        else
+        else if (flagl[i] & RPMSENSE_PREREQ)
            Type = pkgCache::Dep::Depends;
+#if RPM_VERSION >= 0x040403
+        else if (flagl[i] & RPMSENSE_MISSINGOK)
+           Type = pkgCache::Dep::Suggests;
+#endif
+        else
+           /* WTF? */;
       }
+
 #if RPM_VERSION >= 0x040404
       if (namel[i][0] == 'g' && strncmp(namel[i], "getconf", 7) == 0)
       {
@@ -515,6 +522,28 @@ bool rpmListParser::ParseDepends(pkgCache::VerIterator Ver,
       res = headerGetEntry(header, RPMTAG_CONFLICTFLAGS, &type,
                           (void **)&flagl, &count);
       break;
+#if RPM_VERSION >= 0x040403
+   case pkgCache::Dep::Suggests:
+      res = headerGetEntry(header, RPMTAG_SUGGESTSNAME, &type, 
+                          (void **)&namel, &count);
+      if (res != 1)
+         return true;
+      res = headerGetEntry(header, RPMTAG_SUGGESTSVERSION, &type, 
+                          (void **)&verl, &count);
+      res = headerGetEntry(header, RPMTAG_SUGGESTSFLAGS, &type,
+                          (void **)&flagl, &count);
+      break;
+   case pkgCache::Dep::Enhances:
+      res = headerGetEntry(header, RPMTAG_ENHANCESNAME, &type, 
+                          (void **)&namel, &count);
+      if (res != 1)
+         return true;
+      res = headerGetEntry(header, RPMTAG_ENHANCESVERSION, &type, 
+                          (void **)&verl, &count);
+      res = headerGetEntry(header, RPMTAG_ENHANCESFLAGS, &type,
+                          (void **)&flagl, &count);
+      break;
+#endif
    }
    
    ParseDepends(Ver, namel, verl, flagl, count, Type);