Class: Packages::Rpm::RepositoryMetadata::BuildPrimaryXmlService

Inherits:
BuildXmlBaseService show all
Defined in:
app/services/packages/rpm/repository_metadata/build_primary_xml_service.rb

Constant Summary collapse

ROOT_TAG =
'metadata'
ROOT_ATTRIBUTES =
{
  xmlns: 'http://linux.duke.edu/metadata/common',
  'xmlns:rpm': 'http://linux.duke.edu/metadata/rpm',
  packages: '0'
}.freeze
BASE_ATTRIBUTES =

Nodes that have only text without attributes

%i[name arch summary description url packager].freeze
FORMAT_NODE_BASE_ATTRIBUTES =
%i[license vendor group buildhost sourcerpm].freeze

Instance Method Summary collapse

Methods inherited from BuildXmlBaseService

#initialize

Constructor Details

This class inherits a constructor from Packages::Rpm::RepositoryMetadata::BuildXmlBaseService

Instance Method Details

#executeObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/services/packages/rpm/repository_metadata/build_primary_xml_service.rb', line 17

def execute
  super do |xml|
    xml.package(type: :rpm, 'xmlns:rpm': 'http://linux.duke.edu/metadata/rpm') do
      build_base_attributes(xml)
      xml.version epoch: data[:epoch], ver: data[:version], rel: data[:release]
      xml.checksum data[:pkgid], type: 'sha256', pkgid: 'YES'
      xml.size package: data[:packagesize], installed: data[:installedsize], archive: data[:archivesize]
      xml.time file: data[:filetime], build: data[:buildtime]
      xml.location href: data[:location] if data[:location].present?
      build_format_node(xml)
    end
  end
end