]> git.pld-linux.org Git - packages/rpm-pld-macros.git/commitdiff
avoid autodep pattern '()' on empty input
authorJan Palus <atler@pld-linux.org>
Fri, 12 Feb 2021 18:18:12 +0000 (19:18 +0100)
committerJan Palus <atler@pld-linux.org>
Fri, 12 Feb 2021 18:18:12 +0000 (19:18 +0100)
matches everything otherwise and results in no autoreqs/autodeps
whatsoever

macros.pld

index b2679764165b155e944bf03c941533aac13df8b6..7292648522cc73bcc1b997fc033249ee87cd8a51 100644 (file)
@@ -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}}
This page took 0.537764 seconds and 4 git commands to generate.