[Rpm-maint] [rpm-software-management/rpm] Issue %patchN deprecation warning just once (PR #2388)

Panu Matilainen notifications at github.com
Wed Feb 22 14:14:07 UTC 2023


@pmatilai commented on this pull request.



> @@ -450,6 +448,20 @@ int parsePrep(rpmSpec spec)
     }
 
 exit:
+    /* Issue a warning for deprecated %patchN usage */
+    int num = spec->numConverted;
+    if (num) {
+	const char *msg =
+	    _("%%patchN is deprecated, use %%patch N (or %%patch -P N)\n");
+	rpmlog(RPMLOG_WARNING, msg);
+	/* Issue one additional warning for any remaining conversions */
+	if (num == 2)
+	    rpmlog(RPMLOG_WARNING, msg);
+	if (num > 2)
+	    rpmlog(RPMLOG_WARNING,
+		   _("--- Last warning suppressed %i times ---\n"), num - 1);

Oh, I would've just condensed it into one "patchN deprecated (repeated X times)" message. This is pretty fancy handling for just one message :smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2388#pullrequestreview-1309328444
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2388/review/1309328444 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230222/594ae4ed/attachment.html>


More information about the Rpm-maint mailing list