diff --git a/trunk/ripnews/CHANGELOG b/trunk/ripnews/CHANGELOG index 63bc6f6..0945bd4 100644 --- a/trunk/ripnews/CHANGELOG +++ b/trunk/ripnews/CHANGELOG @@ -1,6 +1,10 @@ -# $Dwarf: CHANGELOG,v 1.37 2005/02/05 08:29:36 ward Exp $ +# $Dwarf: CHANGELOG,v 1.38 2005/02/09 09:14:35 ward Exp $ # $Source$ +from 0.5.2 to ... + - fix the occasional deadlock + - implement Mark Remaining Read option + from 0.5.1 to 0.5.2 - major improvement in memory usage - speed ups diff --git a/trunk/ripnews/README b/trunk/ripnews/README index 01b65b7..7805ead 100644 --- a/trunk/ripnews/README +++ b/trunk/ripnews/README @@ -1,4 +1,4 @@ -# $Dwarf: README,v 1.19 2005/02/24 09:02:24 ward Exp $ +# $Dwarf: README,v 1.20 2005/03/01 09:18:25 ward Exp $ # $Source$ Ripnews is a bulk downloader for usenet. It's quite flexible in terms of @@ -118,13 +118,21 @@ Supported config options: OPT_I= Set include pattern. OPT_L= Set long filenames. OPT_C= Sets combined filenames. -OPT_X= Set exclude pattern. Ripnews will read articles matching this pattern but it will not attempt - to download them. +OPT_X= Set exclude pattern. Ripnews will read articles + matching this pattern but it will not attempt + to download them. OPT_MR= Set "mark read" pattern. Ripnews will place - articles matching this pattern in your newsrc, - afterwards they will never be present in memory - again. Great for reducing memory usage when - checking a group for the first time. + articles matching this pattern in your newsrc, + afterwards they will never be present in memory + again. Great for reducing memory usage when + checking a group for the first time. +OPT_MRR= Mark Remaining Read. If this is set to + true and the article doesn't match an exclude or + include pattern, the article will be + marked as read. The purpose of this is + to keep the caches of extremely large + groups small as to make processing + quicker. OPT_T= Set test mode. Newsrc files will not be written to. TEMPDIR= Set tempdir location. diff --git a/trunk/ripnews/ripnews.rb b/trunk/ripnews/ripnews.rb index cb9142a..4c69a46 100755 --- a/trunk/ripnews/ripnews.rb +++ b/trunk/ripnews/ripnews.rb @@ -1,6 +1,6 @@ #!/usr/local/bin/ruby -w -# $Dwarf: ripnews.rb,v 1.102 2005/03/01 09:18:50 ward Exp $ +# $Dwarf: ripnews.rb,v 1.103 2005/03/01 19:56:56 ward Exp $ # $Source$ # @@ -428,9 +428,9 @@ def get_multi(subj, group) end @decode_threads << Thread.new(body, file, fileout, subj) do |tbody, tfile, tfileout, tsubj| - puts "inside thread pre pass\n" +# puts "inside thread pre pass\n" Thread.pass - puts "inside thread post pass\n" +# puts "inside thread post pass\n" if UUEncode.is_uuencoded(tbody) print " UUDecoding...\n" if tfile @@ -478,7 +478,7 @@ def get_multi(subj, group) output_data(tsubj, tmode, tfilename, tbody) end # thread end - puts "ouside thread\n" +# puts "ouside thread\n" return true else @@ -488,7 +488,7 @@ def get_multi(subj, group) end def fill_preselector(group) - if @config[group].has_key?("-I") + if @config[group].has_key?("-I") and !(@config[group].has_key?("-MRR") and @config[group]["-MRR"]) @articles.set_preselect_pattern(Regexp.new(@config[group]["-I"])) end end @@ -652,12 +652,12 @@ def main end for i in @articles.get_group_subjects.sort{|a, b| ward_sort(a, b)} print "#{i}\n" if Debuglevel > 2 + # explicitly mark as read if @config[group].has_key?("-MR") and i =~ /#{@config[group]["-MR"]}/ print "Marking '#{i}' as read\n" @articles.group_update_newsrc(i) - next - end - if !(@config[group].has_key?("-X") and i =~ /#{@config[group]["-X"]}/) and + # get the juicy bits + elsif !(@config[group].has_key?("-X") and i =~ /#{@config[group]["-X"]}/) and i =~ /#{@config[group]["-I"]}/ print "Match: #{i}\n" if Debuglevel > 0 if @articles.group_is_complete(i) @@ -667,21 +667,24 @@ def main elsif @articles.group_is_multipart(i) get_multi(i, group) end - #rescue Article::TempError, Article::PermError rescue TempError, PermError print "#{$!}\n" print " Skipping article...\n" #print "Caught #{$!.class}\n" #print "Error: #{$!}\n" - next end else print "Not complete: #{i}\n" end + # if Mark Remaining Read is set do so + elsif @config[group].has_key?("-MRR") and @config[group]["-MRR"] and + !(@config[group].has_key?("-X") and i =~ /#{@config[group]["-X"]}/) + print "Marking remaining '#{i}' as read\n" + @articles.group_update_newsrc(i) end end - # hier wachten op evt. threads... + # wait for threads if there are any if ! @decode_threads.empty? @articles.disconnect puts "Waiting for decode threads..."