Skip to content

Commit a9ac637

Browse files
author
qount25
committed
Fix: deb package names should not include _, replace them with -
1 parent 6fb0482 commit a9ac637

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/pgpm/deb/spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ def generate(template_name, pkg_type=:versioned)
3131
end
3232

3333
def source_version
34-
@package.version.to_s
34+
v = @package.version.to_s
35+
v.match(/\Z\d+\.\d+\Z/) ? v + ".0" : v
3536
end
3637

3738
def deb_pkg_name(type=:versioned)
3839
if type == :versioned
39-
"#{@package.name}+#{@package.version.to_s}-pg#{@package.postgres_major_version}"
40+
"#{@package.name.gsub("_", "-")}+#{source_version}-pg#{@package.postgres_major_version}"
4041
else
41-
"#{@package.name}-pg#{@package.postgres_major_version}"
42+
"#{@package.name.gsub("_", "-")}-pg#{@package.postgres_major_version}"
4243
end
4344
end
4445

lib/pgpm/deb/templates/changelog.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= deb_pkg_name(pkg_type) %> (0-1) UNRELEASED; urgency=medium
1+
<%= deb_pkg_name(pkg_type) %> (0-1) stable; urgency=medium
22

33
* Version <%= pkg_type == :versioned ? 1 : source_version %> package release.
44

0 commit comments

Comments
 (0)