Due to the use of dependencies to express conflicts, a package which
conflicts with multiple other packages (variants) is indented one level
for each conflict:

< > pkg-variant-a
< >   pkg-variant-b (conflicts pkg-variant-a)
< >     pkg-variant-c (conflicts pkg-variant-a && pkg-variant-b)

Express conflicts in a single line by using the logical AND operator to
fix the visual glitch.

Signed-off-by: Mathias Kresin <d...@kresin.me>
---
 scripts/package-metadata.pl | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 53bb45a..3e5d8f7 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -243,12 +243,20 @@ sub mconf_conflicts {
        my $pkgname = shift;
        my $depends = shift;
        my $res = "";
+       my @conflics;
 
        foreach my $depend (@$depends) {
                next unless $package{$depend};
-               $res .= "\t\tdepends on m || (PACKAGE_$depend != y)\n";
+               push @conflics, "PACKAGE_$depend != y";
        }
-       return $res;
+
+       if (!@conflics) {
+               return $res;
+       }
+
+       $res = join(" && ",@conflics);
+
+       return "\t\tdepends on m || ($res)\n";
 }
 
 sub print_package_config_category($) {
-- 
2.7.4


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to