Skip to content

Commit

Permalink
fedora: remove "gpgcheck" from repository metadata
Browse files Browse the repository at this point in the history
It's redundant.
  • Loading branch information
kou committed Jan 12, 2025
1 parent c54e73f commit cbb89ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ See also: https://wiki.debian.org/SourcesList
Here are metadata for a Yum repository:

* `baseurl`: Required. The base URL that provides this repository.
* `gpgcheck`: Optional. No default.
* `gpgkey`: Optional. The URL of GPG key that is used for signing this
repository.
* `name`: Optional. The name of this repository.
Expand Down Expand Up @@ -314,7 +313,6 @@ Gem::Specification.new do |spec|
spec.requirements << "system: libpq: rhel: repository: id: pgdg17"
spec.requirements << "system: libpq: rhel: repository: name: PostgreSQL 17 $releasever - $basearch"
spec.requirements << "system: libpq: rhel: repository: baseurl: https://download.postgresql.org/pub/repos/yum/17/redhat/rhel-$releasever-$basearch"
spec.requirements << "system: libpq: rhel: repository: gpgcheck: 1"
spec.requirements << "system: libpq: rhel: repository: gpgkey: https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL"
# You can disable built-in "postgresql" module by "module: disable:
# postgresql".
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems-requirements-system/platform/fedora.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def install_command_line_repository(repository)
"name" => resolve_value_template(repository["name"]),
"baseurl" => resolve_value_template(repository["baseurl"]),
"enabled" => "1",
"gpgcheck" => repository["gpgcheck"],
"gpgcheck" => repository["gpgkey"] ? "1" : "0",
"gpgkey" => resolve_value_template(repository["gpgkey"]),
}.each do |key, value|
next if value.nil?
Expand Down
9 changes: 8 additions & 1 deletion test/fixture/dummy-postgresql-17/dummy-postgresql-17.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,25 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency("rubygems-requirements-system")

prefix = "system: libpq >= 17"

spec.requirements << "#{prefix}: debian: repository: id: pgdg"
spec.requirements << "#{prefix}: debian: repository: uris: https://apt.postgresql.org/pub/repos/apt"
spec.requirements << "#{prefix}: debian: repository: signed-by: https://www.postgresql.org/media/keys/ACCC4CF8.asc"
spec.requirements << "#{prefix}: debian: repository: suites: %{code_name}-pgdg"
spec.requirements << "#{prefix}: debian: repository: components: main"

spec.requirements << "#{prefix}: debian: libpq-dev"

# We need to install libssl.pc explicitly because postgresql17-devel
# doesn't have openssl-devel dependency.
spec.requirements << "#{prefix}: rhel: pkgconfig(libssl)"

spec.requirements << "#{prefix}: rhel: repository: id: pgdg17"
spec.requirements << "#{prefix}: rhel: repository: name: PostgreSQL 17 $releasever - $basearch"
spec.requirements << "#{prefix}: rhel: repository: baseurl: https://download.postgresql.org/pub/repos/yum/17/redhat/rhel-$releasever-$basearch"
spec.requirements << "#{prefix}: rhel: repository: gpgcheck: 1"
spec.requirements << "#{prefix}: rhel: repository: gpgkey: https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL"

spec.requirements << "#{prefix}: rhel: module: disable: postgresql"

spec.requirements << "#{prefix}: rhel: postgresql17-devel"
end

0 comments on commit cbb89ef

Please sign in to comment.