From fd67e502d056aed7e160ed4f3cc8a8d48f90d273 Mon Sep 17 00:00:00 2001 From: Ed Flanagan Date: Tue, 4 Apr 2017 13:44:01 -0700 Subject: [PATCH] packer 1.0.0 Closes #12063. Signed-off-by: FX Coudert --- Formula/packer.rb | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Formula/packer.rb b/Formula/packer.rb index e41947035e..ecf7ba310b 100644 --- a/Formula/packer.rb +++ b/Formula/packer.rb @@ -3,10 +3,10 @@ require "language/go" class Packer < Formula desc "Tool for creating identical machine images for multiple platforms" homepage "https://packer.io" - url "https://github.com/mitchellh/packer.git", - :tag => "v0.12.3", - :revision => "c0f2b4768d7f9265adb1aa3c91a0206ca707d91e" - head "https://github.com/mitchellh/packer.git" + url "https://github.com/hashicorp/packer.git", + :tag => "v1.0.0", + :revision => "e3d65a193e96c7b228589fc9699e39998ec12e4e" + head "https://github.com/hashicorp/packer.git" bottle do cellar :any_skip_relocation @@ -15,13 +15,6 @@ class Packer < Formula sha256 "a7ad3c8b1e29e5dbc0a3e2186a854734857dba886dbce220164e6515d53e1c76" => :yosemite end - devel do - url "https://github.com/mitchellh/packer.git", - :tag => "v1.0.0-rc3", - :revision => "974a2fe96fcc3a55787d188aff903b4fd86ab666" - version "1.0.0-rc3" - end - depends_on :hg => :build depends_on "go" => :build depends_on "govendor" => :build @@ -38,7 +31,7 @@ class Packer < Formula go_resource "golang.org/x/tools" do url "https://go.googlesource.com/tools.git", - :revision => "1dce95f761bfeb6fe2aa3c4e9ffdb261b69b3fc4" + :revision => "cbb995d093b2c4a12ac074e53d90373ecc827527" end def install @@ -49,7 +42,12 @@ class Packer < Formula # doesn't need to be installed permanently. ENV.append_path "PATH", buildpath - packerpath = buildpath/"src/github.com/mitchellh/packer" + # TODO: remove "else" (mitchellh path) on next release + if build.head? + packerpath = buildpath/"src/github.com/hashicorp/packer" + else + packerpath = buildpath/"src/github.com/mitchellh/packer" + end packerpath.install Dir["{*,.git}"] Language::Go.stage_deps resources, buildpath/"src" @@ -63,7 +61,7 @@ class Packer < Formula buildpath.install "stringer" end - cd "src/github.com/mitchellh/packer" do + cd packerpath do # We handle this step above. Don't repeat it. inreplace "Makefile" do |s| s.gsub! "go get github.com/mitchellh/gox", "" @@ -72,7 +70,11 @@ class Packer < Formula end (buildpath/"bin").mkpath - system "make", "releasebin" + if build.head? + system "make", "bin" + else + system "make", "releasebin" + end bin.install buildpath/"bin/packer" zsh_completion.install "contrib/zsh-completion/_packer" prefix.install_metafiles