From: Yoann G. <jj...@us...> - 2006-04-24 16:33:14
|
Update of /cvsroot/ngetsuite/ngetsuite2/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv973 Modified Files: downloader.rb group.rb Log Message: added parrar-sh support, get rid of zombies on popen (-v), more robust on problematic group Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite2/ngetsuite/downloader.rb,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** downloader.rb 11 Oct 2004 22:26:24 -0000 1.1.1.1 --- downloader.rb 24 Apr 2006 16:33:03 -0000 1.2 *************** *** 247,252 **** ! subdirexpr = "-p '.#{File::Separator}#{@subdir}'" ! subdirexpr += " -P '.#{File::Separator}#{@subdir}#{File::Separator}#{$config['queue_tempsubdir']}'" if ($config['queue_tempsubdir']) @io = IO.popen("#{"nice -n#{$config['nice_nget_download']} -- " if $config['nice_nget_download'] != 0} #{$config['nget']} -q -dfI --makedirs yes #{subdirexpr} -G #{@group._fullname} #{downloadexpr} 2>&1") --- 247,252 ---- ! subdirexpr = "-p '.#{File.join('', @subdir)}'" ! subdirexpr += " -P '.#{File.join('', @subdir, $config['queue_tempsubdir'])}'" if ($config['queue_tempsubdir']) @io = IO.popen("#{"nice -n#{$config['nice_nget_download']} -- " if $config['nice_nget_download'] != 0} #{$config['nget']} -q -dfI --makedirs yes #{subdirexpr} -G #{@group._fullname} #{downloadexpr} 2>&1") *************** *** 275,278 **** --- 275,300 ---- parent.stop raise + else + Dir.chdir @subdir + done = [] + Dir['*.par2'].each { |f| + next if f !~ /#@value/i + next if f =~ /vol\d+\+\d+.par2/ + base = f.sub(/\.par2$/, '').gsub("'", %q{'"'"'}) + next if done.include? base + done << base + puts "parrar-sh '#{base}'" + system "parrar-sh '#{base}'" + } + Dir['*.rar'].each { |f| + next if f !~ /#@value/i + next if f =~ /part(\d+)\.rar/ and $1.to_i != 1 + base = f.sub(/\.rar$/, '').sub(/\.part0*1$/, '').gsub("'", %q{'"'"'}) + next if done.include? base + done << base + puts "parrar-sh '#{base}'" + system "parrar-sh '#{base}'" + } + puts 'finished' end } Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite2/ngetsuite/group.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** group.rb 3 Dec 2005 13:24:04 -0000 1.6 --- group.rb 24 Apr 2006 16:33:03 -0000 1.7 *************** *** 141,144 **** --- 141,145 ---- name = (Regexp.escape name).gsub("'", %q{'"'"'}) cmd = "nget -G #{@_fullname} -qq -r '#{name}'" + # sleep rand(10) system cmd exit! *************** *** 199,203 **** def update updatengetcache unless $config['extern_headers_update'].split(',').include?(@_shortname) ! parsengetcache recognizereleases fetchnfos unless $config['extern_nfos_fetch'].split(',').include?(@_shortname) --- 200,204 ---- def update updatengetcache unless $config['extern_headers_update'].split(',').include?(@_shortname) ! parsengetcache rescue return recognizereleases fetchnfos unless $config['extern_nfos_fetch'].split(',').include?(@_shortname) *************** *** 226,230 **** begin line = '' ! IO.popen(cmdline).each_byte { |char| char = char.chr if char != "\r" and char != "\n" --- 227,232 ---- begin line = '' ! io = IO.popen(cmdline) ! io.each_byte { |char| char = char.chr if char != "\r" and char != "\n" *************** *** 243,246 **** --- 245,250 ---- rescue Object=>e print "\nInterrupted: #{e.inspect}" + ensure + io.close end |