Do not store digests of ghost files

when the files exist during build time.
The hash will never be used for verification anyway.

This helps making packages build more reproducibly.

(cherry picked from rpm.org commit 8cda485e1150dc6be990a7aa4496da848154cf55)
This commit is contained in:
Bernhard M. Wiedemann 2017-06-02 09:52:26 +02:00 committed by Dmitry V. Levin
parent 308bc34ea9
commit 7dba4f2bba

View File

@ -1175,7 +1175,7 @@ static void genCpioListAndHeader(Spec spec, /*@partial@*/ FileList fl,
*/
buf[0] = '\0';
if (S_ISREG(flp->fl_mode))
if (S_ISREG(flp->fl_mode) && !(flp->flags & RPMFILE_GHOST))
(void) domd5(flp->diskURL, buf, 1);
s = buf;
(void) headerAddOrAppendEntry(h, RPMTAG_FILEMD5S, RPM_STRING_ARRAY_TYPE,