scripts: remove migrated dumpinfo.pl script
authorPaul Spooren <mail@aparcar.org>
Sat, 9 Jan 2021 21:24:15 +0000 (11:24 -1000)
committerPetr Štetiar <ynezz@true.cz>
Tue, 2 Mar 2021 11:47:11 +0000 (12:47 +0100)
The script was moved over to openwrt.git and is called
`dump-target-info.pl`

Signed-off-by: Paul Spooren <mail@aparcar.org>
[fixed script path in the master build script]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
phase1/master.cfg
phase2/master.cfg
scripts/dumpinfo.pl [deleted file]

index 2cba85ee86850b53e1954fe709ea98e0190c2f2a..49ce32f6a4a83d602effe89fd961d21a24a89e6f 100644 (file)
@@ -207,7 +207,7 @@ if not os.path.isdir(work_dir+'/source.git'):
 else:
        subprocess.call(["git", "pull"], cwd = work_dir+'/source.git')
 
-findtargets = subprocess.Popen([scripts_dir + '/dumpinfo.pl', 'targets'],
+findtargets = subprocess.Popen(['./scripts/dump-target-info.pl', 'targets'],
        stdout = subprocess.PIPE, cwd = work_dir+'/source.git')
 
 while True:
index d9ea18f2954799f04fb6c624c3fe55271cdeb7fe..58c5e5795dfe069e31364735a6213fa6b1b2ad16 100644 (file)
@@ -163,7 +163,7 @@ if not os.path.isdir(work_dir+'/source.git'):
 else:
        subprocess.call(["git", "pull"], cwd = work_dir+'/source.git')
 
-findarches = subprocess.Popen([scripts_dir + '/dumpinfo.pl', 'architectures'],
+findarches = subprocess.Popen(['./scripts/dump-target-info.pl', 'architectures'],
        stdout = subprocess.PIPE, cwd = work_dir+'/source.git')
 
 while True:
diff --git a/scripts/dumpinfo.pl b/scripts/dumpinfo.pl
deleted file mode 100755 (executable)
index aa97f8d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use Cwd;
-
-my (%targets, %architectures);
-
-$ENV{'TOPDIR'} = Cwd::getcwd();
-
-
-sub parse_targetinfo {
-       my ($target_dir, $subtarget) = @_;
-
-       if (open M, "make -C '$target_dir' --no-print-directory DUMP=1 TARGET_BUILD=1 SUBTARGET='$subtarget' |") {
-               my ($target_name, $target_arch, @target_features);
-               while (defined(my $line = readline M)) {
-                       chomp $line;
-
-                       if ($line =~ /^Target: (.+)$/) {
-                               $target_name = $1;
-                       }
-                       elsif ($line =~ /^Target-Arch-Packages: (.+)$/) {
-                               $target_arch = $1;
-                       }
-                       elsif ($line =~ /^Target-Features: (.+)$/) {
-                               @target_features = split /\s+/, $1;
-                       }
-                       elsif ($line =~ /^@\@$/) {
-                               if ($target_name && $target_arch &&
-                                   !grep { $_ eq 'broken' or $_ eq 'source-only' } @target_features) {
-                                       $targets{$target_name} = $target_arch;
-                                       $architectures{$target_arch} ||= [];
-                                       push @{$architectures{$target_arch}}, $target_name;
-                               }
-
-                               undef $target_name;
-                               undef $target_arch;
-                               @target_features = ();
-                       }
-               }
-               close M;
-       }
-}
-
-sub get_targetinfo {
-       foreach my $target_makefile (glob "target/linux/*/Makefile") {
-               my ($target_dir) = $target_makefile =~ m!^(.+)/Makefile$!;
-               my @subtargets;
-
-               if (open M, "make -C '$target_dir' --no-print-directory DUMP=1 TARGET_BUILD=1 val.FEATURES V=s 2>/dev/null |") {
-                       if (defined(my $line = readline M)) {
-                               chomp $line;
-                               if (grep { $_ eq 'broken' or $_ eq 'source-only' } split /\s+/, $line) {
-                                       next;
-                               }
-                       }
-               }
-
-               if (open M, "make -C '$target_dir' --no-print-directory DUMP=1 TARGET_BUILD=1 val.SUBTARGETS V=s 2>/dev/null |") {
-                       if (defined(my $line = readline M)) {
-                               chomp $line;
-                               @subtargets = split /\s+/, $line;
-                       }
-                       close M;
-               }
-
-               push @subtargets, 'generic' if @subtargets == 0;
-
-               foreach my $subtarget (@subtargets) {
-                       parse_targetinfo($target_dir, $subtarget);
-               }
-       }
-}
-
-if (@ARGV == 1 && $ARGV[0] eq 'targets') {
-       get_targetinfo();
-       foreach my $target_name (sort keys %targets) {
-               printf "%s %s\n", $target_name, $targets{$target_name};
-       }
-}
-elsif (@ARGV == 1 && $ARGV[0] eq 'architectures') {
-       get_targetinfo();
-       foreach my $target_arch (sort keys %architectures) {
-               printf "%s %s\n", $target_arch, join ' ', @{$architectures{$target_arch}};
-       }
-}
-else {
-       print "Usage: $0 targets\n";
-       print "Usage: $0 architectures\n";
-}