[FFmpeg-devel] [PATCH] [FATESERVER] Support parsing version 1 headers
Timothy Gu
timothygu99 at gmail.com
Fri Apr 10 20:24:20 CEST 2015
---
Now with fate-recv change
FATE.pm | 9 +++++++--
fate-recv.sh | 13 ++++++++++---
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/FATE.pm b/FATE.pm
index 544e80f..30c220b 100644
--- a/FATE.pm
+++ b/FATE.pm
@@ -47,7 +47,7 @@ our $gitweb = "http://git.videolan.org/?p=ffmpeg.git";
sub split_header {
my @hdr = split /:/, $_[0];
$hdr[0] eq 'fate' or return undef;
- return {
+ my $parsed = {
version => $hdr[1],
date => $hdr[2],
slot => $hdr[3],
@@ -56,6 +56,11 @@ sub split_header {
errstr => $hdr[6],
comment => $hdr[7],
};
+ if ($hdr[1] eq '1') {
+ $parsed->{'comment'} = $hdr[8];
+ $parsed->{'branch'} = $hdr[7];
+ }
+ return $parsed;
}
sub split_config {
@@ -132,7 +137,7 @@ sub load_report {
my $hdr = split_header scalar <R> or return;
my $conf = split_config scalar <R> or return;
- $$hdr{version} eq '0' or return undef;
+ $$hdr{version} eq '0' or $$hdr{version} eq '1' or return undef;
while (<R>) {
my $rec = split_rec $_;
diff --git a/fate-recv.sh b/fate-recv.sh
index e16e024..75161d7 100755
--- a/fate-recv.sh
+++ b/fate-recv.sh
@@ -32,9 +32,16 @@ cd $reptmp
tar xzk
header=$(head -n1 report)
-date=$(expr "$header" : 'fate:0:\([0-9]*\):')
-slot=$(expr "$header" : 'fate:0:[0-9]*:\([A-Za-z0-9_.-]*\):')
-rev=$(expr "$header" : "fate:0:$date:$slot:\([A-Za-z0-9_.-]*\):")
+# Can't use expr on this one because $version might be 0
+version=$(echo "$header" | sed "s/^fate:\([0-9]*\):.*/\1/")
+date=$(expr "$header" : "fate:$version:\([0-9]*\):")
+slot=$(expr "$header" : "fate:$version:$date:\([A-Za-z0-9_.-]*\):")
+rev=$(expr "$header" : "fate:$version:$date:$slot:\([A-Za-z0-9_.-]*\):")
+branch=master
+if [ $version -eq 1 ]; then
+ branch=$(expr "$header" : "fate:$version:$date:$slot:$rev:[0-9]*:[ A-Za-z0-9_.-]*:\([A-Za-z0-9_.-\/]*\):")
+ branch=$(echo "$branch" | sed 's,^release/,v,')
+fi
test -n "$date" && test -n "$slot" || die "Invalid report header"
--
1.9.1
More information about the ffmpeg-devel
mailing list