@pmatilai commented on this pull request.


> @@ -80,6 +94,33 @@ static int doShell(rpmSpec spec)
 }
 #endif
 
+static int printSpecAddresses(rpmSpec spec, bool printPatches)
+{
+    SpecSrcIter iter(rpmSpecSrcIterInit(spec));
+    if (!iter) return 1;
+    rpmSpecSrc src;
+    while ((src = rpmSpecSrcIterNext(iter.get())) != NULL) 
+    {
+        bool isPatch = (rpmSpecSrcFlags(src) & RPMBUILD_ISPATCH) != 0;
+
+        if (isPatch == printPatches){

I'd just pass a rpmSourceFlag "what" argument instead of the boolean 
printPatches as the second argument to this function, and then this becomes 
just `if (rpmSpecSrcFlags(src) & what))` without having to test against patch 
specifically - less code, more generic.

I think that'd allow handling icons (a third, but near extinct form of 
source-like entities) and filtering nosource/nopatch items as well - but never 
mind these now, they're out of scope for this PR.

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

Message ID: <rpm-software-management/rpm/pull/4262/review/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to