Skip to content

Commit

Permalink
Merge pull request #718 from chef/jsinha/ips_name_fix
Browse files Browse the repository at this point in the history
BEN-121- Fix P5P package naming
  • Loading branch information
scotthain committed Oct 4, 2016
2 parents 7261a62 + 856279a commit 52b037e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/omnibus/packagers/ips.rb
Expand Up @@ -81,8 +81,7 @@ def publisher_prefix(val = NULL)
# @see Base#package_name
#
def package_name
version = project.build_version.split(/[^\d]/)[0..2].join(".")
"#{safe_base_package_name}-#{version}-#{project.build_iteration}.#{safe_architecture}.p5p"
"#{safe_base_package_name}-#{project.build_version}-#{project.build_iteration}.#{safe_architecture}.p5p"
end

#
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/packagers/ips_spec.rb
Expand Up @@ -8,7 +8,7 @@ module Omnibus
project.name("project")
project.homepage("https://example.com")
project.install_dir("/opt/project")
project.build_version("1.2.3")
project.build_version("1.2.3+20161003185500.git.37.089ab3f")
project.build_iteration("2")
project.maintainer("Chef Software")
end
Expand Down Expand Up @@ -55,7 +55,7 @@ module Omnibus

describe "#package_name" do
it "should create correct package name" do
expect(subject.package_name).to eq("project-1.2.3-2.i386.p5p")
expect(subject.package_name).to eq("project-1.2.3+20161003185500.git.37.089ab3f-2.i386.p5p")
end
end

Expand Down Expand Up @@ -211,7 +211,7 @@ module Omnibus
describe "#export_pkg_archive_file" do
it "uses the correct commands" do
expect(subject).to receive(:shellout!)
.with("pkgrecv -s #{staging_dir}/publish/repo -a -d #{package_dir}/project-1.2.3-2.i386.p5p project")
.with("pkgrecv -s #{staging_dir}/publish/repo -a -d #{package_dir}/project-1.2.3+20161003185500.git.37.089ab3f-2.i386.p5p project")

expect(shellout).to receive(:stdout)
subject.export_pkg_archive_file
Expand Down

0 comments on commit 52b037e

Please sign in to comment.