@@ -, +, @@ --- build/files.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- a/build/files.c +++ a/build/files.c @@ -1151,7 +1151,19 @@ static void genCpioListAndHeader(Spec spec, /*@partial@*/ FileList fl, } if (sizeof(flp->fl_ino) != sizeof(uint_32)) { - uint_32 ino = (uint_32)flp->fl_ino; + uint_32 ino; + if (flp->fl_mode & S_IFMT != S_IFREG || flp->fl_nlink == 1 || i == 0) + ino = (uint_32)i; + else { + FileListRec tmp; + for (int j = 0; j <= i; j++) { + tmp = fl->fileList + j; + if (flp->fl_ino == tmp->fl_ino) { + ino = (uint_32)j; + break; + } + } + } (void) headerAddOrAppendEntry(h, RPMTAG_FILEINODES, RPM_INT32_TYPE, &(ino), 1); } else { --