X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fcheck-configs.pl;h=789a45e084d17db10eda6a33b9712c373f0c7498;hp=c7cb8e8401624d7fd0d9667907b68d1efecb5ae9;hb=d5186197bc394e10a4402f7f6d23fbb14103bc50;hpb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e diff --git a/hacks/check-configs.pl b/hacks/check-configs.pl index c7cb8e84..789a45e0 100755 --- a/hacks/check-configs.pl +++ b/hacks/check-configs.pl @@ -19,7 +19,7 @@ use diagnostics; use strict; my $progname = $0; $progname =~ s@.*/@@g; -my ($version) = ('$Revision: 1.9 $' =~ m/\s(\d[.\d]+)\s/s); +my ($version) = ('$Revision: 1.12 $' =~ m/\s(\d[.\d]+)\s/s); my $verbose = 0; @@ -74,7 +74,7 @@ sub parse_src($) { $body =~ s@/\*.*?\*/@@gs; $body =~ s@^#\s*(if|ifdef|ifndef|elif|else|endif).*$@@gm; - $body =~ s/(THREAD|ANALOGTV)_(DEFAULTS|OPTIONS)//gs; + $body =~ s/(THREAD|ANALOGTV)_(DEFAULTS|OPTIONS)(_XLOCK)?//gs; print STDERR "$progname: $file: defaults:\n" if ($verbose > 2); my %res_to_val; @@ -194,6 +194,8 @@ sub parse_xml($$) { $body =~ s/ 2); foreach (split (m/\001/, $body)) { next if (m/^\s*$/s); @@ -209,6 +211,13 @@ sub parse_xml($$) { push @result, $val; print STDERR "$progname: $file: name: $name\n" if ($verbose > 2); + } elsif ($type eq 'video') { + error ("$file: multiple videos") if $video; + ($video) = ($args =~ m/\bhref="(.*?)"/); + error ("$file: unparsable video") unless $video; + error ("$file: unparsable video URL") + unless ($video =~ m@^https?://www\.youtube\.com/watch\?v=[^?&]+$@s); + } elsif ($type eq 'number') { my ($arg) = ($args =~ m/\barg\s*=\s*\"([^\"]+)\"/); my ($val) = ($args =~ m/\bdefault\s*=\s*\"([^\"]+)\"/); @@ -277,6 +286,9 @@ sub parse_xml($$) { } } +# error ("$file: no video") unless $video; + print STDERR "\n$file: WARNING: no video\n\n" unless $video; + return @result; }