Parse BuildRequires: and add appropriate RPMTAG_*REQUIRES* to src rpm
authorjbj <devnull@localhost>
Tue, 26 Jan 1999 21:57:57 +0000 (21:57 +0000)
committerjbj <devnull@localhost>
Tue, 26 Jan 1999 21:57:57 +0000 (21:57 +0000)
header.

CVS patchset: 2763
CVS date: 1999/01/26 21:57:57

Makefile.am
build/files.c
build/pack.c
build/parsePreamble.c
build/parseReqs.c
build/parseScript.c
build/reqprov.c
build/rpmbuild.h
lib/rpmlib.h
po/rpm.pot

index eb63abe..69e42c0 100644 (file)
@@ -92,7 +92,7 @@ noconfig:
 
 .PHONY: archive
 archive: 
-       @cvs -d `cat CVS/Root` diff >& /dev/null || { \
+       @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
            echo " " ; \
            echo "==> Please resolve differences between the repository and" ; \
            echo "==> your rpm check out before tagging." ; \
index 0553e4b..d44137c 100644 (file)
@@ -1529,7 +1529,7 @@ static int generateAutoReqProv(Spec spec, Package pkg,
        freeStringBuf(readBuf);
        for (f = fsave; *f != NULL; f++) {
            if (**f) {
-               addReqProv(spec, pkg, RPMSENSE_PROVIDES, *f, NULL, 0);
+               addReqProv(spec, pkg->header, RPMSENSE_PROVIDES, *f, NULL, 0);
            }
        }
        freeSplitString(fsave);
@@ -1555,7 +1555,7 @@ static int generateAutoReqProv(Spec spec, Package pkg,
        freeStringBuf(readBuf);
        for (f = fsave; *f != NULL; f++) {
            if (**f) {
-               addReqProv(spec, pkg, RPMSENSE_ANY, *f, NULL, 0);
+               addReqProv(spec, pkg->header, RPMSENSE_ANY, *f, NULL, 0);
            }
        }
        freeSplitString(fsave);
index 5b49a7e..8274db1 100644 (file)
@@ -44,7 +44,7 @@ int packageSources(Spec spec)
 {
     CSA_t csabuf, *csa = &csabuf;
     HeaderIterator iter;
-    int_32 tag, count;
+    int_32 tag, type, count;
     char **ptr;
     int rc;
 
@@ -65,10 +65,10 @@ int packageSources(Spec spec)
 
     /* Add the build restrictions */
     iter = headerInitIterator(spec->buildRestrictions);
-    while (headerNextIterator(iter, &tag, NULL, (void **)&ptr, &count)) {
-       headerAddEntry(spec->sourceHeader, tag,
-                      RPM_STRING_ARRAY_TYPE, ptr, count);
-       FREE(ptr);
+    while (headerNextIterator(iter, &tag, &type, (void **)&ptr, &count)) {
+       headerAddEntry(spec->sourceHeader, tag, type, ptr, count);
+       if (type == RPM_STRING_ARRAY_TYPE || type == RPM_I18NSTRING_TYPE)
+           FREE(ptr);
     }
     headerFreeIterator(iter);
     if (spec->buildArchitectureCount) {
index 0d463ba..62d4562 100644 (file)
@@ -478,6 +478,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
            return rc;
        }
        break;
+      case RPMTAG_BUILDREQUIRES:
       case RPMTAG_REQUIREFLAGS:
       case RPMTAG_CONFLICTFLAGS:
       case RPMTAG_PREREQ:
@@ -562,6 +563,7 @@ static struct PreambleRec {
     {RPMTAG_BUILDROOT,         0, 0, "buildroot"},
     {RPMTAG_BUILDARCHS,                0, 0, "buildarchitectures"},
     {RPMTAG_BUILDARCHS,                0, 0, "buildarch"},
+    {RPMTAG_BUILDREQUIRES,     0, 0, "buildrequires"},
     {RPMTAG_AUTOREQPROV,       0, 0, "autoreqprov"},
     {RPMTAG_AUTOREQ,           0, 0, "autoreq"},
     {RPMTAG_AUTOPROV,          0, 0, "autoprov"},
index 1aebb41..9a31fe3 100644 (file)
@@ -96,8 +96,9 @@ int parseRequiresConflicts(Spec spec, Package pkg, char *field,
            return RPMERR_BADSPEC;
        }
 
-       addReqProv(spec, pkg, flags, req,
-                  (flags & RPMSENSE_SENSEMASK) ? version : NULL, index);
+       addReqProv(spec,
+           (tag == RPMTAG_BUILDREQUIRES ? spec->buildRestrictions : pkg->header),
+           flags, req, (flags & RPMSENSE_SENSEMASK) ? version : NULL, index);
 
        /* If there is no sense, we just read the next token */
        req = (flags & RPMSENSE_SENSEMASK) ? NULL : version;
@@ -141,7 +142,7 @@ int parseProvidesObsoletes(Spec spec, Package pkg, char *field, int tag)
                     spec->line);
            return RPMERR_BADSPEC;
        }
-       addReqProv(spec, pkg, flags, prov, NULL, 0);
+       addReqProv(spec, pkg->header, flags, prov, NULL, 0);
        line = NULL;
     }
 
index 5c4dd67..03670d4 100644 (file)
@@ -206,7 +206,7 @@ int parseScript(Spec spec, int parsePart)
     stripTrailingBlanksStringBuf(sb);
     p = getStringBuf(sb);
 
-    addReqProv(spec, pkg, RPMSENSE_PREREQ, prog, NULL, 0);
+    addReqProv(spec, pkg->header, RPMSENSE_PREREQ, prog, NULL, 0);
 
     /* Trigger script insertion is always delayed in order to */
     /* get the index right.                                   */
index 3ed4ad4..fc1012f 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "rpmbuild.h"
 
-int addReqProv(Spec spec, Package pkg,
+int addReqProv(Spec spec, Header h,
               int flag, const char *name, const char *version, int index)
 {
     const char **names;
@@ -48,14 +48,14 @@ int addReqProv(Spec spec, Package pkg,
        version = "";
     }
     
-    if (headerGetEntry(pkg->header, nametag, NULL, (void *) &names, &len)) {
+    if (headerGetEntry(h, nametag, NULL, (void *) &names, &len)) {
        if (flagtag) {
-           headerGetEntry(pkg->header, versiontag, NULL,
+           headerGetEntry(h, versiontag, NULL,
                           (void *) &versions, NULL);
-           headerGetEntry(pkg->header, flagtag, NULL, (void *) &flags, NULL);
+           headerGetEntry(h, flagtag, NULL, (void *) &flags, NULL);
        }
        if (indextag) {
-           headerGetEntry(pkg->header, indextag, NULL,
+           headerGetEntry(h, indextag, NULL,
                           (void *) &indexes, NULL);
        }
        while (len) {
@@ -76,16 +76,15 @@ int addReqProv(Spec spec, Package pkg,
        FREE(versions);
     }
 
-    headerAddOrAppendEntry(pkg->header, nametag,
-                          RPM_STRING_ARRAY_TYPE, &name, 1);
+    headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &name, 1);
     if (flagtag) {
-       headerAddOrAppendEntry(pkg->header, versiontag,
+       headerAddOrAppendEntry(h, versiontag,
                               RPM_STRING_ARRAY_TYPE, &version, 1);
-       headerAddOrAppendEntry(pkg->header, flagtag,
+       headerAddOrAppendEntry(h, flagtag,
                               RPM_INT32_TYPE, &flag, 1);
     }
     if (indextag) {
-       headerAddOrAppendEntry(pkg->header, indextag,
+       headerAddOrAppendEntry(h, indextag,
                               RPM_INT32_TYPE, &index, 1);
     }
 
index a8d03ea..bbd5df6 100644 (file)
@@ -128,7 +128,7 @@ void freePackage(/*@only@*/ Package p);
 
 /* from build/reqprov.h */
 
-int addReqProv(Spec spec, Package pkg,
+int addReqProv(Spec spec, Header h,
                int flag, const char *name, const char *version, int index);
 
 /* from build/files.h */
index f2baf8e..5ad60e8 100644 (file)
@@ -130,6 +130,7 @@ extern const struct headerSprintfExtension rpmHeaderFormats[];
 #define        RPMTAG_CAPABILITY               1105
 #define        RPMTAG_SOURCEPACKAGE            1106 /* internal */
 #define        RPMTAG_ORIGFILENAMES            1107
+#define        RPMTAG_BUILDREQUIRES            1108 /* internal */
 
 #define        RPMTAG_EXTERNAL_TAG             1000000
 
index bef4cf8..698fbaa 100644 (file)
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-01-26 12:34-0500\n"
+"POT-Creation-Date: 1999-01-26 16:30-0500\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"
@@ -1959,32 +1959,32 @@ msgstr ""
 msgid "line %d: Epoch/Serial field must be a number: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:499
+#: ../build/parsePreamble.c:500
 #, c-format
 msgid "line %d: Bad BuildArchitecture format: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:509
+#: ../build/parsePreamble.c:510
 #, c-format
 msgid "Internal error: Bogus tag %d"
 msgstr ""
 
-#: ../build/parsePreamble.c:653
+#: ../build/parsePreamble.c:655
 #, c-format
 msgid "Bad package specification: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:659
+#: ../build/parsePreamble.c:661
 #, c-format
 msgid "Package already exists: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:686
+#: ../build/parsePreamble.c:688
 #, c-format
 msgid "line %d: Unknown tag: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:711
+#: ../build/parsePreamble.c:713
 msgid "Spec file can't use BuildRoot"
 msgstr ""
 
@@ -2063,12 +2063,12 @@ msgstr ""
 msgid "line %d: Version required in %s: %s"
 msgstr ""
 
-#: ../build/parseReqs.c:122
+#: ../build/parseReqs.c:123
 #, c-format
 msgid "line %d: No file names in %s: %s"
 msgstr ""
 
-#: ../build/parseReqs.c:130
+#: ../build/parseReqs.c:131
 #, c-format
 msgid "line %d: %s: tokens must begin with alpha-numeric: %s"
 msgstr ""