return 0;
}
-static void printReqs(Spec spec, Package pkg)
+typedef struct {
+ const char *msg;
+ int ntag;
+ int vtag;
+ int ftag;
+ int mask;
+ int xor;
+} DepMsg_t;
+
+DepMsg_t depMsgs[] = {
+ { "Provides",
+ RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_PROVIDEFLAGS,
+ 0, -1 },
+ { "PreReq",
+ RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_REQUIREFLAGS,
+ RPMSENSE_PREREQ, 0 },
+ { "Requires",
+ -1, -1, -1, /* XXX inherit previous arrays */
+ RPMSENSE_PREREQ, RPMSENSE_PREREQ },
+ { "Conflicts",
+ RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_CONFLICTFLAGS,
+ 0, -1 },
+ { "Obsoletes",
+ RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS,
+ 0, -1 },
+ { NULL, 0, 0, 0, 0, 0 }
+};
+
+static void printDepMsg(DepMsg_t *dm, int count, const char **names,
+ const char **versions, int *flags)
{
- int startedPreReq = 0;
- int startedReq = 0;
-
- char **names;
- int x, count;
- int *flags;
-
- if (headerGetEntry(pkg->header, RPMTAG_PROVIDES,
- NULL, (void **) &names, &count)) {
- rpmMessage(RPMMESS_NORMAL, _("Provides:"));
- for (x = 0; x < count; x++) {
- rpmMessage(RPMMESS_NORMAL, " %s", names[x]);
+ int hasVersions = (versions != NULL);
+ int hasFlags = (flags != NULL);
+ int i, bingo;
+
+ bingo = 0;
+ for (i = 0; i < count; i++, names++, versions++, flags++) {
+ if (hasFlags && !((*flags & dm->mask) ^ dm->xor))
+ continue;
+ if (bingo == 0) {
+ rpmMessage(RPMMESS_NORMAL, "%s:", dm->msg);
+ bingo = 1;
}
+ rpmMessage(RPMMESS_NORMAL, " %s", *names);
+
+ if (hasVersions && !(*versions != NULL && **versions != '\0'))
+ continue;
+ if (!(hasFlags && (*flags && RPMSENSE_SENSEMASK)))
+ continue;
+
+ rpmMessage(RPMMESS_NORMAL, " ");
+ if (*flags & RPMSENSE_LESS)
+ rpmMessage(RPMMESS_NORMAL, "<");
+ if (*flags & RPMSENSE_GREATER)
+ rpmMessage(RPMMESS_NORMAL, ">");
+ if (*flags & RPMSENSE_EQUAL)
+ rpmMessage(RPMMESS_NORMAL, "=");
+
+ rpmMessage(RPMMESS_NORMAL, " %s", *versions);
+ }
+ if (bingo)
rpmMessage(RPMMESS_NORMAL, "\n");
- FREE(names);
- }
-
- if (headerGetEntry(pkg->header, RPMTAG_REQUIRENAME,
- NULL, (void **) &names, &count)) {
- headerGetEntry(pkg->header, RPMTAG_REQUIREFLAGS,
- NULL, (void **) &flags, NULL);
- for (x = 0; x < count; x++) {
- if (flags[x] & RPMSENSE_PREREQ) {
- if (! startedPreReq) {
- rpmMessage(RPMMESS_NORMAL, _("Prereqs:"));
- startedPreReq = 1;
- }
- rpmMessage(RPMMESS_NORMAL, " %s", names[x]);
- }
+}
+
+static void printDeps(Header h)
+{
+ const char **names = NULL;
+ const char **versions = NULL;
+ int *flags = NULL;
+ DepMsg_t *dm;
+ int type, count;
+
+ for (dm = depMsgs; dm->msg != NULL; dm++) {
+ switch (dm->ntag) {
+ case 0:
+ FREE(names);
+ break;
+ case -1:
+ break;
+ default:
+ FREE(names);
+ if (!headerGetEntry(h, dm->ntag, &type, (void **) &names, &count))
+ continue;
+ break;
}
- if (startedPreReq) {
- rpmMessage(RPMMESS_NORMAL, "\n");
+ switch (dm->vtag) {
+ case 0:
+ FREE(versions);
+ break;
+ case -1:
+ break;
+ default:
+ FREE(versions);
+ headerGetEntry(h, dm->vtag, NULL, (void **) &versions, NULL);
+ break;
}
- for (x = 0; x < count; x++) {
- if (! (flags[x] & RPMSENSE_PREREQ)) {
- if (! startedReq) {
- rpmMessage(RPMMESS_NORMAL, _("Requires:"));
- startedReq = 1;
- }
- rpmMessage(RPMMESS_NORMAL, " %s", names[x]);
- }
+ switch (dm->ftag) {
+ case 0:
+ flags = NULL;
+ break;
+ case -1:
+ break;
+ default:
+ headerGetEntry(h, dm->ftag, NULL, (void **) &flags, NULL);
+ break;
}
- rpmMessage(RPMMESS_NORMAL, "\n");
- FREE(names);
+ printDepMsg(dm, count, names, versions, flags);
}
+ FREE(names);
+ FREE(versions);
}
int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
}
generateAutoReqProv(spec, pkg, pkg->cpioList, pkg->cpioCount);
- printReqs(spec, pkg);
+ printDeps(pkg->header);
}
{ "=<", RPMSENSE_LESS | RPMSENSE_EQUAL},
{ "<", RPMSENSE_LESS},
+ { "==", RPMSENSE_EQUAL},
{ "=", RPMSENSE_EQUAL},
{ ">=", RPMSENSE_GREATER | RPMSENSE_EQUAL},
{ "=>", RPMSENSE_GREATER | RPMSENSE_EQUAL},
{ ">", RPMSENSE_GREATER},
-#if defined(RPMSENSE_SERIAL)
- { "<=S", RPMSENSE_LESS | RPMSENSE_EQUAL | RPMSENSE_SERIAL},
- { "=<S", RPMSENSE_LESS | RPMSENSE_EQUAL | RPMSENSE_SERIAL},
- { "<S", RPMSENSE_LESS | RPMSENSE_SERIAL},
-
- { "=S", RPMSENSE_EQUAL | RPMSENSE_SERIAL},
-
- { ">=S", RPMSENSE_GREATER | RPMSENSE_EQUAL | RPMSENSE_SERIAL},
- { "=>S", RPMSENSE_GREATER | RPMSENSE_EQUAL | RPMSENSE_SERIAL},
- { ">S", RPMSENSE_GREATER | RPMSENSE_SERIAL},
-#endif /* RPMSENSE_SERIAL */
-
{ NULL, 0 },
};
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-07-22 15:36-0400\n"
+"POT-Creation-Date: 1999-07-22 18:35-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Failed to find requires"
msgstr ""
-#: ../build/files.c:1711
-msgid "Provides:"
-msgstr ""
-
-#: ../build/files.c:1726
-msgid "Prereqs:"
-msgstr ""
-
-#: ../build/files.c:1738
-msgid "Requires:"
-msgstr ""
-
-#: ../build/files.c:1762
+#: ../build/files.c:1825
#, c-format
msgid "Processing files: %s\n"
msgstr ""
msgid "line %d: second %%prep"
msgstr ""
-#: ../build/parseReqs.c:102
+#: ../build/parseReqs.c:91
#, c-format
msgid ""
"line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s"
msgstr ""
-#: ../build/parseReqs.c:113
+#: ../build/parseReqs.c:102
#, c-format
msgid "line %d: File name not permitted: %s"
msgstr ""
-#: ../build/parseReqs.c:145
+#: ../build/parseReqs.c:134
#, c-format
msgid "line %d: Versioned file name not permitted: %s"
msgstr ""
-#: ../build/parseReqs.c:155
+#: ../build/parseReqs.c:144
#, c-format
msgid "line %d: Version not permitted: %s"
msgstr ""
-#: ../build/parseReqs.c:175
+#: ../build/parseReqs.c:164
#, c-format
msgid "line %d: Version required: %s"
msgstr ""