From a859ccb1809e6514a9e0119f1cb6be2862237680 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jan 2023 15:36:33 +0000 Subject: [PATCH] stdlib: Fix detection of already build package when rpmautospec Fixes: commit dc1c16833922b20e6949058a3813a595bb89194b --- stdlib/fedora.gl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stdlib/fedora.gl b/stdlib/fedora.gl index 5dca4d9..ef515c6 100644 --- a/stdlib/fedora.gl +++ b/stdlib/fedora.gl @@ -56,9 +56,14 @@ predicate is-koji-built (pkg) = { if [ %pkg = "$p" ]; then exit 0; fi done - # If the specfile doesn't have the magic string then the - # package definitely needs to be rebuilt. - grep -sq %fedora-rebuild-name $specfile || exit 99 + if ! grep -sq "^%%autochangelog" $specfile; then + # If the specfile doesn't have the magic string then the + # package definitely needs to be rebuilt. + grep -sq %fedora-rebuild-name $specfile || exit 99 + else + # Using autochangelog. + git log | grep -sq %fedora-rebuild-name || exit 99 + fi # Else we must check Koji itself. # Koji sends some messages to stderr. -- 1.8.3.1