#!/usr/bin/perl # Script to return pairs of filter id's for different cross compilers # for a given patch, against its base applies tree. use strict; use LWP::Simple; use vars qw($VERSION); $VERSION = '1.00'; our $opt_debug = 1; our $opt_patchinfo_url = "http://plm.testing.osdl.org/patches/show"; exit main(); sub main { my $id = shift @ARGV; print "Patch: PLM-$id\n"; if (! -e "./plmdiff") { die "Error: program plmdiff must be in current directory\n"; } # Retrieve the patchinfo page for the patch my $patchinfo_1 = get("$opt_patchinfo_url/$id") or die "Couldn't get Patchinfo page for patch id '$id'!\n"; my %Results; my $base_id = "none"; foreach my $line (split "?tr", $patchinfo_1) { if ($line =~ m|Applies Tree:|) { if ($line =~ m|/show/([\w-\s._-]+)|) { $base_id = $1; print "Baseline: PLM-$base_id\n"; } } if ($line =~ m|/output/|) { my %filt = parse_row($line); $Results{$filt{'name'}}->{$id} = \%filt; } } if ($base_id =~ "none") { print "Error: baseline patch (Nothing to diff against)\n"; exit 1; } my $patchinfo_2 = get("$opt_patchinfo_url/$base_id") or die "Couldn't get Patchinfo page for patch id '$base_id'!\n"; foreach my $line (split "?tr", $patchinfo_2) { if ($line =~ m|/output/|) { my %filt = parse_row($line); $Results{$filt{'name'}}->{$base_id} = \%filt; } } # Now do a diff between each filter in $patchinfo_1 and $patchinfo_2 print crosscompile_report(\%Results, $base_id, $id); } # Parses a row of data and returns a hash containing the data items sub parse_row { my $text = shift; $text =~ m|