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

Michal Domonkos notifications at github.com
Wed Feb 22 14:42:24 UTC 2023


@dmnks 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);

OK, true :smile: This is basically the format of the general rpmlog-native solution that I've started separately, but for now (or for this particular message), it's indeed too elaborate. I'll push a simplified version later today/tomorrow. Thanks!

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

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


More information about the Rpm-maint mailing list