Convert rpmInstall() to new headerGet()
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 26 May 2008 10:17:07 +0000 (13:17 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 26 May 2008 10:17:07 +0000 (13:17 +0300)
lib/rpminstall.c

index 2b24a1d..141cf9d 100644 (file)
@@ -398,15 +398,12 @@ restart:
        }
 
        if (eiu->relocations) {
-           const char ** paths;
-           rpmTagType pft;
-           rpm_count_t c;
-
-           if (headerGetEntry(eiu->h, RPMTAG_PREFIXES, &pft,
-                                      (rpm_data_t *) &paths, &c) && (c == 1))
-           {
-               eiu->relocations->oldPath = xstrdup(paths[0]);
-               paths = headerFreeData(paths, pft);
+           struct rpmtd_s prefixes;
+
+           headerGet(eiu->h, RPMTAG_PREFIXES, &prefixes, HEADERGET_DEFAULT);
+           if (rpmtdCount(&prefixes) == 1) {
+               eiu->relocations->oldPath = xstrdup(rpmtdGetString(&prefixes));
+               rpmtdFreeData(&prefixes);
            } else {
                const char * name;
                xx = headerNVR(eiu->h, &name, NULL, NULL);