debian-mirror-gitlab/spec/factories/packages/debian/file_metadatum.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

143 lines
4.2 KiB
Ruby
Raw Normal View History

2021-03-08 18:12:59 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :debian_file_metadatum, class: 'Packages::Debian::FileMetadatum' do
2023-06-20 00:43:36 +05:30
package_file do
if file_type == 'unknown'
association(:debian_package_file, :unknown, without_loaded_metadatum: true)
else
association(:debian_package_file, without_loaded_metadatum: true)
end
end
2021-03-08 18:12:59 +05:30
file_type { 'deb' }
component { 'main' }
architecture { 'amd64' }
2023-06-20 00:43:36 +05:30
fields { { 'a' => 'b' } }
2021-03-08 18:12:59 +05:30
trait(:unknown) do
file_type { 'unknown' }
component { nil }
architecture { nil }
fields { nil }
end
trait(:source) do
file_type { 'source' }
component { 'main' }
architecture { nil }
fields { nil }
end
trait(:dsc) do
file_type { 'dsc' }
component { 'main' }
architecture { nil }
2021-10-27 15:23:28 +05:30
fields do
{
'Format' => '3.0 (native)',
'Source' => package_file.package.name,
2023-05-27 22:25:52 +05:30
'Binary' => 'sample-dev, libsample0, sample-udeb, sample-ddeb',
2021-10-27 15:23:28 +05:30
'Architecture' => 'any',
2023-06-20 00:43:36 +05:30
'Version' => package_file.package.version,
2021-10-27 15:23:28 +05:30
'Maintainer' => "#{FFaker::Name.name} <#{FFaker::Internet.email}>",
'Homepage' => FFaker::Internet.http_url,
'Standards-Version' => '4.5.0',
'Build-Depends' => 'debhelper-compat (= 13)',
2023-06-20 00:43:36 +05:30
'Package-List' => <<~PACKAGELIST.rstrip,
libsample0 deb libs optional arch=any
sample-ddeb deb libs optional arch=any
sample-dev deb libdevel optional arch=any
sample-udeb udeb libs optional arch=any
PACKAGELIST
2023-05-27 22:25:52 +05:30
'Checksums-Sha1' => "\n4a9cb2a7c77a68dc0fe54ba8ecef133a7c949e9d 964 sample_1.2.3~alpha2.tar.xz",
2023-06-20 00:43:36 +05:30
'Checksums-Sha256' =>
"\nc9d05185ca158bb804977fa9d7b922e8a0f644a2da41f99d2787dd61b1e2e2c5 964 sample_1.2.3~alpha2.tar.xz",
2023-05-27 22:25:52 +05:30
'Files' => "\nadc69e57cda38d9bb7c8d59cacfb6869 964 sample_1.2.3~alpha2.tar.xz"
2021-10-27 15:23:28 +05:30
}
end
2021-03-08 18:12:59 +05:30
end
trait(:deb) do
file_type { 'deb' }
component { 'main' }
architecture { 'amd64' }
2021-09-04 01:27:46 +05:30
fields do
{
2023-06-20 00:43:36 +05:30
'Package' => 'libsample0',
'Source' => package_file.package.name,
'Version' => package_file.package.version,
'Architecture' => 'amd64',
'Maintainer' => "#{FFaker::NameCN.name} #{FFaker::Name.name} <#{FFaker::Internet.email}>",
'Installed-Size' => '7',
'Section' => 'libs',
'Priority' => 'optional',
'Multi-Arch' => 'same',
'Homepage' => FFaker::Internet.http_url,
'Description' => <<~DESCRIPTION.rstrip
Some mostly empty lib
Used in GitLab tests.
2021-09-04 01:27:46 +05:30
2023-06-20 00:43:36 +05:30
Testing another paragraph.
DESCRIPTION
2021-09-04 01:27:46 +05:30
}
end
end
trait(:deb_dev) do
file_type { 'deb' }
component { 'main' }
architecture { 'amd64' }
fields do
{
'Package' => 'sample-dev',
'Source' => "#{package_file.package.name} (#{package_file.package.version})",
'Version' => '1.2.3~binary',
'Architecture' => 'amd64',
'Maintainer' => "#{FFaker::Name.name} <#{FFaker::Internet.email}>",
'Installed-Size' => '7',
'Depends' => 'libsample0 (= 1.2.3~binary)',
'Section' => 'libdevel',
'Priority' => 'optional',
'Multi-Arch' => 'same',
'Homepage' => FFaker::Internet.http_url,
2023-06-20 00:43:36 +05:30
'Description' => <<~DESCRIPTION.rstrip
2021-09-04 01:27:46 +05:30
Some mostly empty development files
Used in GitLab tests.
Testing another paragraph.
2023-06-20 00:43:36 +05:30
DESCRIPTION
2021-09-04 01:27:46 +05:30
}
end
2021-03-08 18:12:59 +05:30
end
trait(:udeb) do
file_type { 'udeb' }
component { 'main' }
architecture { 'amd64' }
2023-06-20 00:43:36 +05:30
fields { { 'a' => 'b' } }
2021-03-08 18:12:59 +05:30
end
2023-05-27 22:25:52 +05:30
trait(:ddeb) do
file_type { 'ddeb' }
component { 'main' }
architecture { 'amd64' }
2023-06-20 00:43:36 +05:30
fields { { 'a' => 'b' } }
2023-05-27 22:25:52 +05:30
end
2021-03-08 18:12:59 +05:30
trait(:buildinfo) do
file_type { 'buildinfo' }
component { 'main' }
architecture { nil }
2023-06-20 00:43:36 +05:30
fields { { 'Architecture' => 'amd64 source' } }
2021-03-08 18:12:59 +05:30
end
trait(:changes) do
file_type { 'changes' }
component { nil }
architecture { nil }
2023-06-20 00:43:36 +05:30
fields { { 'Architecture' => 'source amd64' } }
2021-03-08 18:12:59 +05:30
end
end
end