Skip to content

Commit 0a84b1d

Browse files
author
qount25
committed
Assign .os and .postgres_major_version to @Package in Pgpm::RPM::Spec constructor
1 parent 3b02c92 commit 0a84b1d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/pgpm/rpm/spec.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ class Spec
99
attr_reader :package, :release, :postgres_version, :postgres_distribution
1010

1111
def initialize(package)
12+
@postgres_distribution = Pgpm::Postgres::Distribution.in_scope
1213
@package = package
1314
@release = 1
1415

15-
@postgres_distribution = Pgpm::Postgres::Distribution.in_scope
16+
# Needed in order to return correct dependencies for the selected
17+
# version of postgres and selected OS.
18+
@package = package
19+
@package.os = "redhat"
20+
@package.postgres_major_version = @postgres_distribution.version.split(".")[0]
1621
end
1722

1823
def versionless

0 commit comments

Comments
 (0)