From Bugzilla Helper: User-Agent: Mozilla/5.0 (compatible;MSIE 5.5; Windows 98) Description of problem: I know its a nit-picky little thing, but RPMs built on RedHat 9 (I haven't checked older versions yet) report incorrect sizes depending on how files are packaged in the %files section of the spec. In particular, file sizes are added to the Size variable in these cases when it shouldn't be : * A file is listed twice in the same %files section, usually because a wildcard caught it once then it is listed explicity (the file size is added twice in this case). It is reported by RPM as being there twice, just not handled properly. * A file is excluded via %exclude, its size is still added, although the file is not And finally, file sizes are NOT added to the Size variable for symbolic links... I can see how the first two are "well write your spec files properly you idiot and it will work fine", and I agree, I've fixed those, but the latter looks like it should be fixed, not a big deal, but for accuracy's sake. The following script will take an RPM as an argument and report on the sum of the sizes listed in the file list and the size listed in the Size variable in the RPM and put a * beside the result if they don't match. #!/bin/sh file=$1 realsize=`rpm -qlvp $file | awk '{s+=$5} END {print s}'`; reportedsize=`rpm -qp --queryformat "%{size}" $file`; if [ "$realsize" != "$reportedsize" ]; then printf "* " else printf " " fi printf "%10s %10s %s\n" $realsize $reportedsize $file; exit 0 Version-Release number of selected component (if applicable): rpm-build-4.2-0.69 How reproducible: Always Steps to Reproduce: 1.Add an %exclude to a SPEC file and build it 2.Include links in the %files section of a SPEC file 3.List a file twice in a SPEC file Actual Results: In each case, the size reported by rpm -qi on the RPM was different from the actual size of adding up the included files. Expected Results: The size of the RPM should be exactly the sum of the sizes of the included files. Additional info:
I can confirm that when using %exclude that the size is calculated incorrectly. As a matter of fact, I have reason to believe that when something is %exclude'd (at least in some cases), it's size is counted *twice*. In my case, I have a package that contains %doc %{_docdir}/* %exclude %{_docdir}/foo Where %{_docdir}/foo is approximately 75-80MB in size. The package's size is then reported to be approximately ~150MB too big.
Created attachment 117239 [details] Proposed patch Untested but this should not add %excludes to RPMTAG_SIZE
Patch added in rpm-4.4.4.