Changeset 484
- Timestamp:
- 02/01/07 16:57:09 (6 years ago)
- Files:
-
- 2 modified
-
applications/shepherd (modified) (34 diffs)
-
status (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
applications/shepherd
r480 r484 2 2 3 3 my $progname = 'shepherd'; 4 my $version = '0.4. 39';4 my $version = '0.4.40'; 5 5 6 6 # tv_grab_au … … 108 108 my $grabbed; 109 109 my $gmt_offset; 110 my $grabber_found_all_data; 110 my $data_found_all; 111 my $data_satisfies_policy; 112 my $find_microgaps; 111 113 my $writer; 112 114 my $components_used = $progname."(v".$version.")"; … … 1790 1792 while (my $grabber = choose_grabber()) 1791 1793 { 1792 $grabber_found_all_data = 0; 1794 $data_satisfies_policy = 0; 1795 $data_found_all = 0; 1793 1796 $used_grabbers++; 1794 1797 1795 1798 &log("\nSHEPHERD: Using grabber: ($used_grabbers) $grabber\n"); 1796 1799 1797 my $output = "$CWD/grabbers/$grabber/output.xmltv"; 1800 my $iteration = query_iteration($grabber); 1801 1802 my $output = sprintf "%s/grabbers/%s/output-%d.xmltv", 1803 $CWD, $grabber, $iteration; 1798 1804 1799 1805 my $comm = "$CWD/grabbers/$grabber/$grabber " . … … 1807 1813 if (query_config($grabber, 'category') == 1) 1808 1814 { 1809 &log(" $grabber is Category 1: grabbing timeslice.\n") if ($debug);1815 &log("SHEPHERD: $grabber is Category 1: grabbing timeslice.\n") if ($debug); 1810 1816 1811 1817 record_requested_chandays($grabber, $timeslice); … … 1840 1846 write_file($tmpcf, 'temporary channels', [ $tmpchans ], [ 'channels' ]); 1841 1847 $comm .= " --channels_file $tmpcf"; 1848 1849 # Create gaps_file if we want less than (roughly) the full day 1850 if ($find_microgaps) 1851 { 1852 my $tmpgf = "$CWD/gaps.tmp"; 1853 create_gaps_file($tmpgf, $timeslice); 1854 $comm .= " --gaps_file $tmpgf"; 1855 } 1842 1856 } 1843 1857 else 1844 1858 { 1845 &log(" $grabber is category 2: grabbing everything.\n") if ($debug);1859 &log("SHEPHERD: $grabber is category 2: grabbing everything.\n") if ($debug); 1846 1860 $comm .= " --days $days" if ($days); 1847 1861 $comm .= " --offset $opt->{offset}" if ($opt->{offset}); … … 1883 1897 # soak up the data we just collected 1884 1898 &soak_up_data($grabber, $output, "grabber"); 1885 $components->{$grabber}->{laststatus} = $plugin_data->{ $grabber}->{laststatus};1886 1887 if ($plugin_data->{ $grabber}->{valid}) {1899 $components->{$grabber}->{laststatus} = $plugin_data->{"$grabber-$iteration"}->{laststatus}; 1900 1901 if ($plugin_data->{"$grabber-$iteration"}->{valid}) { 1888 1902 $components->{$grabber}->{lastdata} = time; 1889 1903 delete $components->{$grabber}->{consecutive_failures} … … 1900 1914 # analyze the data that this grabber returned 1901 1915 # (useful to detect individual components going bad and report them upstream) 1902 &analyze_plugin_data( $grabber,1,$grabber);1916 &analyze_plugin_data("grabber $grabber", 1, $grabber, $iteration); 1903 1917 1904 1918 # check to see if we have all the data we want 1905 $ grabber_found_all_data= &analyze_plugin_data("analysis of all grabbers so far",0,$progname);1919 $data_satisfies_policy = &analyze_plugin_data("analysis of all grabbers so far",0,$progname); 1906 1920 1907 1921 # Record what we grabbed from cacheable C1 grabbers … … 1917 1931 } 1918 1932 1919 last if ($grabber_found_all_data); 1933 last if ($data_found_all); 1934 if ($data_satisfies_policy) 1935 { 1936 $find_microgaps = 1; 1937 } 1920 1938 } 1921 1939 … … 1924 1942 { 1925 1943 &log("No valid grabbers installed/enabled!\n"); 1926 return; 1927 } 1928 1929 unless ($grabber_found_all_data) 1930 { 1931 &log("SHEPHERD: Ran through ALL grabbers but still missing data!!! :(\n"); 1932 return; 1944 } 1945 elsif (!$data_satisfies_policy) 1946 { 1947 &log("SHEPHERD: Ran through all grabbers but still have policy-violating gaps in data! :(\n"); 1948 } 1949 elsif (!$data_found_all) 1950 { 1951 &log("SHEPHERD: Unfillable micro-gaps exist in data!\n"); 1952 } 1953 } 1954 1955 sub query_iteration 1956 { 1957 my $grabber = shift; 1958 1959 my $i = 0; 1960 while (1) 1961 { 1962 return $i unless (defined $plugin_data->{"$grabber-$i"}); 1963 $i++; 1964 die "Insane infinite loop suspected!" if ($i > 10); 1933 1965 } 1934 1966 } … … 1962 1994 } 1963 1995 1964 $missing = detect_missing_data( );1996 $missing = detect_missing_data($find_microgaps); 1965 1997 $timeslice = find_best_timeslice(); 1966 1998 … … 1980 2012 { 1981 2013 &log("Grabber selection:\n"); 2014 &log("Only considering micro-grabbers.\n") if ($find_microgaps); 1982 2015 foreach (sort { $gscore->{$b} <=> $gscore->{$a} } keys %$gscore) 1983 2016 { … … 2127 2160 if (!supports_region($grabber)) 2128 2161 { 2162 &log("Zeroing $grabber due to no region support\n") if ($debug); 2163 $hits = 0; 2164 } 2165 elsif ($find_microgaps and !query_config($grabber, 'micrograbs')) 2166 { 2167 &log("Zeroing $grabber due to non-micrograbbing\n") if ($debug); 2129 2168 $hits = 0; 2130 2169 } … … 2300 2339 2301 2340 # Build a dayhash of what channel/day data we're currently missing. 2302 # I think granularity of one day is good for now; could possibly be2303 # made more fine-grained if we think grabbers will support that.2341 # Only policy-violating holes count unless it's sent the detect_microgaps 2342 # flag. 2304 2343 sub detect_missing_data 2305 2344 { 2345 my $detect_microgaps = shift; 2346 2306 2347 my $m = { }; 2307 2348 2349 print "SHEPHERD: Hunting for microgaps!\n" if ($detect_microgaps and $debug); 2308 2350 my $chandays = 0; 2309 2351 foreach my $ch (keys %$channels) 2310 2352 { 2311 2353 # is this channel missing too much data? 2312 unless ($channel_data->{$ch}->{analysis}->{data_ok}) { 2313 # not ok - record which days are bad 2314 foreach my $day (@{($channel_data->{$ch}->{analysis}->{day})}) { 2354 if ($detect_microgaps) 2355 { 2356 my $lastday = -1; 2357 foreach my $line (@{$channel_data->{$ch}->{analysis}->{missing_all}}) 2358 { 2359 $line =~ /^#(\d)/ or die "Bad line $line"; 2360 my $day = $1; 2361 unless ($day == $lastday) 2362 { 2363 push (@{($m->{$day})}, $ch); 2364 $lastday = $day; 2365 } 2366 } 2367 } 2368 elsif (!$channel_data->{$ch}->{analysis}->{data_ok}) 2369 { 2370 foreach my $day (@{($channel_data->{$ch}->{analysis}->{day})}) 2371 { 2315 2372 push(@{($m->{($day->{num})})}, $ch) unless ($day->{day_ok}); 2316 2373 } … … 2324 2381 } 2325 2382 2326 if ($debug )2383 if ($debug and $chandays) 2327 2384 { 2328 2385 &log("Need data for days " . join(", ", sort keys %$m) . … … 2371 2428 } 2372 2429 2430 sub create_gaps_file 2431 { 2432 my ($fn, $timeslice) = @_; 2433 2434 my $gaps; 2435 2436 my $timeslice_epoch_start = $policy{starttime} + ($timeslice->{start} * 24 * 60 * 60); 2437 my $timeslice_epoch_end = $policy{starttime} + (($timeslice->{stop} + 1) * 24 * 60 * 60); 2438 2439 foreach my $ch (@{$timeslice->{chans}}) 2440 { 2441 my $missinglist = $channel_data->{$ch}->{analysis}->{missing_all_epoch}; 2442 my @a = split(/,/, $missinglist); 2443 foreach my $period (@a) 2444 { 2445 $period =~ /(\d+)-(\d+)/; 2446 if ($1 < $timeslice_epoch_end or $2 > $timeslice_epoch_start) 2447 { 2448 # we want this period 2449 push (@{$gaps->{$ch}}, $period); 2450 } 2451 } 2452 } 2453 2454 write_file($fn, 'temporary gaps file', [ $gaps ], [ 'gaps' ]); 2455 } 2456 2373 2457 # Record what a cacheable C1 grabber has just retrieved for us, 2374 2458 # so we know next time that this data can be grabbed quickly. … … 2439 2523 push @requested, "$day:$ch"; 2440 2524 $plugin_data->{$grabber}->{requested_data}->{$ch}[$day] = 1; 2441 &log(" requesting ch $ch on day $day\n") if ($debug);2525 # &log(" requesting ch $ch on day $day\n") if ($debug); 2442 2526 } 2443 2527 } … … 2470 2554 foreach my $ch (@{$timeslice->{chans}}) 2471 2555 { 2472 unless ($grabbed->{$grabber} and grep( /$day:$ch/, @{$grabbed->{$grabber}}))2556 unless ($grabbed->{$grabber} and grep($_ eq "$day:$ch", @{$grabbed->{$grabber}})) 2473 2557 { 2474 2558 push (@chans, $ch) … … 2488 2572 sub soak_up_data 2489 2573 { 2490 my ($plugin , $output, $plugintype) = @_;2574 my ($pluginname, $output, $plugintype) = @_; 2491 2575 2492 2576 if (! -r $output) { 2493 &log("SHEPHERD: Warning: plugin '$plugin ' output file '$output' does not exist\n");2577 &log("SHEPHERD: Warning: plugin '$pluginname' output file '$output' does not exist\n"); 2494 2578 return; 2495 2579 } 2496 2580 2581 my $plugin = $pluginname; 2582 if ($plugintype eq 'grabber') 2583 { 2584 $plugin .= '-' . query_iteration($pluginname); 2585 } 2586 2497 2587 my $this_plugin = $plugin_data->{$plugin}; 2498 &log("SHEPHERD: Started parsing XMLTV from '$plugin' in '$output' .. any errors below are from parser:\n"); 2588 $this_plugin->{name} = $pluginname; 2589 &log("SHEPHERD: Started parsing XMLTV from '$pluginname' in '$output' .. any errors below are from parser:\n"); 2499 2590 eval { $this_plugin->{xmltv} = XMLTV::parsefiles($output); }; 2500 &log("SHEPHERD: Completed XMLTV parsing from '$plugin '\n");2591 &log("SHEPHERD: Completed XMLTV parsing from '$pluginname'\n"); 2501 2592 2502 2593 if (!($this_plugin->{xmltv})) { 2503 &log("WARNING: Plugin $plugin didn't seem to return any valid XMLTV!\n");2594 &log("WARNING: Plugin $pluginname didn't seem to return any valid XMLTV!\n"); 2504 2595 return; 2505 2596 } … … 2507 2598 $this_plugin->{valid} = 1; 2508 2599 $this_plugin->{output_filename} = $output; 2509 $components_used .= " + ".$plugin ."(v".$components->{$plugin}->{ver}.")";2600 $components_used .= " + ".$pluginname."(v".$components->{$pluginname}->{ver}.")"; 2510 2601 2511 2602 my $xmltv = $this_plugin->{xmltv}; … … 2529 2620 if (!defined $chan_xml_list{($prog->{channel})}) { 2530 2621 $this_plugin->{progs_with_unknown_channel}++; 2531 &log((sprintf " - WARNING: plugin '%s' returned data for unknown channel '%s': ignored.\n",$plugin ,$prog->{channel}));2622 &log((sprintf " - WARNING: plugin '%s' returned data for unknown channel '%s': ignored.\n",$pluginname,$prog->{channel})); 2532 2623 $chan_xml_list{($prog->{channel})} = 1; # so we warn only once 2533 2624 } … … 2547 2638 if (!$t1 || !$t2) { 2548 2639 &log((sprintf " - WARNING: plugin '%s' returned programme data with invalid timestamp format: \"%s\": can't parse.\n", 2549 $plugin ,(!$t1 ? $prog->{start} : $prog->{stop}))) if (!$this_plugin->{progs_with_invalid_date});2640 $pluginname,(!$t1 ? $prog->{start} : $prog->{stop}))) if (!$this_plugin->{progs_with_invalid_date}); 2550 2641 $this_plugin->{progs_with_invalid_date}++; 2551 2642 next; … … 2556 2647 ($prog->{title}->[0]->[0] !~ /close/i)) { 2557 2648 &log((sprintf " - WARNING: plugin '%s' returned programme data with duration exceeding limit (%dh%dm): ignored.\n", 2558 $plugin , int($policy{max_programme_length} / 3600),2649 $pluginname, int($policy{max_programme_length} / 3600), 2559 2650 int(($policy{max_programme_length} % 3600) / 60))) 2560 2651 if (!$this_plugin->{progs_too_long}); … … 2607 2698 # print some stats about what we saw! 2608 2699 &log((sprintf "SHEPHERD: %s '%s' returned data for %d channels, %d programmes, %dd%02dh%02dm%02ds duration, %s%s\n", 2609 ucfirst($plugintype), $plugin , $seen_channels_with_data, $this_plugin->{programmes},2700 ucfirst($plugintype), $pluginname, $seen_channels_with_data, $this_plugin->{programmes}, 2610 2701 int($this_plugin->{total_duration} / 86400), # days 2611 2702 int(($this_plugin->{total_duration} % 86400) / 3600), # hours … … 2626 2717 2627 2718 # analyze grabber data - do we have all the data we want? 2628 # this can analyze either the cumulative data from ALL plugins ($ analysistype="shepherd")2719 # this can analyze either the cumulative data from ALL plugins ($proggy="shepherd") 2629 2720 # or can analyze the data from one specific plugin 2630 2721 2631 2722 sub analyze_plugin_data 2632 2723 { 2633 my ($analysisname, $quiet,$analysistype) = @_;2724 my ($analysisname, $quiet, $proggy, $iteration) = @_; 2634 2725 &log("SHEPHERD: $analysisname:\n") unless $quiet; 2635 2726 … … 2637 2728 my $plugin_epoch_missing_data = ""; 2638 2729 my $overall_data_ok = 1; # until proven otherwise 2730 my $total_missing = 0; 2731 my $plugin = $proggy; 2732 $plugin .= "-$iteration" if (defined $iteration); 2639 2733 2640 2734 # iterate across each channel … … 2642 2736 2643 2737 # if we're analyzing data for a grabber and it doesn't support this channel, skip it 2644 if (($ analysistypene $progname) &&2645 ($components->{$ analysistype}->{type} eq "grabber") &&2646 (supports_channel($ analysistype,$ch,1) == 0)) {2738 if (($proggy ne $progname) && 2739 ($components->{$proggy}->{type} eq "grabber") && 2740 (supports_channel($proggy, $ch, 1) == 0)) { 2647 2741 &log((sprintf "DEBUG: analysis of channel %s for plugin %s skipped since plugin doesn't support channel\n", 2648 $ch, $ analysistype)) if ($debug);2742 $ch, $proggy)) if ($debug); 2649 2743 next; 2650 2744 } … … 2682 2776 2683 2777 # we have programming data for this bucket. great! process next bucket 2684 if ((($ analysistypeeq $progname) &&2778 if ((($proggy eq $progname) && 2685 2779 (defined $channel_data->{$ch}->{timeslots}[$slotnum]) && 2686 2780 ($channel_data->{$ch}->{timeslots}[$slotnum] > 0)) || 2687 (($ analysistypene $progname) &&2688 (defined $plugin_data->{$ analysistype}->{timeslots}->{$ch}[$slotnum]) &&2689 ($plugin_data->{$ analysistype}->{timeslots}->{$ch}[$slotnum] > 0))) {2781 (($proggy ne $progname) && 2782 (defined $plugin_data->{$plugin}->{timeslots}->{$ch}[$slotnum]) && 2783 ($plugin_data->{$plugin}->{timeslots}->{$ch}[$slotnum] > 0))) { 2690 2784 # if we have missing data queued up, push it now 2691 2785 &dump_already_missing($data); … … 2707 2801 2708 2802 2709 if (($ analysistype ne $progname) && ($components->{$analysistype}->{type} eq "grabber")) {2803 if (($proggy ne $progname) && ($components->{$proggy}->{type} eq "grabber")) { 2710 2804 # if we're analyzing data for a grabber and it doesn't have data for this 2711 2805 # channel on this day, don't record it as missing data if: … … 2717 2811 2718 2812 # 1. ignore if it exceeds 'max_reliable_days' for this grabber 2719 if (supports_day($ analysistype,$day) != 1) {2813 if (supports_day($proggy,$day) != 1) { 2720 2814 $ignore_missing++; 2721 2815 &log((sprintf "DEBUG: analysis of plugin '%s' skipping missing data channel '%s' for day %d due to max_reliable_days\n", 2722 $ analysistype, $ch, $day)) if ($policy{timeslot_debug});2816 $proggy, $ch, $day)) if ($policy{timeslot_debug}); 2723 2817 } 2724 2818 2725 2819 # 2. ignore if we did request data for channel/day (C1 grabbers) 2726 if ((query_config($ analysistype, 'category') == 1) &&2727 (!defined $plugin_data->{$ analysistype}->{requested_data}->{$ch}[$day])) {2820 if ((query_config($proggy, 'category') == 1) && 2821 (!defined $plugin_data->{$plugin}->{requested_data}->{$ch}[$day])) { 2728 2822 $ignore_missing++; 2729 2823 &log((sprintf "DEBUG: analysis of plugin '%s' skipping missing data channel '%s' for day %d due to not requested\n", 2730 $ analysistype, $ch, $day)) if ($policy{timeslot_debug});2824 $proggy, $ch, $day)) if ($policy{timeslot_debug}); 2731 2825 } 2732 2826 2733 2827 # 3. ignore if this grabber can't supply this channel (C2 grabbers) 2734 if ((query_config($ analysistype, 'category') == 2) &&2735 (supports_channel($ analysistype,$ch,$day) == 0)) {2828 if ((query_config($proggy, 'category') == 2) && 2829 (supports_channel($proggy,$ch,$day) == 0)) { 2736 2830 $ignore_missing++; 2737 2831 &log((sprintf "DEBUG: analysis of plugin '%s' skipping missing data channel '%s' for day %d due to cannot-supply\n", 2738 $ analysistype, $ch, $day)) if ($policy{timeslot_debug});2832 $proggy, $ch, $day)) if ($policy{timeslot_debug}); 2739 2833 } 2740 2834 … … 2748 2842 2749 2843 2750 if (($ analysistype ne $progname) && ($components->{$analysistype}->{type} ne "grabber")) {2844 if (($proggy ne $progname) && ($components->{$proggy}->{type} ne "grabber")) { 2751 2845 # if we're analyzing data for a reconciler/postprocessor and it doesn't have 2752 2846 # data for a timeslot, only record that as an error if the source data _was_ … … 2756 2850 ($channel_data->{$ch}->{timeslots}[$slotnum] == 0)) { 2757 2851 &log((sprintf "DEBUG: analysis of plugin '%s' skipping missing data channel '%s' for day %d due to not-in-overall-data\n", 2758 $ analysistype, $ch, $day)) if ($policy{timeslot_debug});2852 $proggy, $ch, $day)) if ($policy{timeslot_debug}); 2759 2853 next; 2760 2854 } … … 2819 2913 } 2820 2914 2821 my $statusstring = sprintf " > ch %s: %s programming: %s\n", 2822 $ch, pretty_duration($data->{have}), 2823 $data->{data_ok} ? "PASS (within thresholds)" : "FAIL, missing data over policy threshold:"; 2915 my $statusstring = sprintf " > ch %s: %s%s\n", 2916 $ch, 2917 $data->{have} ? ($data->{missing} ? ($data->{data_ok} ? "PASS (within policy thresholds)" : "FAIL (missing data exceeds policy thresholds):") : "PASS (complete)") : "FAIL (no data):", 2918 $data->{have} ? ", have " . pretty_duration($data->{have}) : ''; 2824 2919 2825 2920 # display per-day missing data statistics 2826 2921 foreach my $day (@{($data->{day})}) { 2827 unless ($day->{day_ok}) { 2828 $statusstring .= sprintf "\t".(strftime("%a %e %b",localtime($policy{starttime}+($day->{num}*86400)))).": "; 2922 next unless ($day->{missing}); 2923 2924 $statusstring .= sprintf "\t".(strftime("%a %e %b",localtime($policy{starttime}+($day->{num}*86400)))).": missing "; 2925 if ($day->{have}) 2926 { 2927 $statusstring .= pretty_duration($day->{missing}) . ": "; 2829 2928 2830 2929 # do we have any data for this day? 2831 2930 $statusstring .= "peak ".join(", ",(@{($day->{missing_peak_table})})) 2832 if (($day->{missing_peak}) && ($day->{missing_peak} > $policy{peak_max_missing}));2931 if (($day->{missing_peak}) && ($day->{missing_peak})); 2833 2932 2834 2933 $statusstring .= sprintf "%snon-peak %s", 2835 2934 ($day->{missing_peak} ? " / " : ""), 2836 2935 join(", ",(@{($day->{missing_nonpeak_table})})) 2837 if (($day->{missing_nonpeak}) && ($day->{missing_nonpeak} > $policy{nonpeak_max_missing}));2936 if (($day->{missing_nonpeak}) && ($day->{missing_nonpeak})); 2838 2937 2839 2938 $statusstring .= sprintf "%sother %s", 2840 2939 (($day->{missing_peak} + $day->{missing_nonpeak}) > 0 ? " / " : ""), 2841 2940 join(", ",(@{($day->{missing_other_table})})) 2842 if (($day->{missing_other}) && ($day->{missing_other} > $policy{other_max_missing})); 2843 2844 $statusstring .= "\n"; 2845 } 2941 if (($day->{missing_other}) && ($day->{missing_other})); 2942 } 2943 else 2944 { 2945 $statusstring .= "entire day"; 2946 } 2947 $statusstring .= "\n"; 2846 2948 } 2847 2949 &log($statusstring) unless $quiet; 2848 2950 $data->{statusstring} = $statusstring; 2849 2951 $plugin_epoch_missing_data .= sprintf "%s:%s\t",$ch,$data->{missing_all_epoch} if (defined $data->{missing_all_epoch}); 2850 2851 if ($analysistype eq $progname) { 2952 $total_missing += $data->{missing}; 2953 2954 if ($proggy eq $progname) { 2852 2955 delete $channel_data->{$ch}->{analysis} if (defined $channel_data->{$ch}->{analysis}); 2853 2956 $channel_data->{$ch}->{analysis} = $data; 2854 2957 } else { 2855 delete $plugin_data->{$ analysistype}->{analysis}->{$ch} if (defined $plugin_data->{$analysistype}->{analysis}->{$ch});2856 $plugin_data->{$ analysistype}->{analysis}->{$ch} = $data;2857 } 2858 } 2859 2860 &log((sprintf " > OVERALL: %s\n", ($ overall_data_ok ? "PASS" : "FAIL"))) unless $quiet;2958 delete $plugin_data->{$plugin}->{analysis}->{$ch} if (defined $plugin_data->{$plugin}->{analysis}->{$ch}); 2959 $plugin_data->{$plugin}->{analysis}->{$ch} = $data; 2960 } 2961 } 2962 2963 &log((sprintf " > OVERALL: %s\n", ($total_missing ? ($overall_data_ok ? "PASS (within policy thresholds)" : "FAIL (exceeds policy thresholds)") : "PASS (complete)"))) unless $quiet; 2861 2964 2862 2965 if ($plugin_epoch_missing_data eq '') { 2863 2966 # clear any previously-set missing data flag 2864 delete $pending_messages->{$ analysistype}->{MISSING_DATA};2967 delete $pending_messages->{$proggy}->{MISSING_DATA}; 2865 2968 } else { 2866 2969 # flag any missing data 2867 &add_pending_message($analysistype, 'MISSING_DATA', $plugin_epoch_missing_data); 2868 } 2869 2870 return $overall_data_ok; # return 1 for good, 0 for need more 2970 &add_pending_message($proggy, 'MISSING_DATA', $plugin_epoch_missing_data); 2971 } 2972 2973 if ($proggy eq $progname) 2974 { 2975 $data_found_all = ($total_missing ? 0 : 1); 2976 $data_satisfies_policy = $overall_data_ok; 2977 } 2978 return $overall_data_ok; # return 1 for satisifies policy, 0 for need more 2871 2979 } 2872 2980 … … 3027 3135 &log("Preference for whose data we prefer as follows:\n"); 3028 3136 foreach my $proggy (sort { $components->{$b}->{config}->{quality} <=> $components->{$a}->{config}->{quality} } query_grabbers()) { 3029 if ((!$components->{$proggy}->{disabled}) && ($plugin_data->{$proggy}) && ($plugin_data->{$proggy}->{valid})) { 3137 next if ($components->{$proggy}->{disabled}); 3138 foreach my $plugin (keys %$plugin_data) { 3139 next unless (($plugin =~ /^$proggy-\d+$/) 3140 and 3141 ($plugin_data->{$plugin}) 3142 and 3143 ($plugin_data->{$plugin}->{valid})); 3030 3144 $num_grabbers++; 3031 &log((sprintf " %d. %s (%s)\n", $num_grabbers, $proggy, $plugin_data->{$p roggy}->{output_filename}));3032 3033 $input_files .= $plugin_data->{$p roggy}->{output_filename}." ";3034 push(@input_file_list,$plugin_data->{$p roggy}->{output_filename});3145 &log((sprintf " %d. %s (%s)\n", $num_grabbers, $proggy, $plugin_data->{$plugin}->{output_filename})); 3146 3147 $input_files .= $plugin_data->{$plugin}->{output_filename}." "; 3148 push(@input_file_list,$plugin_data->{$plugin}->{output_filename}); 3035 3149 } 3036 3150 } … … 3047 3161 $reconciler_found_all_data = &call_data_processor("reconciler",$reconciler,$input_files); 3048 3162 3049 if ((!$reconciler_found_all_data) && ($ grabber_found_all_data)) {3163 if ((!$reconciler_found_all_data) && ($data_found_all)) { 3050 3164 # urgh. this reconciler did a bad bad thing ... 3051 3165 &log("SHEPHERD: XML data from reconciler $reconciler appears bogus, will try to use another reconciler\n"); -
status
r481 r484 1 application shepherd 0.4. 391 application shepherd 0.4.40 2 2 grabber yahoo7widget 1.77 3 3 grabber rex 3.4.0
