Class: Katello::Pulp3::Srpm
Constant Summary
collapse
- CONTENT_TYPE =
"srpm".freeze
- PULP_INDEXED_FIELDS =
%w(pulp_href name version release arch epoch summary location_href pkgId).freeze
Instance Attribute Summary
#backend_data, #uuid
Class Method Summary
collapse
Instance Method Summary
collapse
included
add_timestamps, backend_unit_identifier, content_api_create, content_type, content_unit_list, create_content, #fetch_backend_data, fetch_content_list, find_duplicate_unit, #initialize, model_class, pulp_data, pulp_units_batch_all, pulp_units_batch_for_repo, pulp_units_for_ids, supports_id_fetch?, unit_identifier
Class Method Details
.content_api ⇒ Object
16
17
18
|
# File 'app/services/katello/pulp3/srpm.rb', line 16
def self.content_api
PulpRpmClient::ContentPackagesApi.new(Katello::Pulp3::Api::Yum.new(SmartProxy.pulp_primary!).api_client)
end
|
.generate_model_row(unit) ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'app/services/katello/pulp3/srpm.rb', line 67
def self.generate_model_row(unit)
custom_json = {}
custom_json['pulp_id'] = unit['pulp_href']
(PULP_INDEXED_FIELDS - ['pulp_href', 'pkgId', 'location_href']).
each { |field| custom_json[field] = unit[field] }
custom_json['release_sortable'] = Util::Package.sortable_version(unit['release'])
custom_json['version_sortable'] = Util::Package.sortable_version(unit['version'])
custom_json['nvra'] = Katello::Util::Package.build_nvra(custom_json)
custom_json['filename'] = unit['location_href']
custom_json['checksum'] = unit['pkgId']
custom_json['summary'] = custom_json['summary']&.truncate(255)
custom_json
end
|
.ids_for_repository(repo_id) ⇒ Object
25
26
27
28
29
|
# File 'app/services/katello/pulp3/srpm.rb', line 25
def self.ids_for_repository(repo_id)
repo = Katello::Pulp3::Repository::Yum.new(Katello::Repository.find(repo_id), SmartProxy.pulp_primary)
repo_content_list = repo.content_list
repo_content_list.map { |content| content.try(:pulp_href) }
end
|
.page_options(page_opts = {}) ⇒ Object
20
21
22
23
|
# File 'app/services/katello/pulp3/srpm.rb', line 20
def self.page_options(page_opts = {})
page_opts["arch"] = "src"
page_opts
end
|
Instance Method Details
#build_time ⇒ Object
55
56
57
|
# File 'app/services/katello/pulp3/srpm.rb', line 55
def build_time
backend_data['time_build']
end
|
#buildhost ⇒ Object
31
32
33
|
# File 'app/services/katello/pulp3/srpm.rb', line 31
def buildhost
backend_data['rpm_buildhost']
end
|
#changelog ⇒ Object
47
48
49
|
# File 'app/services/katello/pulp3/srpm.rb', line 47
def changelog
backend_data['changelogs']
end
|
#checksumtype ⇒ Object
43
44
45
|
# File 'app/services/katello/pulp3/srpm.rb', line 43
def checksumtype
backend_data['checksum_type']
end
|
#group ⇒ Object
51
52
53
|
# File 'app/services/katello/pulp3/srpm.rb', line 51
def group
backend_data['rpm_group']
end
|
#license ⇒ Object
63
64
65
|
# File 'app/services/katello/pulp3/srpm.rb', line 63
def license
backend_data['rpm_license']
end
|
#relativepath ⇒ Object
39
40
41
|
# File 'app/services/katello/pulp3/srpm.rb', line 39
def relativepath
backend_data['location_href']
end
|
#size ⇒ Object
59
60
61
|
# File 'app/services/katello/pulp3/srpm.rb', line 59
def size
backend_data['size_package']
end
|
#vendor ⇒ Object
35
36
37
|
# File 'app/services/katello/pulp3/srpm.rb', line 35
def vendor
backend_data['rpm_vendor']
end
|