[buildbot] scripts: remove migrated dumpinfo.pl script

LEDE Commits lede-commits at lists.infradead.org
Sat Mar 6 07:07:51 GMT 2021


ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/2251131545e472c142436c96f7bebdf3140ec6b9

commit 2251131545e472c142436c96f7bebdf3140ec6b9
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sat Jan 9 11:24:15 2021 -1000

    scripts: remove migrated dumpinfo.pl script
    
    The script was moved over to openwrt.git and is called
    `dump-target-info.pl`
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    [fixed script path in the master build script]
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 phase1/master.cfg   |  2 +-
 phase2/master.cfg   |  2 +-
 scripts/dumpinfo.pl | 91 -----------------------------------------------------
 3 files changed, 2 insertions(+), 93 deletions(-)

diff --git a/phase1/master.cfg b/phase1/master.cfg
index 2cba85e..49ce32f 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -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:
diff --git a/phase2/master.cfg b/phase2/master.cfg
index d9ea18f..58c5e57 100644
--- a/phase2/master.cfg
+++ b/phase2/master.cfg
@@ -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
index aa97f8d..0000000
--- a/scripts/dumpinfo.pl
+++ /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";
-}



More information about the lede-commits mailing list