2021-04-06 13:22:58 +02:00
|
|
|
Index: build/parseSpec.c
|
|
|
|
===================================================================
|
|
|
|
--- build/parseSpec.c.orig
|
|
|
|
+++ build/parseSpec.c
|
|
|
|
@@ -942,7 +942,30 @@ static rpmSpec parseSpec(const char *spe
|
2019-10-02 15:28:11 +02:00
|
|
|
&(spec->buildrequires));
|
|
|
|
break;
|
|
|
|
case PART_BUILD:
|
|
|
|
- parsePart = parseSimpleScript(spec, "%build", &(spec->build));
|
|
|
|
+ if (spec->build) {
|
|
|
|
+ rpmlog(RPMLOG_ERR, _("line %d: second %s\n"), spec->lineNum, "%build");
|
|
|
|
+ parsePart = PART_ERROR;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ spec->build = newStringBuf();
|
|
|
|
+ appendLineStringBuf(spec->build,
|
2021-04-06 13:22:58 +02:00
|
|
|
+ "ref=/usr/lib/rpm\n"
|
|
|
|
+ "mints=0\n"
|
|
|
|
+ "case $(uname -m) in\n"
|
|
|
|
+ " aarch64) mints=20120610;;\n"
|
|
|
|
+ " ppc64le) mints=20130610;;\n"
|
|
|
|
+ " riscv64) mints=20160911;;\n"
|
|
|
|
+ "esac\n"
|
2019-10-02 15:28:11 +02:00
|
|
|
+ "for s in guess sub; do\n"
|
|
|
|
+ " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n"
|
|
|
|
+ " grep -q config-patches@ $c || continue\n"
|
2021-04-06 13:22:58 +02:00
|
|
|
+ " timestamp=$(sed -n \"/^timestamp=/{s///;s/[-'\\\"]//g;p;q;}\" $c)\n"
|
2021-05-21 10:58:29 +02:00
|
|
|
+ " test -n \"$timestamp\" || timestamp=0\n"
|
2021-04-06 13:22:58 +02:00
|
|
|
+ " test $timestamp -ge $mints || install -m 755 $ref/config.$s $c\n"
|
2019-10-02 15:28:11 +02:00
|
|
|
+ " done\n"
|
|
|
|
+ "done\n"
|
|
|
|
+ );
|
|
|
|
+ parsePart = parseLines(spec, STRIP_NOTHING, NULL, &(spec->build));
|
|
|
|
break;
|
|
|
|
case PART_INSTALL:
|
|
|
|
parsePart = parseSimpleScript(spec, "%install", &(spec->install));
|