Use type-specific headerPut() on all of build/parseSpec.c
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 19 Jun 2008 12:45:37 +0000 (15:45 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 19 Jun 2008 12:45:37 +0000 (15:45 +0300)
build/parseSpec.c

index 0360a0f..833eae0 100644 (file)
@@ -589,7 +589,6 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootDir,
     char *os = rpmExpand("%{_target_os}", NULL);
 
     for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
-       struct rpmtd_s td;
        if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
            const char * name;
            (void) headerNVR(pkg->header, &name, NULL, NULL);
@@ -597,17 +596,9 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootDir,
            goto errxit;
        }
 
-       if (rpmtdFromString(&td, RPMTAG_OS, os))
-           headerPut(pkg->header, &td, HEADERPUT_DEFAULT);
-       assert(rpmtdType(&td) == RPM_STRING_TYPE);
-
-       if (rpmtdFromString(&td, RPMTAG_ARCH, arch))
-           headerPut(pkg->header, &td, HEADERPUT_DEFAULT);
-       assert(rpmtdType(&td) == RPM_STRING_TYPE);
-
-       if (rpmtdFromString(&td, RPMTAG_PLATFORM, platform))
-           headerPut(pkg->header, &td, HEADERPUT_DEFAULT);
-       assert(rpmtdType(&td) == RPM_STRING_TYPE);
+       headerPutString(pkg->header, RPMTAG_OS, os);
+       headerPutString(pkg->header, RPMTAG_ARCH, arch);
+       headerPutString(pkg->header, RPMTAG_PLATFORM, platform);
 
        pkg->ds = rpmdsThis(pkg->header, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL);