Skip to content

Commit 0b62193

Browse files
author
qount25
committed
Fix: use Pgpm::OS.in_scope to determine OS name at the package level
1 parent a1ca046 commit 0b62193

File tree

7 files changed

+11
-16
lines changed

7 files changed

+11
-16
lines changed

exe/pgpm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ module Pgpm
118118
end
119119
p = Pgpm::ScopedObject.new(p, os, arch)
120120
spec = p.to_rpm_spec
121-
builder = Pgpm::RedHat::Builder.new(spec)
121+
builder = Pgpm::RPM::Builder.new(spec)
122122
src_builder = builder.source_builder
123123
p = c.nil? ? src_builder : c.and_then(src_builder)
124124
p.and_then(builder.versionless_builder)

lib/pgpm/deb/spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def initialize(package)
1313
@postgres_distribution = Pgpm::Postgres::Distribution.in_scope
1414
@package = package
1515
@package.postgres_major_version = @postgres_distribution.major_version
16-
@package.os = "debian"
1716
@release = 1
1817
end
1918

lib/pgpm/package/building.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ def configure_steps
88
end
99

1010
def build_info
11-
case @os
11+
case Pgpm::OS.in_scope.class.name
1212
when "debian", "ubuntu"
1313
{ rules: "" }
14-
when "rocky", "redhat", "fedora"
14+
when "rocky+epel-9", "redhat", "fedora"
1515
{ build_steps: [], install_steps: [] }
1616
end
1717
end

lib/pgpm/package/dependencies.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ module Dependencies
77
attr_accessor :postgres_major_version
88

99
def build_dependencies
10-
case @os
10+
case Pgpm::OS.in_scope.class.name
1111
when "debian", "ubuntu"
1212
[
1313
"build-essential",
1414
"postgresql-#{postgres_major_version}",
1515
"postgresql-server-dev-#{postgres_major_version}",
1616
"postgresql-common"
1717
]
18-
when "rocky", "redhat", "fedora"
18+
when "rocky+epel-9", "redhat", "fedora"
1919
[
2020
"build-essential",
2121
"postgresql-#{postgres_major_version}",
@@ -26,10 +26,10 @@ def build_dependencies
2626
end
2727

2828
def dependencies
29-
case @os
29+
case Pgpm::OS.in_scope.class.name
3030
when "debian", "ubuntu"
3131
[ "postgresql-#{postgres_major_version}" ]
32-
when "rocky", "redhat", "fedora"
32+
when "rocky+epel-9", "redhat", "fedora"
3333
[ "postgresql-#{postgres_major_version}" ]
3434
end
3535
end

lib/pgpm/package/packaging.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ module Pgpm
44
class Package
55
module Packaging
66

7-
attr_accessor :os
8-
97
def to_rpm_spec(**opts)
108
Pgpm::RPM::Spec.new(self, **opts)
119
end

lib/pgpm/rpm/spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ def initialize(package)
1515

1616
# Needed in order to return correct dependencies for the selected
1717
# version of postgres and selected OS.
18-
@package = package
19-
@package.os = "redhat"
2018
@package.postgres_major_version = @postgres_distribution.major_version
2119
end
2220

packages/timescale/timescaledb.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ def dependencies
2929
end
3030

3131
def build_dependencies
32-
deps = case @os
32+
deps = case Pgpm::OS.in_scope.class.name
3333
when "debian", "ubunut"
3434
["libssl-dev", "cmake"]
35-
when "rocky", "redhat", "fedora"
35+
when "rocky+epel-9", "redhat", "fedora"
3636
["openssl-devel", "cmake"]
3737
end
3838
super + deps
3939
end
4040

4141
def build_info
42-
case @os
42+
case Pgpm::OS.in_scope.class.name
4343
when "debian", "ubuntu"
4444
{
4545
rules: "override_dh_auto_configure:\n" +
4646
"\tdh_auto_configure -- -DCMAKE_BUILD_TYPE=\"Release\""
4747
}
48-
when "rocky", "redhat", "fedora"
48+
when "rocky+epel-9", "redhat", "fedora"
4949
{
5050
build_steps: [
5151
"./bootstrap -DPG_CONFIG=$PG_CONFIG #{bootstrap_flags.map { |f| "-D#{f}" }.join(" ")}",

0 commit comments

Comments
 (0)