Use package upstream version. Skip revision. Improve regexp parsing.

This commit is contained in:
Christoph Haas 2018-08-22 13:11:28 +02:00
parent 56750c3884
commit 4a9fe8772e
3 changed files with 33 additions and 6 deletions

View file

@ -105,7 +105,7 @@ namespace :debshots do
new_version = DebImporter::Version.new(package[:Version])
Rails.logger.debug "Comparing package version: old=#{db_package.version} new=#{new_version}"
if new_version > current_version
if new_version.upstream > current_version.upstream
# update the package information from new data
update_data(package, db_package)
Rails.logger.info "Updating package information"
@ -241,7 +241,7 @@ def update_data(package, db_package)
Rails.logger.debug "New information: #{package.inspect}"
# Rails.logger.info "New package version found. Updating details in database."
db_package.version = package[:Version]
db_package.version = Version.new(package[:Version]).upstream
db_package.name = package[:Package] unless db_package.name # set the name for new packages
db_package.description = package[:Description][0..79]
db_package.homepage = package[:Homepage]