Report all enabled dependency bits in deptype format extension
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 29 Mar 2010 04:20:33 +0000 (07:20 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 29 Mar 2010 04:20:33 +0000 (07:20 +0300)
- dont make assumptions about which bits can be enabled simultaneously,
  just dump 'em all

lib/formats.c

index 7f681a2..c13f46d 100644 (file)
@@ -246,23 +246,22 @@ static char * deptypeFormat(rpmtd td, char * formatPrefix)
            argvAdd(&sdeps, "postun");
        if (item & RPMSENSE_SCRIPT_VERIFY)
            argvAdd(&sdeps, "verify");
+       if (item & RPMSENSE_INTERP)
+           argvAdd(&sdeps, "interp");
+       if (item & RPMSENSE_RPMLIB)
+           argvAdd(&sdeps, "rpmlib");
+       if ((item & RPMSENSE_FIND_REQUIRES) || (item & RPMSENSE_FIND_PROVIDES))
+           argvAdd(&sdeps, "auto");
+       if (item & RPMSENSE_PREREQ)
+           argvAdd(&sdeps, "prereq");
 
        if (sdeps) {
            val = argvJoin(sdeps, ",");
-           argvFree(sdeps);
        } else {
-           if (item & RPMSENSE_RPMLIB)
-               val = xstrdup("rpmlib");
-           else if (item & RPMSENSE_INTERP)
-               val = xstrdup("interp");
-           else if ((item & RPMSENSE_FIND_REQUIRES) || 
-                    (item & RPMSENSE_FIND_PROVIDES))
-               val = xstrdup("auto");
-           else if (item & RPMSENSE_PREREQ)
-               val = xstrdup("prereq");
-           else
-               val = xstrdup("manual");
+           val = xstrdup("manual");
        }
+
+       argvFree(sdeps);
     }
     return val;
 }