From: Panu Matilainen Date: Sat, 15 Sep 2012 09:14:43 +0000 (+0300) Subject: Be more selective about legacy retrofits on package read X-Git-Tag: tznext/4.11.0.1.tizen20130304~251 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57f9d42a0eb380d93dfe8efeb52f366e754ad0c9;p=tools%2Flibrpm-tizen.git Be more selective about legacy retrofits on package read - Missing RPMTAG_DIRNAME can mean either a package with uncompressed filenames OR a new package with no files, in which case the retrofits should not be performed. Also a newer package can be built with --nodirtokens, requiring filelist compression but no other retrofits. - Test for immutable region presence for more accurate v3 package detection, if not present do a full retrofit. For others, explicitly test for OLDFILENAMES presence and only compress the filelist if needed.e --- diff --git a/lib/package.c b/lib/package.c index ce1c71e..6fb95a6 100644 --- a/lib/package.c +++ b/lib/package.c @@ -680,12 +680,15 @@ exit: headerPutString(h, RPMTAG_SOURCERPM, "(none)"); } /* - * Convert legacy headers on the fly. Not having "new" style compressed - * filenames is close enough estimate for legacy indication... + * Convert legacy headers on the fly. Not having immutable region + * equals a truly ancient package, do full retrofit. OTOH newer + * packages might have been built with --nodirtokens, test and handle + * the non-compressed filelist case separately. */ - if (!headerIsEntry(h, RPMTAG_DIRNAMES)) { + if (!headerIsEntry(h, RPMTAG_HEADERIMMUTABLE)) headerConvert(h, HEADERCONV_RETROFIT_V3); - } + else if (headerIsEntry(h, RPMTAG_OLDFILENAMES)) + headerConvert(h, HEADERCONV_COMPRESSFILELIST); /* Append (and remap) signature tags to the metadata. */ headerMergeLegacySigs(h, sigh);