build: process transitive dependencies after local dependencies
[openwrt/openwrt.git] / scripts / feeds
index 2c0baa6584245104572f3383f93eb2b8a8b0fa83..383a0d80d90bac2779e736548d960340000377fe 100755 (executable)
@@ -12,7 +12,7 @@ chdir "$FindBin::Bin/..";
 $ENV{TOPDIR}=getcwd();
 $ENV{GIT_CONFIG_PARAMETERS}="'core.autocrlf=false'";
 
-my $mk=`which gmake`;  # select the right 'make' program
+my $mk=`which gmake 2>/dev/null`;      # select the right 'make' program
 chomp($mk);            # trim trailing newline
 $mk or $mk = "make";   # default to 'make'
 
@@ -333,6 +333,15 @@ sub lookup_package($$) {
        return;
 }
 
+sub is_core_package($) {
+       my $package = shift;
+       foreach my $file ("tmp/info/.packageinfo-$package", glob("tmp/info/.packageinfo-*_$package")) {
+               next unless index($file, "tmp/info/.packageinfo-feeds_");
+               return 1 if -s $file;
+       }
+       return 0;
+}
+
 sub install_package {
        my $feed = shift;
        my $name = shift;
@@ -342,7 +351,7 @@ sub install_package {
        $feed or do {
                $installed{$name} and return 0;
                # TODO: check if it's already installed within ./package directory
-               $feed_src->{$name} or -d "./package/$name" or warn "WARNING: No feed for package '$name' found, maybe it's already part of the standard packages?\n";
+               $feed_src->{$name} or is_core_package($name) or warn "WARNING: No feed for package '$name' found, maybe it's already part of the standard packages?\n";
                return 0;
        };