1 --- rpm-5.4.10/build/files.c.twice_terminate~ 2012-07-10 20:18:14.613329633 +0200
2 +++ rpm-5.4.10/build/files.c 2012-07-10 20:18:14.677328833 +0200
3 @@ -1329,7 +1329,7 @@ static rpmuint32_t getDigestAlgo(Header
7 -static void genCpioListAndHeader(/*@partial@*/ FileList fl,
8 +static rpmRC genCpioListAndHeader(/*@partial@*/ FileList fl,
9 rpmfi * fip, Header h, int isSrc)
10 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
11 /*@modifies h, *fip, fl->processingFailed, fl->fileList,
12 @@ -1349,6 +1349,7 @@ static void genCpioListAndHeader(/*@part
13 rpmuint32_t dalgo = getDigestAlgo(h, isSrc);
16 + rpmRC rc = RPMRC_OK;
18 memset(buf, 0, sizeof(buf)); /* XXX valgrind on rhel6 beta pickier */
20 @@ -1377,9 +1378,14 @@ memset(buf, 0, sizeof(buf)); /* XXX valg
22 flp[1].flags |= flp->flags;
24 - if (!(flp[1].flags & RPMFILE_EXCLUDE))
25 - rpmlog(RPMLOG_WARNING, _("File listed twice: %s\n"),
26 + if (!(flp[1].flags & RPMFILE_EXCLUDE)) {
27 + int terminate = rpmExpandNumeric("%{?_files_listed_twice_terminate_build}");
29 + rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING, _("File listed twice: %s\n"),
36 if (S_ISDIR(flp->fl_mode)) {
37 @@ -1792,6 +1798,8 @@ if (_rpmbuildFlags & 4) {
46 @@ -2514,7 +2522,8 @@ static rpmRC processPackageFiles(Spec sp
47 "PartialHardlinkSets", "4.0.4-1");
49 /* XXX should tags be added if filelist is empty? */
50 - genCpioListAndHeader(&fl, &pkg->fi, pkg->header, 0);
51 + if (genCpioListAndHeader(&fl, &pkg->fi, pkg->header, 0) != RPMRC_OK)
52 + fl.processingFailed = 1;
55 timeCheck(spec->timeCheck, pkg->header);
56 @@ -2828,7 +2837,7 @@ int processSourceFiles(Spec spec)
58 /* XXX should tags be added if filelist is empty? */
60 - genCpioListAndHeader(&fl, &spec->fi, spec->sourceHeader, 1);
61 + rc = genCpioListAndHeader(&fl, &spec->fi, spec->sourceHeader, 1);
64 *sfp = rpmiobFree(*sfp);
65 --- rpm-5.4.10/macros/mandriva.in.twice_terminate~ 2012-07-10 20:18:14.000000000 +0200
66 +++ rpm-5.4.10/macros/mandriva.in 2012-07-10 20:18:32.060111516 +0200
67 @@ -128,6 +128,7 @@ end\
69 %_duplicate_files_terminate_build 1
70 %_unpackaged_subdirs_terminate_build 0
71 +%_files_listed_twice_terminate_build 1
73 %_build_pkgcheck_set /usr/bin/rpmlint -T -f %{_sourcedir}/%{name}.rpmlintrc
74 %_build_pkgcheck_srpm /usr/bin/rpmlint -T -f %{_sourcedir}/%{name}.rpmlintrc