[OpenWrt-Devel] [PATCH] metadata: express conflicts in a single line
Mathias Kresin
dev at kresin.me
Sat Jul 14 04:48:48 EDT 2018
12.07.2018 19:33, Mathias Kresin:
> 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 <dev at 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(" && ", at conflics);
> +
> + return "\t\tdepends on m || ($res)\n";
> }
>
> sub print_package_config_category($) {
>
Disregard this patch. I realised it's an ugly workaround which might not
work in all cases. The script/conf code need to be extended to handle
our use of "!= y" dependencies properly.
Mathias
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list