Merge pull request #43 from warpc/nginx_log_parse_fix

[refs #42] Fix rpm name parse into Download parse method(name included "-")
This commit is contained in:
Vladimir Sharshov 2011-12-14 03:20:00 -08:00
commit b18b598a4a
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class Download < ActiveRecord::Base
def parse_nginx_log
File.open(PREV_LOG_FILE) do |log|
while (line = log.gets)
if package = line.match( /GET \/.+\/([\w\d]+)-([\d.]+)-((\d+mdv[\d.]+)|([\d\w]+-mdv[\d.]+))\.([\w\d]+)\.rpm/ )
if package = line.match( /GET \/.+\/([\w\d-]+)-([\d.]+)-((\d+mdv[\d.]+)|([\d\w]+-mdv[\d.]+))\.([\w\d]+)\.rpm/ )
increase(
:name => package[1],
:version => package[2],