commit da3376844c7153a74fbc95faa71d7367b82f77d0
Author: Jan Palus <[email protected]>
Date:   Fri Feb 12 19:18:12 2021 +0100

    avoid autodep pattern '()' on empty input
    
    matches everything otherwise and results in no autoreqs/autodeps
    whatsoever

 macros.pld | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/macros.pld b/macros.pld
index b267976..7292648 100644
--- a/macros.pld
+++ b/macros.pld
@@ -1153,15 +1153,17 @@ fi; \
        RS = "\n([ \t]+\n)+";
        FS = " ";
        split(x, F);
-       printf("(");
-       for (i=1; i<=length(F); i++) {
-               s = F[i];
-               sub(/#.*/, "z&z", s);
-               if (s ~ /^$/) { continue; };
-               printf(s);
-               if (i != length(F)) { printf("|"); };
-       };
-       printf(")");
+       if (length(F) > 0) {
+               printf("(");
+               for (i=1; i<=length(F); i++) {
+                       s = F[i];
+                       sub(/#.*/, "z&z", s);
+                       if (s ~ /^$/) { continue; };
+                       printf(s);
+                       if (i != length(F)) { printf("|"); };
+               };
+               printf(")");
+       }
 }')
 %__requires_exclude_from       %{__noautodep_helper %{__noautoreqfiles}}
 %__provides_exclude_from       %{__noautodep_helper %{__noautoprovfiles}}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-pld-macros.git/commitdiff/da3376844c7153a74fbc95faa71d7367b82f77d0

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to