build: add support for declaring package CONFLICTS which only affect selecting built...
authorFelix Fietkau <nbd@openwrt.org>
Sun, 5 Oct 2014 16:41:33 +0000 (16:41 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 5 Oct 2014 16:41:33 +0000 (16:41 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 42770

include/package-defaults.mk
include/package-dumpinfo.mk
scripts/metadata.pl
scripts/metadata.pm

index 19f2a16045ec7ccb0c950297f9f44d0c6fb5b2ab..6a345b6fb9eb1001d7f4d57e5d3d19a5a393e25d 100644 (file)
@@ -19,6 +19,7 @@ define Package/Default
   CATEGORY:=Extra packages
   DEPENDS:=
   MDEPENDS:=
+  CONFLICTS:=
   PROVIDES:=
   EXTRA_DEPENDS:=
   MAINTAINER:=$(PKG_MAINTAINER)
index 5d1d76fee5730e63ad298db175e7be7ea82dccd8..26c8d3199dffd20b0928a8b92773ca1e25360aa9 100644 (file)
@@ -31,6 +31,7 @@ $(if $(MENU),Menu: $(MENU)
 )$(if $(findstring $(PREREQ_CHECK),1),Prereq-Check: 1
 )Version: $(VERSION)
 Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
+Conflicts: $(CONFLICTS)
 Menu-Depends: $(MDEPENDS)
 Provides: $(PROVIDES)
 $(if $(VARIANT),Build-Variant: $(VARIANT)
index 4014613de60e3a42711d314971c1b6f0118f6445..366e61cb63030843a9cd3a6f7e10a8cfe036a4ad 100755 (executable)
@@ -522,6 +522,18 @@ sub mconf_depends {
        return $res;
 }
 
+sub mconf_conflicts {
+       my $pkgname = shift;
+       my $depends = shift;
+       my $res = "";
+
+       foreach my $depend (@$depends) {
+               next unless $package{$depend};
+               $res .= "\t\tdepends on m || (PACKAGE_$depend != y)\n";
+       }
+       return $res;
+}
+
 sub print_package_config_category($) {
        my $cat = shift;
        my %menus;
@@ -583,6 +595,7 @@ sub print_package_config_category($) {
                        }
                        print mconf_depends($pkg->{name}, $pkg->{depends}, 0);
                        print mconf_depends($pkg->{name}, $pkg->{mdepends}, 0);
+                       print mconf_conflicts($pkg->{name}, $pkg->{conflicts});
                        print "\t\thelp\n";
                        print $pkg->{description};
                        print "\n";
index ab5abc0363671ca93470948d9b68275d6079e8ca..16acb8ea8fb415163ddeee7838f0bc97f73dda57 100644 (file)
@@ -113,6 +113,7 @@ sub parse_package_metadata($) {
                };
                /^Menu-Depends: \s*(.+)\s*$/ and $pkg->{mdepends} = [ split /\s+/, $1 ];
                /^Depends: \s*(.+)\s*$/ and $pkg->{depends} = [ split /\s+/, $1 ];
+               /^Conflicts: \s*(.+)\s*$/ and $pkg->{conflicts} = [ split /\s+/, $1 ];
                /^Hidden: \s*(.+)\s*$/ and $pkg->{hidden} = 1;
                /^Build-Variant: \s*([\w\-]+)\s*/ and $pkg->{variant} = $1;
                /^Default-Variant: .*/ and $pkg->{variant_default} = 1;