diff options
Diffstat (limited to 'app/services/packages/debian')
-rw-r--r-- | app/services/packages/debian/generate_distribution_service.rb | 1 | ||||
-rw-r--r-- | app/services/packages/debian/process_changes_service.rb | 16 |
2 files changed, 13 insertions, 4 deletions
diff --git a/app/services/packages/debian/generate_distribution_service.rb b/app/services/packages/debian/generate_distribution_service.rb index 7db27f9234d..9b313202400 100644 --- a/app/services/packages/debian/generate_distribution_service.rb +++ b/app/services/packages/debian/generate_distribution_service.rb @@ -220,6 +220,7 @@ module Packages valid_until_field, rfc822_field('NotAutomatic', !@distribution.automatic, !@distribution.automatic), rfc822_field('ButAutomaticUpgrades', @distribution.automatic_upgrades, !@distribution.automatic && @distribution.automatic_upgrades), + rfc822_field('Acquire-By-Hash', 'yes'), rfc822_field('Architectures', @distribution.architectures.map { |architecture| architecture.name }.sort.join(' ')), rfc822_field('Components', @distribution.components.map { |component| component.name }.sort.join(' ')), rfc822_field('Description', @distribution.description) diff --git a/app/services/packages/debian/process_changes_service.rb b/app/services/packages/debian/process_changes_service.rb index b6e81012656..a29cbd3f65f 100644 --- a/app/services/packages/debian/process_changes_service.rb +++ b/app/services/packages/debian/process_changes_service.rb @@ -42,22 +42,30 @@ module Packages def update_files_metadata files.each do |filename, entry| - entry.package_file.package = package - file_metadata = ::Packages::Debian::ExtractMetadataService.new(entry.package_file).execute + ::Packages::UpdatePackageFileService.new(entry.package_file, package_id: package.id) + .execute + + # Force reload from database, as package has changed + entry.package_file.reload_package + entry.package_file.debian_file_metadatum.update!( file_type: file_metadata[:file_type], component: files[filename].component, architecture: file_metadata[:architecture], fields: file_metadata[:fields] ) - entry.package_file.save! end end def update_changes_metadata - package_file.update!(package: package) + ::Packages::UpdatePackageFileService.new(package_file, package_id: package.id) + .execute + + # Force reload from database, as package has changed + package_file.reload_package + package_file.debian_file_metadatum.update!( file_type: metadata[:file_type], fields: metadata[:fields] |