Only do legacy retrofitting on packages that need it.
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 7 Nov 2007 11:12:20 +0000 (13:12 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 7 Nov 2007 11:12:20 +0000 (13:12 +0200)
Packages not having RPMTAG_DIRNAMES (ie compressed filenames) is
used for checking, packages not having it are either built with rpm <= 3.x
or with --nodirtokens, retrofitting in the latter case doesn't really
hurt that much for the obscure case...

lib/package.c

index 7764683..6fbc9e1 100644 (file)
@@ -966,8 +966,13 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
 
 exit:
     if (rc != RPMRC_FAIL && h != NULL && hdrp != NULL) {
-       /* Convert legacy headers on the fly ... */
-       legacyRetrofit(h, l);
+       /* 
+         * Convert legacy headers on the fly. Not having "new" style compressed
+         * filenames is close enough estimate for legacy indication... 
+         */
+       if (!headerIsEntry(h, RPMTAG_DIRNAMES)) {
+           legacyRetrofit(h, l);
+       }
        
        /* Append (and remap) signature tags to the metadata. */
        headerMergeLegacySigs(h, sigh);