1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 21:34:04 +02:00

add PROVIDES option, currently only used for menuconfig

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5194 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2006-10-17 19:01:08 +00:00
parent 2c5be9bc38
commit 15230af45d
3 changed files with 31 additions and 7 deletions

View File

@ -78,6 +78,7 @@ define Package/Default
SECTION:=opt SECTION:=opt
CATEGORY:=Extra packages CATEGORY:=Extra packages
DEPENDS:= DEPENDS:=
PROVIDES:=
EXTRA_DEPENDS:= EXTRA_DEPENDS:=
MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org> MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd}) SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
@ -177,6 +178,7 @@ define BuildPackage
if [ "$$$$PREREQ_CHECK" = 1 ]; then echo "Prereq-Check: 1"; fi; \ if [ "$$$$PREREQ_CHECK" = 1 ]; then echo "Prereq-Check: 1"; fi; \
echo "Version: $(VERSION)"; \ echo "Version: $(VERSION)"; \
echo "Depends: $$(IDEPEND_$(1))"; \ echo "Depends: $$(IDEPEND_$(1))"; \
echo "Provides: $(PROVIDES)"; \
echo "Build-Depends: $(PKG_BUILDDEP)"; \ echo "Build-Depends: $(PKG_BUILDDEP)"; \
echo "Category: $(CATEGORY)"; \ echo "Category: $(CATEGORY)"; \
echo "Title: $(TITLE)"; \ echo "Title: $(TITLE)"; \

View File

@ -34,6 +34,12 @@ while ($line = <>) {
defined $pkg{$name} or $pkg{$name} = {}; defined $pkg{$name} or $pkg{$name} = {};
$pkg{$name}->{src} = $src; $pkg{$name}->{src} = $src;
}; };
$line =~ /^Provides: \s*(.+)\s*$/ and do {
foreach my $vpkg (split /\s+/, $1) {
defined $pkg{$vpkg} or $pkg{$vpkg} = {};
$pkg{$vpkg}->{virtual} = 1;
}
};
$line =~ /^Prereq-Check:/ and !defined $prereq{$src} and do { $line =~ /^Prereq-Check:/ and !defined $prereq{$src} and do {
$pkg{$name}->{prereq} = 1; $pkg{$name}->{prereq} = 1;
}; };
@ -52,6 +58,7 @@ $line="";
foreach $name (sort {uc($a) cmp uc($b)} keys %pkg) { foreach $name (sort {uc($a) cmp uc($b)} keys %pkg) {
my $config; my $config;
next if defined $pkg{$name}->{virtual};
if ($options{SDK}) { if ($options{SDK}) {
$conf{$pkg{$name}->{src}} or do { $conf{$pkg{$name}->{src}} or do {
$config = 'm'; $config = 'm';
@ -69,6 +76,7 @@ foreach $name (sort {uc($a) cmp uc($b)} keys %pkg) {
my $depline = ""; my $depline = "";
foreach my $dep (@{$pkg{$name}->{depends}}) { foreach my $dep (@{$pkg{$name}->{depends}}) {
my $idx; my $idx;
next if defined $pkg{$dep}->{virtual};
if (defined $pkg{$dep}->{src}) { if (defined $pkg{$dep}->{src}) {
($pkg{$name}->{src} ne $pkg{$dep}->{src}) and $idx = $pkg{$dep}->{src}; ($pkg{$name}->{src} ne $pkg{$dep}->{src}) and $idx = $pkg{$dep}->{src};
} elsif (defined($pkg{$dep}) && !$options{SDK}) { } elsif (defined($pkg{$dep}) && !$options{SDK}) {

View File

@ -30,9 +30,10 @@ sub close_submenu {
sub find_dep($$) { sub find_dep($$) {
my $pkg = shift; my $pkg = shift;
my $name = shift; my $name = shift;
my $deps = ($pkg->{vdepends} or $pkg->{depends});
return 0 unless defined $pkg->{depends}; return 0 unless defined $deps;
foreach my $dep (@{$pkg->{depends}}) { foreach my $dep (@{$deps}) {
return 1 if $dep eq $name; return 1 if $dep eq $name;
return 1 if ($package{$dep} and (find_dep($package{$dep},$name) == 1)); return 1 if ($package{$dep} and (find_dep($package{$dep},$name) == 1));
} }
@ -49,7 +50,7 @@ sub depends($$) {
} elsif (find_dep($b, $a->{name}) == 1) { } elsif (find_dep($b, $a->{name}) == 1) {
$ret = -1; $ret = -1;
} else { } else {
$ret = 0; return 0;
} }
# print STDERR "depends($a->{name}, $b->{name}) == $ret\n"; # print STDERR "depends($a->{name}, $b->{name}) == $ret\n";
return $ret; return $ret;
@ -93,8 +94,14 @@ sub print_category($) {
my $m = "depends"; my $m = "depends";
$depend =~ s/^([@\+]+)//; $depend =~ s/^([@\+]+)//;
my $flags = $1; my $flags = $1;
my $vdep;
if ($vdep = $package{$depend}->{vdepends}) {
$depend = join("||", map { "PACKAGE_".$_ } @$vdep);
} else {
$flags =~ /@/ or $depend = "PACKAGE_$depend"; $flags =~ /@/ or $depend = "PACKAGE_$depend";
$flags =~ /\+/ and $m = "select"; $flags =~ /\+/ and $m = "select";
}
print "\t\t$m $depend\n"; print "\t\t$m $depend\n";
} }
print "\t\thelp\n"; print "\t\thelp\n";
@ -132,6 +139,13 @@ while ($line = <>) {
$line =~ /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1; $line =~ /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1;
$line =~ /^Submenu-Depends: \s*(.+)\s*$/ and $pkg->{submenudep} = $1; $line =~ /^Submenu-Depends: \s*(.+)\s*$/ and $pkg->{submenudep} = $1;
$line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
$line =~ /^Provides: \s*(.+)\s*$/ and do {
my @vpkg = split /\s+/, $1;
foreach my $vpkg (@vpkg) {
$package{$vpkg} or $package{$vpkg} = { vdepends => [] };
push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
}
};
$line =~ /^Depends: \s*(.+)\s*$/ and do { $line =~ /^Depends: \s*(.+)\s*$/ and do {
my @dep = split /\s+/, $1; my @dep = split /\s+/, $1;
$pkg->{depends} = \@dep; $pkg->{depends} = \@dep;