Changeset 272

Show
Ignore:
Timestamp:
11/21/06 19:03:15 (7 years ago)
Author:
max
Message:

Rex runs from CWD, fixes {7}.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • grabbers/rex

    r186 r272  
    33# "Rex" 
    44 
    5 my $version  = '3.3.6'; 
     5my $version  = '3.3.7'; 
    66 
    77# An Australian TV Guide Grabber (a.k.a. tv_grab_au) 
     
    6868# 3.3.5   : Bugfix : support opt_channels (HDTV in Shepherd) 
    6969# 3.3.6   : Bugfix : neater options parsing 
     70# 3.3.7   : Bugfix : now runs from current dir, not ~/.rex/ 
    7071 
    7172use strict; 
     
    8081use JavaScript; 
    8182use Storable; 
     83use Cwd; 
    8284 
    8385use XMLTV; 
     
    8991my $progname = "Rex"; 
    9092my $lang = "en"; 
    91  
    92 my $output_dir = ($ENV{HOME} ? $ENV{HOME} . "/." : "/var/local/") .  
    93                  lc($progname);         # Default location is ~/.rex/ 
    94  
    95 my $cache_file = "$output_dir/cache.dat"; 
    9693 
    9794my ($count_dl, $count_detail, $count_bad, $count_cache, $count_changes, $count_kb) = (0) x 6; 
     
    363360  return if ($opt->{test} or $opt->{nowrite_cache}); 
    364361  print "Saving cache.\n"; 
    365   Storable::store($cached, $cache_file); 
     362  Storable::store($cached, $opt->{'cache-file'}); 
    366363} 
    367364 
     
    469466  unless ($opt->{'ignore-cache'} or $opt->{'rebuild-cache'}) 
    470467  { 
    471     if (-r $cache_file) 
    472     { 
    473       $cached = Storable::retrieve($cache_file); 
     468    if (-r $opt->{'cache-file'}) 
     469    { 
     470      $cached = Storable::retrieve($opt->{'cache-file'}); 
    474471    } 
    475472    else 
    476473    { 
    477       print "Unable to read cache file: $cache_file.\n"; 
     474      print "Unable to read cache file: " . $opt->{'cache-file'} . ".\n"; 
    478475    } 
    479476  } 
     
    946943          "Test mode  : " . is_set($opt->{test}) . "\n" . 
    947944          "Webwarping : " . is_set($opt->{warper}) . "\n" . 
    948           "Cache file : $cache_file"; 
     945          "Cache file : " . $opt->{'cache-file'}; 
    949946    print ' (not reading)' if ($opt->{'ignore-cache'} or $opt->{'rebuild-cache'}); 
    950947    print ' (not updating)' if ($opt->{test} or $opt->{'ignore-cache'} or $opt->{'nowrite-cache'}); 
     
    986983          'region' => 94, 
    987984          'stats' => 300, 
    988           'output' => "$output_dir/guide.xml", 
    989           'channels_file' => "$output_dir/channels.conf" 
     985          'output' => cwd() . '/output.xmltv', 
     986          'cache-file' => cwd() . '/cache.dat', 
     987          'channels_file' => cwd() . '/channels.conf' 
    990988  }; 
    991989                                               
  • status

    r271 r272  
    22engine          dog                 0.3.10 
    33grabber         yahoo7widget        1.58-r1 
    4 grabber         rex                 3.3.6-r1 
     4grabber         rex                 3.3.7 
    55grabber         abc_website         1.70-r1 
    66grabber         abc2_website        1.70-r1